Download MetaTrader 5
To add comments, please log in or register
Do you need a programmer? Make an order to let the developer find you!
pete42
18
pete42 2015.10.24 09:47 

Hi all,


I am a newbie trying to build my EA working around with Labels and Text messages to create a dashboard. It takes a lot of lines to create a text with a rectangle background.

I was wondering if there is a function for positioning the Label, similar to ObjectSetText where you can input the size, font and color on one line. Isn't there a function to set the object label position by inputting the Corner, X & YDistance ie: ObjectSetPosition(name, Corner, Xdistance, Ydistance)... 3 lines in one!


Cheers!

pete

honest_knave
947
honest_knave 2015.10.24 10:06  

You need to make you own.

Example:

void SetPosition(string name, int corner, int x, int y)
  {
   ObjectSetInteger(0, name, OBJPROP_CORNER,    corner);
   ObjectSetInteger(0, name, OBJPROP_XDISTANCE, x);
   ObjectSetInteger(0, name, OBJPROP_YDISTANCE, y);
  }  

 

Then call it like so: 

   SetPosition("MyObject1", CORNER_RIGHT_UPPER, 10, 10);   
   SetPosition("MyObject2", CORNER_LEFT_UPPER , 15, 15);   
   SetPosition("MyObject3", CORNER_RIGHT_LOWER, 20, 20);   
pete42
18
pete42 2015.10.24 18:52  
honest_knave:

You need to make you own.

Example:

 

Then call it like so: 

Wow, you just saved the day!! I was about to give up... Thank you
/
To add comments, please log in or register