Add a text above a horizontal line
On both MQL5 and MQL4+ you can use ...
Sets the value of the corresponding object property
OBJPROP_TEXT
Description of the object (the text contained in the object)
string
On both MQL5 and MQL4+ you can use ...
Sets the value of the corresponding object property
OBJPROP_TEXT
Description of the object (the text contained in the object)
string
I used ObjectSetString , but my text doesn't display .
void OnStart() { //--- double price=SymbolInfoDouble(Symbol(),SYMBOL_BID)-(10*Point()); if(!ObjectCreate(0,"price_line",OBJ_HLINE,0,0,price)) { Print(__FUNCTION__, ": failed to create a Horizontal Line. Error code = ",GetLastError()); } ObjectSetInteger(0,"price_line",OBJPROP_COLOR,clrBrown); ObjectSetInteger(0,"price_line",OBJPROP_STYLE,STYLE_SOLID); ObjectSetInteger(0,"price_line",OBJPROP_WIDTH,1); ObjectSetInteger(0,"price_line",OBJPROP_SELECTABLE,true); ObjectSetInteger(0,"price_line",OBJPROP_SELECTED,false); ObjectSetInteger(0,"price_line",OBJPROP_HIDDEN,true); ObjectSetInteger(0,"price_line",OBJPROP_ZORDER,3); ObjectSetString(0,"price_line",OBJPROP_TEXT,"Price= " + DoubleToString(price)); }

