Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1118

 
Roman Sharanov:

Why is the candle output not working?


And you print the two elements of the time array with index 0 and index rates_total-1
 
Vladimir Karputov:
And you print the two elements of the time array with index 0 and index rates_total-1

I don't get it anymore. I sat for a long time with these fucking rates_total and prev_calculated, I just spat and wrote it straight. I ran debugging, and the values are written to the buffers correctly!

But apparently they're written to the very beginning of the graph, yeah.

 
wrote index rates_total - i, also nothing
 
Roman Sharanov:
wrote index rates_total - i, also nothing
Are you sure you printed the two indexes as I advised? Yes or no?
 
Vladimir Karputov:
Did you definitely print out the two indexes as I advised? Yes or no?
 
Roman Sharanov:

Why does the candlestick output not work?


You just need to understand and remember that mql5 indexing of bars compared to mql4 is exactly backwards. The leftmost bar has index 0 and the current rates_total-1.

Consequently, bar 100 as in mql4 will have index rates_total-1-100.

 
Roman Sharanov:

Now carefully compare the index and the time. You should see and understand that in the indicators, the rightmost bar on the chart corresponds to index #0 in the price arrays.

 
It all worked out, thanks for your help!
 
Question on the mobile version of mt5. There are no past trades in the log, why?
 
Can you tell me how to make a pause of 1 millisecond? Sleep(1) is not an option because it pauses from 0 to 50 milliseconds or so. When called with parameter 1.