Displaying information on screen

 

In MQL4 I have been using "Comments" to display information in the left upper corner. It is 15 lines.

Trying to use the same technique in MQL5 does not seem to work. Lines are not replaced, they are added.

What I have found in MQL5 is ObjectCreate  LABEL.  With a heading and a value for each line and seven lines of code for each

it results in a lot of coding lines.

So I tried to find something else and found some GUI example with widgets and whatnot. I Quickly got lost.

I want to put 15 lines similar to this:

Stochastic M15:   65

A fixed heading and a variable that is continously updated. Nothing fancy.  What is the most straight forward metod to do this?

 
Comment() function is the same as in MQL4. Addition thing that is in MQL5 is ability to get chart comment using ChartGetString() function.
Documentation on MQL5: Chart Operations / ChartGetString
  • www.mql5.com
Chart Operations / ChartGetString - Documentation on MQL5
 

Hi WWer,

I experienced  a difference in how Comment() work in MQL5 and MQL4.  A Comment("");  did not clear the old comments on screen

I found the ChartSetString function and it works nicely

Documentation on MQL5: Chart Operations / ChartSetString
  • www.mql5.com
Chart Operations / ChartSetString - Documentation on MQL5