Rectagle price

To add comments, please log in or register
maniun
10
maniun  
How to check the highest and lowest price of a rectangle drawn by a mouse in mql4 ? I drew a rectangle as in the picture, but I want to see the price in mql4, can I make it?








Renctagle price
William Roeder
18310
William Roeder  
Right click on it and select properties.
Mikhail Zhitnev
22602
Mikhail Zhitnev  

1) You have to check all objects:  select each object and get it type, if type = rectangle then get it NAME and then get it coordinates

   for(int i=ObjectsTotal()-1; i>=0; i--)
     {
      string name=ObjectName(i);
      if (ObjectType(name)==OBJ_RECTANGLE)
      {
         Price1 = ObjectGet(NAME, OBJPROP_PRICE1);   
         Price2 = ObjectGet(NAME, OBJPROP_PRICE2);   
         Time1 =   ObjectGet(NAME, OBJPROP_TIME1);     
         Time1 =   ObjectGet(NAME, OBJPROP_TIME2); 
         break;
      }
     }
maniun
10
maniun  
Mikhail Zhitnev:

1) You have to check all objects:  select each object and get it type, if type = rectangle then get it NAME and then get it coordinates

Thank you ! It's works  :) 
To add comments, please log in or register