So you can create 3 buttons stacked on top of each other.
// Functions: //- ButtonCreate() //- ButtonMove() //- ButtonChangeSize() //- ButtonChangeCorner() //- ButtonTextChange() //- ButtonDelete() //+------------------------------------------------------------------+ //| Create the button | //+------------------------------------------------------------------+ bool ButtonCreate(const long chart_ID=0, // chart's ID const string name="Button", // button name const int sub_window=0, // subwindow index const int x=0, // X coordinate const int y=0, // Y coordinate const int width=50, // button width const int height=18, // button height const ENUM_BASE_CORNER corner=CORNER_LEFT_UPPER, // chart corner for anchoring const string text="Button", // text const string font="Arial", // font const int font_size=10, // font size const color clr=clrBlack, // text color const color back_clr=C'236,233,216', // background color const color border_clr=clrNONE, // border color const bool state=false, // pressed/released const bool back=false, // in the background const bool selection=false, // highlight to move const bool hidden=true, // hidden in the object list const long z_order=0) // priority for mouse click { //--- reset the error value ResetLastError(); //--- create the button if(!ObjectCreate(chart_ID,name,OBJ_BUTTON,sub_window,0,0)) { Print(__FUNCTION__, ": failed to create the button! Error code = ",GetLastError()); return(false); } //--- set button coordinates ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,x); ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,y); //--- set button size ObjectSetInteger(chart_ID,name,OBJPROP_XSIZE,width); ObjectSetInteger(chart_ID,name,OBJPROP_YSIZE,height); //--- set the chart's corner, relative to which point coordinates are defined ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,corner); //--- set the text ObjectSetString(chart_ID,name,OBJPROP_TEXT,text); //--- set text font ObjectSetString(chart_ID,name,OBJPROP_FONT,font); //--- set font size ObjectSetInteger(chart_ID,name,OBJPROP_FONTSIZE,font_size); //--- set text color ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr); //--- set background color ObjectSetInteger(chart_ID,name,OBJPROP_BGCOLOR,back_clr); //--- set border color ObjectSetInteger(chart_ID,name,OBJPROP_BORDER_COLOR,border_clr); //--- display in the foreground (false) or background (true) ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back); //--- set button state ObjectSetInteger(chart_ID,name,OBJPROP_STATE,state); //--- enable (true) or disable (false) the mode of moving the button by mouse ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection); ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection); //--- hide (true) or display (false) graphical object name in the object list ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden); //--- set the priority for receiving the event of a mouse click in the chart ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order); //--- successful execution return(true); } //+------------------------------------------------------------------+ //| Move the button | //+------------------------------------------------------------------+ bool ButtonMove(const long chart_ID=0, // chart's ID const string name="Button", // button name const int x=0, // X coordinate const int y=0) // Y coordinate { //--- reset the error value ResetLastError(); //--- move the button if(!ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,x)) { Print(__FUNCTION__, ": failed to move X coordinate of the button! Error code = ",GetLastError()); return(false); } if(!ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,y)) { Print(__FUNCTION__, ": failed to move Y coordinate of the button! Error code = ",GetLastError()); return(false); } //--- successful execution return(true); } //+------------------------------------------------------------------+ //| Change button size | //+------------------------------------------------------------------+ bool ButtonChangeSize(const long chart_ID=0, // chart's ID const string name="Button", // button name const int width=50, // button width const int height=18) // button height { //--- reset the error value ResetLastError(); //--- change the button size if(!ObjectSetInteger(chart_ID,name,OBJPROP_XSIZE,width)) { Print(__FUNCTION__, ": failed to change the button width! Error code = ",GetLastError()); return(false); } if(!ObjectSetInteger(chart_ID,name,OBJPROP_YSIZE,height)) { Print(__FUNCTION__, ": failed to change the button height! Error code = ",GetLastError()); return(false); } //--- successful execution return(true); } //+------------------------------------------------------------------+ //| Change corner of the chart for binding the button | //+------------------------------------------------------------------+ bool ButtonChangeCorner(const long chart_ID=0, // chart's ID const string name="Button", // button name const ENUM_BASE_CORNER corner=CORNER_LEFT_UPPER) // chart corner for anchoring { //--- reset the error value ResetLastError(); //--- change anchor corner if(!ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,corner)) { Print(__FUNCTION__, ": failed to change the anchor corner! Error code = ",GetLastError()); return(false); } //--- successful execution return(true); } //+------------------------------------------------------------------+ //| Change button text | //+------------------------------------------------------------------+ bool ButtonTextChange(const long chart_ID=0, // chart's ID const string name="Button", // button name const string text="Text") // text { //--- reset the error value ResetLastError(); //--- change object text if(!ObjectSetString(chart_ID,name,OBJPROP_TEXT,text)) { Print(__FUNCTION__, ": failed to change the text! Error code = ",GetLastError()); return(false); } //--- successful execution return(true); } //+------------------------------------------------------------------+ //| Delete the button | //+------------------------------------------------------------------+ bool ButtonDelete(const long chart_ID=0, // chart's ID const string name="Button") // button name { //--- reset the error value ResetLastError(); //--- delete the button if(!ObjectDelete(chart_ID,name)) { Print(__FUNCTION__, ": failed to delete the button! Error code = ",GetLastError()); return(false); } //--- successful execution return(true); } //+------------------------------------------------------------------+
https://www.mql5.com/en/code/13688

CComment Class
- www.mql5.com
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...
nicholi shen:
https://www.mql5.com/en/code/13688
https://www.mql5.com/en/code/13688
Marco vd Heijden:
So you can create 3 buttons stacked on top of each other.
Thankyou For Help :)

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
I try to use Obj_label or OBJ_Text but they can show only Once Line and long text.
Thank you.