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.
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?
i use the Free download of the 'CComment Class' library by 'avoitenko' for MetaTrader 5 in the MQL5 Code Base, 2015.10.12 to display in a easy way some infos.
I have two problems with it.
1) The Panel is not in the very first front of the chart, some lines lay above - why it is so and is there a way to change it in a way to have the comment panel everytime in front?

2) As you can see in my sample code, some text should have different colors, but the fontcolor is always the same and i dont know what i do wrong?
//For Commentsettings #define COLOR_BACK clrBlack #define COLOR_BORDER clrDimGray #define COLOR_CAPTION clrDodgerBlue #define COLOR_TEXT clrRed #define COLOR_WIN clrLimeGreen #define COLOR_LOSS clrOrangeRed //OnInit() i do //panel Setting int y=30; if(ChartGetInteger(0,CHART_SHOW_ONE_CLICK)) y=120; //--- panel name srand(GetTickCount()); string name="panel_"+IntegerToString(rand()); comment.Create(name,20,y); //--- panel style comment.SetAutoColors(InpAutoColors); comment.SetColor(clrBlue,clrYellow,255); comment.SetFont("Lucida Console",13,false,1.7); //--- //comment.SetText(0,StringFormat("Expert: %s v.%s","MYNAME","My_version"),COLOR_CAPTION); comment.SetText(0,"ANALYZER - Report (max poss. profit/loss)",COLOR_CAPTION); comment.SetText(1,"wait for datas....",clrWhite); comment.SetText(21,"coming soon...",clrWhite); comment.SetText(22,"Profitfaktor: XY - Tendenz +/-",clrWhite); comment.SetText(23,"Qualität Entryignal: XY VS wie nah am Tief/Hoch/Wendepunkt",clrWhite); comment.SetText(24,"Qualität Exitsignal: XY VS max-possible",clrWhite); comment.SetText(25,"Sonstiges: Formationen, Candles, Unterstützungslinien, Pivotpunkte...",clrWhite); comment.Show(); //ontick i do for example this to change/update line 17 string test1="my content"; comment_class_update(17,test1+" Text...",COLOR_TEXT); //The text will updated but not in the given color - in this case it should be red ...
m_name=NULL; m_font_name="Lucida Console"; m_font_size=14; m_font_bold=false; m_font_interval=1.7; m_border_color=clrNONE; m_back_color=clrBlack; m_back_alpha=255; // look at this m_graph_mode=true; m_auto_colors=false; m_chart_back_color=(color)ChartGetInteger(0,CHART_COLOR_BACKGROUND); // look at this m_auto_back_color=clrBlack; m_auto_border_color=clrNONE; //--- ChartSetInteger(0,CHART_EVENT_MOUSE_MOVE,true);
Hi,
this is my part, seem ok?
void CComment(void) { m_name=NULL; m_font_name="Lucida Console"; m_font_size=14; m_font_bold=false; m_font_interval=1.7; m_border_color=clrAzure; m_back_color=clrBlack; m_back_alpha=255; m_graph_mode=true; m_auto_colors=false; m_chart_back_color=(color)ChartGetInteger(0,CHART_COLOR_BACKGROUND); m_auto_back_color=clrLightYellow; m_auto_border_color=clrYellow; //--- ChartSetInteger(0,CHART_EVENT_MOUSE_MOVE,true); };
The author dosn not support this class any longer, that the reason why i use the forum. May there is a kind a some class i can use, but i cannot find any one...?
Analyse the class functions like
void CComment(void) { m_name=NULL; m_font_name="Lucida Console"; m_font_size=14; m_font_bold=false; m_font_interval=1.7; m_border_color=clrNONE; m_back_color=clrBlack; m_back_alpha=255; // look at this m_graph_mode=true; m_auto_colors=false; m_chart_back_color=(color)ChartGetInteger(0,CHART_COLOR_BACKGROUND); // look at this m_auto_back_color=clrBlack; m_auto_border_color=clrNONE; //--- ChartSetInteger(0,CHART_EVENT_MOUSE_MOVE,true); };
If you post that issue in "Comment Class" codebase page then it would get author attention and you may get more better answers.
Hi,
this is my part, seem ok?
The author dosn not support this class any longer, that the reason why i use the forum. May there is a kind a some class i can use, but i cannot find any one...?
please read this article, its much better than CComment class.

- www.mql5.com

- 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