Hello Mql.
I am developing an indicator on MQL4 , what i am doing is utilizing a while loop -blocking further operations- (placed in OnInit function) until
all the bars have loaded from the broker in a chart.
I Check if the current time - last candle time is <= one bar time for this period.
heres the segment that ... makes MT4 freeze . :)
Enlighten if you can . :)
You have answered your own question: it is blocking further operations.
https://docs.mql4.com/runtime/running
"All indicators share the resources of graphic interface thread of the terminal"
When you change the timeframe then the indicator blocks the terminal so it can not load the candles. If it can not load the candles, Bars_Loaded will be always 0...
You have answered your own question: it is blocking further operations.
https://docs.mql4.com/runtime/running
"All indicators share the resources of graphic interface thread of the terminal"
When you change the timeframe then the indicator blocks the terminal so it can not load the candles. If it can not load the candles, Bars_Loaded will be always 0...
I'll transform this to monitor if the candles have loaded through OnTimer and act accordingly

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello Mql.
I am developing an indicator on MQL4 , what i am doing is utilizing a while loop -blocking further operations- (placed in OnInit function) until
all the bars have loaded from the broker in a chart.
I Check if the current time - last candle time is <= one bar time for this period.
heres the segment that ... makes MT4 freeze . :)
Enlighten if you can . :)