I am testing an MQL5 custom indicator on historical data using Strategy Tester. See below:
At this stage the next (current) bar being is being drawn and the only 1st tick of this new bar has been drawn on the chart. (This bar is EUR/USD at 2015.08.04 00:00) The data window shows the following values for this new bar:
O=1.0951, H=1.0951, L=1.0951, C=1.0951.
However, the above Print statement results show that the arrays (open, high, low, close) still contain the values from the previous bar. Only when the 2nd tick of the new bar arrives, do we see the results from the 1st tick n the arrays. For every new tick of each bar, the same is true: The arrays contain the information only up to the previous tick.
You can test it for yourself to see it for yourself, if you wish. Is this a bug or is MQL5 designed with this intention in mind?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am testing an MQL5 custom indicator on historical data using Strategy Tester. See below:
Second last (previous) bar on ST chart shows a bar O=1.0951, H=1.0951, L=1.0950, C=1.0950. (This bar is EUR/USD at 2015.08.03 23:59)At this stage the next (current) bar being is being drawn and the only 1st tick of this new bar has been drawn on the chart. (This bar is EUR/USD at 2015.08.04 00:00) The data window shows the following values for this new bar:
O=1.0951, H=1.0951, L=1.0951, C=1.0951.
However, the above Print statement results show that the arrays (open, high, low, close) still contain the values from the previous bar. Only when the 2nd tick of the new bar arrives, do we see the results from the 1st tick n the arrays. For every new tick of each bar, the same is true: The arrays contain the information only up to the previous tick.
You can test it for yourself to see it for yourself, if you wish. Is this a bug or is MQL5 designed with this intention in mind?