Thanks for the awesome tool! I modded it a bit to suit my needs so I'm going to post it here...
I added a Zone method that return a bool if the x,y on chart click was on the comment window so nothing behind it can get activated. I also overrode the OnChartEvent method to move the comment when resizing the window.
I changed the properties of the object to LEFT_LOWER but when it is time to move it, it moves inverted.
Thanks!!!
Is there a way to use tab or /t or anything similar, such that words or numbers can be placed below each other in a straight column?
You can use spaces within the string like this:
comment_panel.SetText(3,"xxxxxxxxxxxxxxxxxx: "+ string(a),COLOR_WIN); comment_panel.SetText(4,"yyyyyyyyyyyyyyy: "+ string(b),COLOR_WIN); comment_panel.SetText(5,"zzzzzzzzzzzzzzzzzzzzzzzzzz: "+ string(c),COLOR_WIN);Happy coding!
First, Thank you for making this.
I found a bug that when we move the panel and later call the show method to update some comment, the panel returns to its original location on the chart. Is there a modification that can be done on the comment.mql for it to retain the moved location?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
CComment Class:
The ССomment class was designed to extend the capabilities of the standard Comment function. Its purpose is to display a multi-line comment on a panel. Methods of this class allow you to specify text color, font, style and line spacing. You can move the panel within the screen space with the mouse.
For the purpose of backwards compatibility, we preserved the standard way of outputting the comment in the upper left corner of the chart. The class has the ability to automatically adjust the colors in case the color scheme is changed regularly. In this mode, the background color is analyzed and contrasting text color is set automatically.
The panel is useful for displaying main settings of an Expert Advisor. An example of such EA is included. Its code is compatible with MQL4.
Author: Andrey Voytenko