Questions from Beginners MQL5 MT5 MetaTrader 5 - page 622

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
Another question, how do I check the integrity of the history during initialization in MT4? I have a suspicion that at the moment of initialisation the history is being swapped, which affects the pre-calculation...
Check the number of bars rates_total. If rates_total > prev_calculated+1 - it means that more than 1 bar was swapped and hence the history has been swapped.
And frequency of check do once per second, and after long pause continue initialization, right?
In general, as I was recently told in SD, it is better to do without timer in indicators.
It is enough to add the condition: if( prev_calculated <= 0 || rates_total > prev_calculated+1 ) as a condition of first start and full recalculation of the indicator. If you do it in OnCalculate(), there will be no problems.
In general, as I was recently told in SD, in indicators it is better to do without timer.
It is enough to add the condition: if( prev_calculated <= 0 || rates_total > prev_calculated+1 ) as a condition of first start and full recalculation of the indicator. If you do it in OnCalculate(), there will be no problem.
I want to have a correct calculation of indicator type class in my Expert Advisor.
If we allow 10 000 bars per chart, and we have them, then Bars will not return more than 10000 even if there is a new bar. Then how do I know if there is a new bar when the history is loaded?
Well, I need the indicator type class to be calculated correctly in my EA.
Therefore I am confused, if 10000 bars per chart are allowed and they are, then Bars will not return more than 10000 even if new bars appear. Then how do I know if there is a new bar when loading history?
Why not? Yes, it will. And Bars() and rates_total will increase. Check the number in OnCalculate().
The number of bars set in the terminal does not affect to the number of bars in the tester (a little less than 100000).
Why not? It will. Both Bars() and rates_total will increase. Check the number in OnCalculate().
The number of bars set in the terminal did not affect the number of bars in the tester (just under 100000).