Rectangle Pips value mql5

 

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 ...

Files:
 
Nima khalaji:

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.

Trading applications for MetaTrader 5 to order
Trading applications for MetaTrader 5 to order
  • 2024.11.09
  • www.mql5.com
The largest freelance service with MQL5 application developers
 
Nima khalaji:

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

 
Vladislav Boyko #: Just create an OBJ_TEXT for this, setting the OBJPROP_ANCHOR you want

A text object will move as new candles are created. OP asked for an object in the corner. He needs a Label.

 
William Roeder #:

A text object will move as new candles are created. OP asked for an object in the corner. He needs a Label.

See the screenshot that the OP attached

 
Vladislav Boyko #:

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 ....

 
Guys, he wants automatic. 
 
Nima khalaji #:

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.

 
When you post code please use the CODE button (Alt-S) !
 

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);
  }