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
Guys, anyone found a way or a custom control to have multiline label on a chart?
Hi,
Here's the technical answer and then I'll try my best to explain it.
You would need to learn how to code using MQL4 notation format and using the libraries that are located in the Include Folder of your MT4 Data Folder. You would also need to know how to create Loops and code using Arrays so that you don't have to write multiple lines of code that do the same thing. Or you could use the original MQL4 language with Arrays and Loops with ObjectCreate() functions, etc, and accomplish the same thing.
In my opinion, as you advance you will eventually need to learn MQL4 notation.
So,
The programmers created a class of "code" intended for the simple creation of buttons, dashboards, and other objects.
Using Arrays to store data so that you can use it later saves lines of code. Running loops to create objects also saves lines of code. MQL4 notation definitedly saves lines of code and also makes coding in MT4 more native since the notation is more like plain English as you develop it.
You can create a button with no color border and that's your plain text line on the screen.
This example could be modified to do that and create several lines under each other with slightly different text:
(Of course there is much more to make this work that is not shown here)
The reference is found here: https://www.mql5.com/en/docs/standardlibrary/controls/cbutton
That basic dashboard on the reference link will spark a fire!
Hope that helps. Many folks here just drop a link and call that an answer or tell you to go read. Hope fully I have pointed you in the right direction.
It does take work, dedication, and countless hours of studying and coding. AND believe me it's all well worth it!! Keep at it.
Hi,
Here's the technical answer and then I'll try my best to explain it.
You would need to learn how to code using MQL4 notation format and using the libraries that are located in the Include Folder of your MT4 Data Folder. You would also need to know how to create Loops and code using Arrays so that you don't have to write multiple lines of code that do the same thing. Or you could use the original MQL4 language with Arrays and Loops with ObjectCreate() functions, etc, and accomplish the same thing.
In my opinion, as you advance you will eventually need to learn MQL4 notation.
So,
The programmers created a class of "code" intended for the simple creation of buttons, dashboards, and other objects.
Using Arrays to store data so that you can use it later saves lines of code. Running loops to create objects also saves lines of code. MQL4 notation definitedly saves lines of code and also makes coding in MT4 more native since the notation is more like plain English as you develop it.
You can create a button with no color border and that's your plain text line on the screen.
This example could be modified to do that and create several lines under each other with slightly different text:
(Of course there is much more to make this work that is not shown here)
The reference is found here: https://www.mql5.com/en/docs/standardlibrary/controls/cbutton
That basic dashboard on the reference link will spark a fire!
Hope that helps. Many folks here just drop a link and call that an answer or tell you to go read. Hope fully I have pointed you in the right direction.
It does take work, dedication, and countless hours of studying and coding. AND believe me it's all well worth it!! Keep at it.
Guys, anyone found a way or a custom control to have multiline label on a chart?
Hi, I have created a simple library for custom controls, it is not complete and you might need to edit the code as needed( for example handling errors and events ).
I have used the library in a sample indicator that draws multiline text areas custom controls( see attached zip file for the sample project and files )
---
The function createTextArea in the TextArea.mqh file is used to draw text areas
How does it work:
1. Draw a rectangle as a the text area background
2. Draw a label for each line of the text area ( each label can have a maximum of 63 characters )
3. Take a screen shot of the chart and save to file as a bitmap
4. Draw a bitmap label with dimensions and offset of the rectangle background
5. Set the bitmap label source file as the chart screen shot
6. Delete all other objects except the bitmap label
---
---
Installation :
1. Unzip the archive ( see attached )
2. Move icon_pack_mql_gray_small and icon_pack_mql_small into data folder/Images
3. Move StickyNotes folder into data folder/Indicators
---
Development
I will create an article/s for further development of the library in the future
---
Enjoy for now
You can't. Create multiple labels. See: I want to move the EA comment from left to right corner ? - MQL4 programming forum - Page 2 #13 (2022)