I need to createa rectanglethatsticking toone sideofthewindowoperations, soI thought of"OBJ_RECTANGLE_LABEL" butthisdoes not leavemethe option toputpricesthat definethe height of therectangle, sincethedocumentationsays
Note
Anchor point coordinates are set in pixels. It is possible to recctangle label's anchoring corner from ENUM_BASE_CORNER enumeration. Rectangle label's border type can be selected from ENUM_BORDER_TYPE enumeration.
The object is used to create and design the custom graphical interface.
so forgiveheight or width,should bebased onpixels,withXDISTANCEandXDISTANCE
but I needsomething that allowsme to create aboxattached tothe right side, butto let methe option toselect theprice forits height(width,shouldalso beinpixels)
THEN, I triedtesting theChartXYToTimePrice andChartTimePriceToXYfunctions (https://docs.mql4.com/chart_operations/chartxytotimeprice https://docs.mql4.com/en/chart_operations/charttimepricetoxy),to testand implement it, butit does not workme
I testedthisinEURGBP
void CreateRectangle(constlong chart_ID=0,
conststring name="RectLabel" )
{
ObjectCreate(chart_ID,name,OBJ_LABEL,0,0,0);
int a=70;
int b=70;
int c=0;
int d=100;
int e=0;
int f=0;
datetime timea=iTime(NULL,0,6);
datetime timeb=iTime(NULL,0,12);
datetime timec=0;
double pricea=0.8260;
double priceb=0.8230;
double pricec=0;
if (ChartXYToTimePrice(chart_ID,a,b,c,timec,pricec))
{
pricec=0.8230;
ObjectSetDouble(chart_ID,name,OBJPROP_PRICE1,1,pricec);
Print( pricec);
}
}
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.
I ask for your help with the following
I need to create a rectangle that sticking to one side of the window operations, so I thought of "OBJ_RECTANGLE_LABEL" but this does not leave me the option to put prices that define the height of the rectangle, since the documentation says
Note
Anchor point coordinates are set in pixels. It is possible to recctangle label's anchoring corner from ENUM_BASE_CORNER enumeration. Rectangle label's border type can be selected from ENUM_BORDER_TYPE enumeration.
The object is used to create and design the custom graphical interface.
but I need something that allows me to create a box attached to the right side, but to let me the option to select the price for its height (width, should also be in pixels)
THEN,
I tried testing the ChartXYToTimePrice and ChartTimePriceToXY functions (https://docs.mql4.com/chart_operations/chartxytotimeprice https://docs.mql4.com/en/chart_operations/charttimepricetoxy), to test and implement it, but it does not work me
I tested this in EURGBP
but does not work, can somebody help me
Thanks