MQL4 Object Label Line break?

MQL4 Object Label Line break?

Manage alerts

Loading saved threads...

Stephen Nidea · External communityPost link
External question — Stack Overflow Stack Exchange Author: Stephen Nidea Original post: https://stackoverflow.com/questions/66774958 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. I am having a problem with line break in object label in mql4?? the "/n" is not working. is there other way?? I want to show in chart, Text 1 Text 2 Text 3, Thanks in advance experts.
Quote
Report
Renz Carillo · External communityPost link
External answer — Stack Overflow Stack Exchange Author: Renz Carillo Original post: https://stackoverflow.com/a/66783450 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. It is "\n" for mql4/mql5
Quote
Report
PaulB · External communityPost link
External answer — Stack Overflow Stack Exchange Author: PaulB Original post: https://stackoverflow.com/a/66803675 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. The actual escape sequence to use for a new line is as per the following example: Comment("Line1\r\nLine2"); However you can not have line breaks in Objects. You should instead make a separate object for each line. For example: string id="ObjectName1"; ObjectCreate (0, id, OBJ_LABEL, 0, 0, 0); ObjectSet (id, OBJPROP_CORNER, 0); ObjectSet (id, OBJPROP_XDISTANCE, 10); ObjectSet (id, OBJPROP_YDISTANCE, 10); ObjectSetText (id, "Line 1", 10, "Arial", clrBlack); id="ObjectName2"; ObjectCreate (0, id, OBJ_LABEL, 0, 0, 0); ObjectSet (id, OBJPROP_CORNER, 0); ObjectSet (id, OBJPROP_XDISTANCE, 10); ObjectSet (id, OBJPROP_YDISTANCE, 20); ObjectSetText (id, "Line 1", 10, "Arial", clrBlack);
Quote
Report

Post Reply

Quoted from Forex.com.bd-Editorial External answer — Stack Overflow Stack Exchange Author: PaulB Source score (net votes, not local likes): 3 Original post: https://stackoverflow.com/a/66803675 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. The actual escape sequence to use for a new line is as per the following example: Comment("Line1\r\nLine2"); However you can not have line breaks in Objects. You should instead make a separate object for each line. For example: string id="ObjectName1"; ObjectCreate (0, id, OBJ_LABEL, 0, 0, 0); ObjectSet (id, OBJPROP_CORNER, 0); ObjectSet (id, OBJPROP_XDISTANCE, 10); ObjectSet (id, OBJPROP_YDISTANCE, 10); ObjectSetText (id, "Line 1", 10, "Arial", clrBlack); id="ObjectName2"; ObjectCreate (0, id, OBJ_LABEL, 0, 0, 0); ObjectSet (id, OBJPROP_CORNER, 0); ObjectSet (id, OBJPROP_XDISTANCE, 10); ObjectSet (id, OBJPROP_YDISTANCE, 20); ObjectSetText (id, "Line 1", 10, "Arial", clrBlack);

Cancel quote

Checking account access…