Hi everyone .
How can I draw a rectangle that shows me the pips value in the corner?
In fact, the mql5 code as an indicator that displays the pips value of each rectangle I drew.
I have attached a photo as an example ...
Traders and coders are working for free:
- if it is interesting for them personally, or
- if it is interesting for many members of this forum.
Freelance section of the forum should be used in most of the cases.
- 2024.11.09
- www.mql5.com
Hi everyone .
How can I draw a rectangle that shows me the pips value in the corner?
In fact, the mql5 code as an indicator that displays the pips value of each rectangle I drew.
I have attached a photo as an example ...
Just create an OBJ_TEXT for this, setting the OBJPROP_ANCHOR you want
tnx bro . But i want automatically calculate (hig-low) of rectangle and show me on the corner of rectangle ....
I understand that you want to draw that automatically. Where you draw rectangles in your code, draw OBJ_TEXT as well. Your code that draws rectangles already contains all the data needed to draw OBJ_TEXT as well (price and time of rectangle points).
But if you just want someone to program it for you for free, then you don't have much of a chance that someone will want to spend their time.
Hi . used this code but its not found last rectangle ...
its just show first or secend rectangle i draw ...
{
int TotalObj = ObjectsTotal(0, 0, OBJ_RECTANGLE);
for(int i=TotalObj-1 ; i>=0 ; i--)
{
string obj_name = ObjectName(0,i,0,OBJ_RECTANGLE);
double price1 = ObjectGetDouble(0,obj_name,OBJPROP_PRICE,0);
double price2 = ObjectGetDouble(0,obj_name,OBJPROP_PRICE,1);
double time1 = ObjectGetInteger(0,obj_name,OBJPROP_TIME,0);
double time2 = ObjectGetInteger(0,obj_name,OBJPROP_TIME,1);
double Pips = (price2-price1);
uint value = MathAbs(Pips);
ObjectCreate(0,"Label1",OBJ_LABEL,0,0,0);
ObjectSetString(0,"Label1",OBJPROP_FONT,"Arial");
ObjectSetString(0,"Label1",OBJPROP_TEXT,0,"Pips : "+value);
ObjectSetInteger(0,"Label1",OBJPROP_XDISTANCE,700);
ObjectSetInteger(0,"Label1",OBJPROP_YDISTANCE,8);
ObjectSetInteger(0,"Label1",OBJPROP_COLOR,clrBlack);
ObjectSetInteger(0,"Label1",OBJPROP_FONTSIZE,12);
break;
}
return(rates_total);
}
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi everyone .
How can I draw a rectangle that shows me the pips value in the corner?
In fact, the mql5 code as an indicator that displays the pips value of each rectangle I drew.
I have attached a photo as an example ...