Discussion of article "Liquid Chart" - page 4

 
handel:
If I understand correctly, the phantom bar appears when the trading session ends at 23:00 on Friday. And if the trading session ends at 23:59, where the bar can appear from. Please describe on a concrete example, what time interval includes two candles that appeared on Monday. I do not understand such a point, the opening price of daily candles on the indicator at the shift to any number of hours remains unchanged, although it should take the opening price of the hour candle, which is the first at this shift?

Example.

Daily chart, base period H1. Initial position - shift 0. The indicator repeats the initial chart. Bar N opens at 00:00:00 2015.08.03, bar N+1 at 00:00:00 2015.08.04, bar N+2 will open at 00:00:00 2015.08.05, and so on.

We add a shift of 1 unit of the base period. In this case, it is 1 hour. Now all bars of the resulting chart will be rearranged. The day will begin not at 00:00:00, but at 01:00:00. So bar N will open at 01:00:00:00 2015.08.03, bar N+1 at 01:00:00:00 2015.08.04, bar N+2 will open at 01:00:00 2015.08.05, and so on. But we have data for the time from 00:00:00:00 to 01:00:00. We can't throw them away, so the bar for Sunday is formed from them.

Everything is logical: if, taking into account the shift, our synthetic "day" now starts at 01:00:00, it should end in 24 hours, i.e. at 00:59:59 of the next calendar day. The data for Sunday cannot be added to the Friday bar, because the gap between the opening times of the bars of the base period is more than a day.

 
handel:

Why do I need this? I want to see what Americans, Australians, Japanese, etc. see on daily charts. Since the terminal time is different for everyone, the time of formation of a daily candle is different for everyone, and therefore the picture on the daily charts is different for everyone. Having an opportunity to watch the situation in different time zones, there are more opportunities not to miss the right moment of entry. What if we don't try to subtract the time of the necessary tick by subtracting the shift time from the time of an optredetermined bar. And take the GTM time as a reference point, subtract the shift time from this time and the first tick that comes after this time will go to form a new candle and accordingly the tick that comes before this time will be the last tick of the previous candle. It's the same principle as a regular chart, if the terminal time is 00:00, it doesn't matter when the first tick comes, it will still be the first tick of a new candle.

In this case, you just need an indicator that rearranges the chart from one GMT to another. There are probably such in kodobase or among the free ones in the marketplace.

It is really inconvenient to use my example in your case. Unless you want to modify the code to throw out extra bars, if you are not worried about data loss.

The technique described in the article is designed for something else. In dynamic offset mode and with a fast base period, the probability of finding formations increases for those who use candlestick analysis.

 
Stanislav Korotky:

Secondly, the closing time should be determined not by quantity - how many base bars theoretically fit into the current period relative to the opening, but individually for each bar of the current period take its opening time, take the opening time of the next bar, for the second one look for a bar of the base period and read the previous bar in the base period - this will be the end of the liquid bar.

The quantity there is defined only to check that the specified shift lies within the permissible limits.

Bars are generated as follows. First, the time frame for the bar to be synthesised is defined. Then, we copy the array of bars of the base period, which is included in these frames. Using the array data, we obtain the OHLC of the bar to be synthesised. The number of bars of the base period can be different. If we fail to copy any bar of the base period - skip it and proceed to the formation of the next bar.

 
Serhii Shevchuk:

Example.


The data for Sunday we cannot add to the Friday bar, because the gap between the opening times of bars of the base period is more than a day.

Why can't we add a condition that if today is Friday and then data for Sunday comes, then this data is added to the Friday bar, so as not to delete phantom candles, because it will give incorrect results?
 
handel:
And why can't we add a condition that if today is Friday, and then data for Sunday comes, then this data is added to the Friday bar, so as not to delete phantom candles, because it will give incorrect results?

Because bars don't form that way. A daily bar cannot have inside quotes with a difference of more than a day. Technically, you can do anything, even cram a week into a minute bar, but will it make sense?

Moreover, there are often gaps at the intersection of weeks. If you add data from Sunday bar to Friday bar, you will get a long bar, which will be misleading - whether it is a powerful movement of Friday or a gap.

Here is an example where the Sunday daily bar consists of just one hourly bar. No churn, the original chart:

Now let's open the hourly chart and find the very bar that formed Sunday's daily bar :

Why, according to your suggestion, would the broker not perform a merge of this bar with Friday's bar? Because that's not by the book. Bars don't form that way.

 
Serhii Shevchuk:

Here's an example where Sunday's daily bar consists of just one hourly bar. No fancy stuff, original chart:

Now let's open the hourly chart and find the very bar that formed Sunday on the daily chart:

But this does not seem to be the case - here the Sunday bar is in the broker's quotes - both on the daily and H1, so it is not a "phantom" created in the indicator, but a real bar.
 
Serhii Shevchuk:

We add a shift of 1 unit of the base period. In this case, it is 1 hour. Now all bars of the resulting chart will be rearranged. The day will begin not at 00:00:00:00, but at 01:00:00. So bar N will open at 01:00:00:00 2015.08.03, bar N+1 at 01:00:00:00 2015.08.04, bar N+2 will open at 01:00:00 2015.08.05, and so on. But we have data for the time from 00:00:00:00 to 01:00:00. We can't throw them away, so the bar for Sunday is formed from them.

Everything is logical: if, taking into account the shift, our synthetic "day" now starts at 01:00:00, it should end in 24 hours, i.e. at 00:59:59 of the next calendar day. We cannot add Sunday's data to Friday's bar because the gap between the opening times of the base period bars is more than a day.

This is a philosophical question: either we cut the synchronisation of bars by phantoms, or we need to pump the base bars from day to day without regard to the time gap. Who likes what better.

I have counted by the algorithm described above (counting the shift from the beginning of one bar of the current tf to the next), that is, if we continue the same example and need a shift of 1 hour, then the Friday bar will include everything from 1:00 Friday to 1:00 Monday. The reasoning is simple - Friday and Monday are neighbouring bars in the current period, there are no Sundays there, and therefore cannot be in the indicator.

 
Stanislav Korotky:
But this does not seem to be the case - here the Sunday bar is in the broker's quotes - both on the daily and H1, so it is not a "phantom" created in the indicator, but a real bar.
And how is the Sunday bar created in the indicator worse than the Sunday bar in the broker's quotes? If we get synthetics by shifting the opening time, the same rules apply to it. If there is data for an hour before Monday, then Sunday is formed from it, and no other way. It is quite normal that the resulting chart crawls away from the corresponding bars of the initial chart.
 

Stanislav Korotky:

The reasoning is simple - Friday and Monday are neighbouring bars in the current period, there are no Sundays there, and therefore cannot be in the indicator.

Here I strongly disagree, but I have no desire to argue.
 
Serhii Shevchuk:
How is a Sunday bar created in the indicator worse than a Sunday bar in the broker's quotes? If we get synthetics by shifting the opening time, the same rules apply to it. If there is data for an hour before Monday, then Sunday is formed from it, and no other way. It is quite normal that the resulting chart crawls away from the corresponding bars of the initial chart.

Quotes are initial data, so the presence of Sundays or Saturdays in them is not discussed and cannot be changed - the broker gives it to us from above.

And the initiator is bound to quotes and should be synchronised with them. The presence of phantoms breaks this binding. It is at least inconvenient.

But let everyone decide for himself what is better.