In mql4 we can add some text to a HLine with ObjectSetText command. But in MQL5 I can't find any way to do this. Anybody Knows any solution to add a text above a Horizontal line?
mahmoodi1072: In mql4 we can add some text to a HLine with ObjectSetText command. But in MQL5 I can't find any way to do this. Anybody Knows any solution to 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
Fernando Carreiro #:
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)); }
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register