Download MetaTrader 5

Does any one know how to get the current value "Price" of a MA and display it into an " OBJ_EDIT " ?

To add comments, please log in or register
Chris Lazarius
310
Chris Lazarius  

Does any one know how to get the current value "Price" of a MA and display it into an " OBJ_EDIT "

let say the "MA" is a buffer of an indicator and I want it current price value.

have a look at the attached image. I want it price to be displayed into that text box.

Thanks, in advance.


   double iMA_value;
   
   ObjectCreate(0,"txt_Buy_Limit",OBJ_EDIT,0,0,0);
   ObjectSetInteger(0,"txt_Buy_Limit",OBJPROP_XDISTANCE,585);
   ObjectSetInteger(0,"txt_Buy_Limit",OBJPROP_YDISTANCE,45);
   ObjectSetInteger(0,"txt_Buy_Limit",OBJPROP_XSIZE,200);
   ObjectSetInteger(0,"txt_Buy_Limit",OBJPROP_YSIZE,25);
   
   ObjectSetString(0,"txt_Buy_Limit",OBJPROP_TEXT, DoubleToString(iMA_value) );
   
   ObjectSetInteger(0,"txt_Buy_Limit",OBJPROP_COLOR, Black);
   ObjectSetInteger(0,"txt_Buy_Limit",OBJPROP_BGCOLOR, White);
   ObjectSetInteger(0,"txt_Buy_Limit",OBJPROP_BORDER_COLOR,Orange);
   ObjectSetInteger(0,"txt_Buy_Limit",OBJPROP_BORDER_TYPE,BORDER_FLAT);
   ObjectSetInteger(0,"txt_Buy_Limit",OBJPROP_BACK,false);
   ObjectSetInteger(0,"txt_Buy_Limit",OBJPROP_HIDDEN,true);
   ObjectSetInteger(0,"txt_Buy_Limit",OBJPROP_STATE,false);
   ObjectSetInteger(0,"txt_Buy_Limit",OBJPROP_FONTSIZE,12);
Abdullah Alrai
23964
Abdullah Alrai  
Chris Lazarius:

Does any one know how to get the current value "Price" of a MA and display it into an " OBJ_EDIT "

let say the "MA" is a buffer of an indicator and I want it current price value.

have a look at the attached image. I want it price to be displayed into that text box.

Thanks, in advance.


just put this line in the ontick() function 

ObjectSetString(0,"txt_Buy_Limit",OBJPROP_TEXT, DoubleToString(iMA_value) );
To add comments, please log in or register