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

 

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);
 
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) );
Reason: