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
_StopFlag issue is already reported to MetaQuotes.
In all cases it's a bad practice to use such loop in an indicator.
_StopFlag issue is already reported to MetaQuotes.
In all cases it's a bad practice to use such loop in an indicator.
Fixed. Available in next build after 5836.
Fixed. Available in next build after 5836.
here's a way to structure this that sidesteps the problem entirely. Indicators support OnTimer, so instead of blocking OnCalculate with a while or do-while loop, history can load in small batches on a timer while OnCalculate stays fast every time it's called.
Set a millisecond timer in OnInit with EventSetMillisecondTimer(50) or similar. In OnTimer, request one batch of ticks with CopyTicks or CopyTicksRange, process that batch, update LAST_TICK_TIME, and return immediately rather than looping until everything is copied. The next OnTimer call picks up where the last one left off.