You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I wonder why a bar with index [rates_total - 1] always has all open, close, high, low values equal? Doesn't the index open[rates_total - 1] correspond to the index 1 in the timeseries? That is, it is the same as Open[1], Close[1],... in MT4.
Although, maybe index [rates_total - 1] corresponds to index 0 in timeseries? Then it means that [rates_total - 1] is the current bar and because it has not yet formed, its OCHL parameters are equal?
I wonder why a bar with index [rates_total - 1] always has all open, close, high, low values equal? Doesn't the index open[rates_total - 1] correspond to the index 1 in the timeseries? That is, it is the same as Open[1], Close[1],... in MT4.
Although, maybe the index [rates_total - 1] corresponds to the index 0 in the timeseries? Then it means that [rates_total - 1] is the current bar and because it has not yet formed, its OCHL parameters are equal?
By default the MQL5 indicators have the following indexing (by the example of "0" and "rates_total-1")
/* time[0] -> D'2018.01.02 00:00:00' time[rates_total-1] -> D'2018.12.31 22:00:00' */
As you can see the rightmost bar in the chart has the "rates_total-1" index. But index "0" will correspond to the leftmost bar in the chart.
By default the MQL5 indicators have the following indexing (using "0" and "rates_total-1" as examples)
As you can see, the rightmost bar in the chart has the "rates_total-1" index. The "0" index will correspond to the leftmost bar in the chart.
The one to the right is the current one? The one that has not formed?
In general, as I understand it, rates_total-1 points to the current bar, and since it has not formed, its OHCL parameters in the timers are equal.
The rightmost one - that is the current one? The one that has not formed?
Look at any chart - the rightmost bar on the GUIDE is the current bar, which is in the process of forming (i.e. all its prices and volume can be changed at any time).
Look at any chart - the rightmost bar on the GUIDE is the current bar, which is in the process of forming (i.e. all its prices and volume can be changed at any time).
Yes, I understand that. I was just surprised that it has all values equal before it gets index 1 in the timeseries. That is, it stops being current.
What is the other index one? The rightmost bar on the chart in the MQL5 indicators has an index of "rates_total-1".
What is the other index one? The rightmost bar on the chart in the MQL5 indicators has an index of "rates_total-1".
You don't understand what I'm talking about. rates_total-1 THIS IS the current bar. I know that. BUT. THE OCHL VALUES IN THE TIMESERIES ARE EQUAL. Check the code I posted. That's exactly what I didn't know.
You do not understand what I am talking about. rates_total-1 THIS is the current bar. I know that. BUT. THE OCHL VALUES IN THE TIMESERIES ARE EQUAL. Check the code I posted. That's exactly what I didn't know.
The current bar (the rightmost on the chart) will have EQUAL prices at the moment the bar is born - this is the basics: the bar has just been born and all prices are the same. With the arrival of new ticks the prices of the current bar (the rightmost bar in the chart) will start to change.
I hope it is clear? At the moment of bar birth and its OHLC are equal.
Your code only takes values when the bar opens
Ouch, hasty, the man himself should have realised that ...