how to prevent restart object in mql5?

 

Hi I want create indicator with some objects that users can select one of them and change the position as they like.

I use this code but when the user change location, the object location or time frame change, object instantly back to default .

how can prevent this?

Probably because of time[0]. I do not know what to write instead.

   ArraySetAsSeries(time,true);
    


     
         ObjectCreate(0,"FristPeriodStartPoint",OBJ_TEXT,Iwindows,time[0],5);
         ObjectSetString(0, "FristPeriodStartPoint",OBJPROP_TEXT,"0");
         ObjectSetInteger(0, "FristPeriodStartPoint",OBJPROP_COLOR,clrRed);
          ObjectSetInteger(0,"FristPeriodStartPoint",OBJPROP_SELECTABLE,true);
   ObjectSetInteger(0,"FristPeriodStartPoint",OBJPROP_SELECTED,true);

 
Change it to a script; create the object(s) and then exit.
 
William Roeder #:
Change it to a script; create the object(s) and then exit.

But I want create something like the indicator in the picture I attach. in this indicator when the user move vertical line, all of the other object move too. so the script dose not work here.

how can create this, so when the timeframe change the objects position not restart?

Files:
sdadasd.png  25 kb