Download MetaTrader 5
To add comments, please log in or register
Find out how social trading can improve your profits
jkmaks
36
jkmaks 2016.04.07 08:15 

I know how to create a obj_text and then attach it to the bar:

 

      ObjectCreate("z1", OBJ_TEXT, 0, X_TopRight(), Y_TopRight2());

      ObjectSetText("z1", "z", 14, "Times New Roman", Maroon);

      ObjectSet("z1", OBJPROP_TIMEFRAMES, OBJ_PERIOD_M1);      

 

datetime X_TopRight(int fidge)

   {     

      return (Time[fidge - 10]);

   }


double Y_TopRight() 

   {

      double   top=WindowPriceMax();

      double   bottom=WindowPriceMin();

      

      return (top - 0.8*(top-bottom)); 

   }

    

But is there way to create an OBJ_TEXT and put it to the right corner (not depending on the bar)??

Of course OBJ_TEXT will stay where it appeared (and won't behave like OBJ_LABEL).  

Keith Watford
Moderator
8015
Keith Watford 2016.04.07 08:48  

Of course OBJ_TEXT will stay where it appeared (and won't behave like OBJ_LABEL). 

You have it the wrong way round.

Use an OBJ_LABEL with x and y co-ordinates and it will stay where you put it.

jkmaks
36
jkmaks 2016.04.07 14:22  
I mean, when I move by graphic, roll back in the past, the OBJ_TEXT will stay where I created it. 
whroeder1
13644
whroeder1 2016.04.07 15:56  
jkmaks: I mean, when I move by graphic, roll back in the past, the OBJ_TEXT will stay where I created it. 

Asked and answered
GumRai: Use an OBJ_LABEL with x and y co-ordinates and it will stay where you put it.
/
To add comments, please log in or register