MQL4: how to show on chart multiple lines text?(except "comment")

Regarding standard library, there seems not much tutorials or examples out there, so I asked chatgpt, which gave me some fake answers including “multiline” properties. I did some simple test on both ChartObjectsTxtControls and Edit, and chatgpt keeps creating multiline concept.

Does anybody know: how do I show on chart multiple lines text? (except “comment”)

//|                                                                  |
void PlaceTextOnScreenXY(string ObjText, int x, int y)
      //Print(" Button 162 "+ ObjText);
      string temp = "Function9099" + IntegerToString(y);
      ObjectDelete(0, "Function9099" + IntegerToString(y));
      ObjText = y + "  " + ObjText;
      Print(ObjText);                                    // replicate screen message into print as well
      if(ObjectCreate(temp, OBJ_LABEL, 0, 0, 0))
         ObjectSet(temp, OBJPROP_XDISTANCE, x);
         ObjectSet(temp, OBJPROP_YDISTANCE, 20 * y);
         ObjectSet(temp, OBJPROP_CORNER, 0);
         ObjectSetText(temp, ObjText, 10, "Arial Black", colour);
1 Like

Thanks. But that’s not multilines.

Do one line with a value in y,
Then do another with y one number larger, which will put it 20 pixels down.
repeat until you have all your lines.

With the X value you can move the information to the right.

If you want to measure off of another corner, then change OBJPROP_CORNER.

1 Like

I see. Sorry I did not think it through.
What technique would you recommend to use, if I want to add an input edit box or something, to let user input multiline text or modify them?

I assume you want to make notes on the screen, do a screenshot to document your trading results.
You can use the built in TextBox, but it is line by line.
I worked to get ChatGPT to make on but it always had errors in the code and it was outside my programming ability.

If you have a different purpose or need from the text box than written above, add that.
The image here is a Chart, a NotePad text over the top and then I took a snapshot with ShareX 15.0, which should be free. This is a workaround and may not work at all for your purposes.

1 Like

Yes, sir, my purpose is to make notes.
Thank you for all the help, really appreciate it!