Download MetaTrader 5
To add comments, please log in or register
Do you want to deposit to your account? Do this in any convenient way!
Gheorghe Cosoveanu
Gheorghe Cosoveanu 2016.09.12 21:37 

I have a special situation...

In an indicator I create a Fibo Object... I want to allow the indicator that is creating the Fibo object to be added multiple times on the chart and that fact forces me to add an index to the Fibo object name in the Init() function for the indicator.

Everything is working fine adding or removing the indicator from the chart but if I save a template containing the indicator it seems to me that the objects saved in the template are first created and after that also the Init() of the indicator is checked...

In Init() for the indicator I have code something like this:

   for(int NoFibos=1; NoFibos<=10; NoFibos++)



         if(ObjectFind(0,FiboName) < 0)





    ... Create the object with the name FiboName...


So in my scenario, I add the indicator once, "FiboObj1" object is created and I save it in a template. When I re-load the template,  "FiboObj1" is already found using my code above in the Init() function and the "FiboObj2" is created having now 2 Fibo objects instead of only one as I had when saved the template.

And Yes, my DeInit() function has code to remove all objects and it is working properly removing the objects. 



Thank you. 

To add comments, please log in or register