Dynamically loading indicators outside OnInit function

 

Dear Coders.

I need to call some indicators from outside OnInit function.

This seems to be a lot of problem with this MQL5 language.

I had this problem probably from 2012. Not I am just curious if MQL5 language have some solution calling indicators from out side OnInit function.

I tried several options forcibly calling indicators two or three time.

But the results is still not quite stable.

Have any one got some good ideas of dynamically calling indicators after Initialization is done.

Please share your thoughts. Thanks in advance.

Kind regards.

 
Can you tell more about the problems you have? I load indicators in the OnTick or the OnTimer event without problems. Just have to make sure there are enough history rates loaded.
 
twalk:
Can you tell more about the problems you have? I load indicators in the OnTick or the OnTimer event without problems. Just have to make sure there are enough history rates loaded.
I am calling several  indicators on chart event function.

Every time i load the indicators they are not quite stable.

Sometomes data arw not fully loaded.

I call them inside indicators.

Thanks for your help.

Kind regards. 
 

It happens sometimes when the rates are not fully loaded. I use CopyRates before loading the indicators to make sure I have enough rates.

 
twalk:

It happens sometimes when the rates are not fully loaded. I use CopyRates before loading the indicators to make sure I have enough rates.


Yes. I used copyrates. My observations are that several indicators are loaded without any problem. But few indicators are not loaded.

I think they really depend on calculation speed of indicators I guess.

Hope indicator loading process become more stable in next update as many people experience the same problem over and over.

Reason: