Suggestion feature to the Last Bar

Dear Tomasz,

Would it be possible to re-consider to add a function in Amibroker to make the last bar containing the same periods as the previous bars in the same chart? I remember I once mentioned this suggestion before and think it is still a very valuable feature to be added in.

The current situation is except for the last bar every previous bars represents the same time length when seeing a chart in any time frame. The advantage is every bar's shape is fixed with time except for the last bar.

The disadvantage is the last bar has lost its function of giving the current meaningful implication to the stock price's direction if its strength is concerned under that chart's time frame. It is because the last bar does not carry the same weight as the previous bars. This situation becomes especially problematic when the time period is long, eg. 20D, 60D, or 200D. While the rest of the bars represent 20D, 60D, or 200D, the last bar represents the time could be as little as one day. Furthermore, when the time period is same for example 60D, the days represented by the last bar could be varied between 1 and 59 days for different stocks because each stock counts the starting day differently. Therefore the strength of the last bar varies with no pattern to follow. Therefore it gives very little meaningful information.

On the other hand, if the last bar has the same time strength as the previous ones, the information given by the last bar would have the value same as any previous bars. And the pattern and trend formed by this last bar and the previous bars would truly represent the pattern and trend being considered in that time frame. One may worry that the whole chart would be varied with the time. This is true. But it would not change the chart history, wherever the peaks or troughs were, there will still be the places, same as the up or down trends. Besides one would be more interested in the current situation rather than the history. It would be more accurate if indicators are calculated by using this last bar together with the previous bars, because this last bar carries the same weight as the previous bars, for example, moving average: 5 in a 20D chart. We could know the MV value would always be the trend result of the past 100 days, not the random value between past 81 to past 100 days. The other advantage can be seen if one uses candle sticks. If the last 3 bars form a morning-star, it is a strong reversal pattern. It would be a very important signal if it appears in a longer time frame eg 20D. It could appear in the middle of a month. If the last bar has the same strength as the previous bars this pattern could be easily captured with no doubt and no delay. So the last bar with the same time strength could form a truly adaptive patterns and gives more accurate information

I used MetaStock before, which makes the last bar having the same weight as the previous bars. I found it was very helpful in that regard.

Not everyone would like this idea, but I think there would be lots of people would think the idea could be quite helpful.

So if you could consider to add this function to be coexisting with the existing one, the Amibroker would be adding a much useful tool to many people.

Your consideration is very much appreciated.

Kind regards
Yutong Wang

I don't know what Metastock version did you use but I never seen MS working like this.

The LAST BAR in EVERY software I have seen is always the one that is build up as new data come in and never "fixed".

If last bar always contained 20 most recent days, then all PAST bars would change when new day came in, which is nonsense because you would be changing all past bars every day making all you analyses from previous days INVALID.

So, no, the idea is nonsensical and won't be implemented as a "feature".

But if you want it really badly, you can create such bars easily using ValueWhen/HighestSince/LowestSince as shown in the formula below:

periods = 20;

Reverse_index = BarCount - 1 - BarIndex();
points = Reverse_index % periods == 0;

so = ValueWhen( Ref( Points, -1 ), Open );
sh = HighestSince( Ref( Points, -1 ), High );
sl = LowestSince( Ref( points, -1 ), Low );
sc = ValueWhen( Points, Close );

so = IIf( points, so, Null );
sh = IIf( points, sh, Null );
sl = IIf( points, sl, Null );
sc = IIf( points, sc, Null );

PlotOHLC( so, sh, sl, sc, "Strange bars", colorDefault, styleCandle );
5 Likes

Thank you very much for your reply and the solution provided.
I have been confirmed by MetaStock staff that the way the MetaStock handle the last bar is it contains the same time periods as the previous bars. That is the last bar has the same weight/strength in terms of the time length as the previous ones. I know MetaStock 6.5 and 10 and 11 was like that because I used them. The MetaStock staff confirmed me that even today the version 17 is still handling the last bar this way.
Your reconsideration is very much appreciated.

Tomasz, Sorry my apology. MetaStock does not keep the last bar having the same time as the previous bars after rechecking with MetaStock staff with more details. You are right. Sorry for my misquoting.

2 Likes