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 . :)
//check bars loaded state
You have answered your own question: it is blocking further operations.
"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...