//---------------------------RECTANGLE---------------ChartSetInteger(ChartID(),CHART_FOREGROUND,0,false);
ObjectCreate(ChartID(),"obj_rect",OBJ_RECTANGLE_LABEL,0,0,0);
ObjectSetInteger(ChartID(),"obj_rect",OBJPROP_XDISTANCE,0);
ObjectSetInteger(ChartID(),"obj_rect",OBJPROP_YDISTANCE,15);
ObjectSetInteger(ChartID(),"obj_rect",OBJPROP_BACK,false);
ObjectSetInteger(ChartID(),"obj_rect",OBJPROP_XSIZE,300);
ObjectSetInteger(ChartID(),"obj_rect",OBJPROP_YSIZE,600);
//---------------------------END OF RECTANGLE---------//------------------------------------------Show Actions in Rectangle---------------------------------------string time1sttext = "Start Time is " + TimeToString(StartTime);// Name of Object for color commentstring time2ndtext = "End Time is " + TimeToString(EndTime); // Name of Object for color commentstring time3rdtext = "Total bars is " + StringConcatenate(countedtotalbar); // Name of Object for color commentstring time4thtext = "Total Range bars is ",calculatetotalrangebar; // Name of Object for color commentstring str1stText = "Start Time is " + TimeToString(StartTime); //String Const or Variable used on ObjectCreatestring str2ndText = "End Time is " + TimeToString(EndTime); //String Const or Variable used on ObjectCreatestring str3rdText = "Total bars is " + StringConcatenate(countedtotalbar); // Name of Object for color commentstring str4thText = "Total Range bars is " + StringConcatenate(calculatetotalrangebar); // Name of Object for color comment// Create text object with given nameObjectCreate(time1sttext, OBJ_LABEL, 0, 0, 0, 0); // Type of Object Label = COMMENT OBJ_LABELObjectCreate(time2ndtext, OBJ_LABEL, 0, 0, 0, 0); // Type of Object Label = COMMENT OBJ_LABELObjectCreate(time3rdtext, OBJ_LABEL, 0, 0, 0, 0); // Type of Object Label = COMMENT OBJ_LABELObjectCreate(time4thtext, OBJ_LABEL, 0, 0, 0, 0); // Type of Object Label = COMMENT OBJ_LABEL// Set pixel co-ordinates from top left corner (use OBJPROP_CORNER to set a different corner)
ObjectSet(time1sttext, OBJPROP_XDISTANCE, 10);
ObjectSet(time1sttext, OBJPROP_YDISTANCE, 20);
ObjectSet(time2ndtext, OBJPROP_XDISTANCE, 10);
ObjectSet(time2ndtext, OBJPROP_YDISTANCE, 40);
ObjectSet(time3rdtext, OBJPROP_XDISTANCE, 10);
ObjectSet(time3rdtext, OBJPROP_YDISTANCE, 60);
ObjectSet(time4thtext, OBJPROP_XDISTANCE, 10);
ObjectSet(time4thtext, OBJPROP_YDISTANCE, 80);
// Set text, font, and colour for object
ObjectSetText(time1sttext, str1stText, 10, "Arial", clrBlack);
ObjectSetText(time2ndtext, str2ndText, 10, "Arial", clrRed);
ObjectSetText(time3rdtext, str3rdText, 10, "Arial", clrChocolate);
ObjectSetText(time4thtext, str4thText, 10, "Arial", clrDarkBlue);
//---------------------------------End of Action in Rectangle------------------------------ //---------------------------------Delete Object-----------------------------boolObjectDelete(ChartID(),"obj_rect");//---------------------------------End of Delete-------------------------------
When a graphical object is created using the ObjectCreate() function, it's necessary to specify the type of object being created, which can be one of the values of the ENUM_OBJECT enumeration. Further specifications of object properties are possible using functions for working with graphical objects.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi,
I create Object Rectangle.... but I make Object Delete - errors ... i put highlight marker
Is it relate Object Name?
'(' - comma expected squarecomment.mq4 180 26
',' - semicolon expected squarecomment.mq4 180 28
',' - unexpected token squarecomment.mq4 180 28
'obj_rect' - undeclared identifier squarecomment.mq4 180 29
')' - unexpected token squarecomment.mq4 180 37
7 errors, 0 warnings 8 1