Download MetaTrader 5

how to get max open buy and sell price

To add comments, please log in or register
Start making profit using the Market. Publish your product!
zahidmahmood
66
zahidmahmood 2015.10.30 14:04 

hello 

i have 5 trades currently open for example

Buy @ 1.1010

Buy @ 1.1040

Buy @ 1.1030

Sell@ 1.1070

Sell@ 1.1050

i want to get max BuyPrice currently open trades like currently open max Buy price is 1.1040  and opposite get min sell price like currently open sell min price is 1.1050

how can i get this

Fredy Fardiansyah
229
Fredy Fardiansyah 2015.10.30 17:05  
zahidmahmood:

hello 

i have 5 trades currently open for example

Buy @ 1.1010

Buy @ 1.1040

Buy @ 1.1030

Sell@ 1.1070

Sell@ 1.1050

i want to get max BuyPrice currently open trades like currently open max Buy price is 1.1040  and opposite get min sell price like currently open sell min price is 1.1050

how can i get this


you have to have and use an appropriate indicator so that the analysis could be ,,, 
i have an indicator that if we use these indicators we can predict when to sell and buy the right ,, 
and I sell at a price that is not expensive ,,, just $125 ...
Ahmed Soliman
15714
Ahmed Soliman 2015.10.30 22:47  
zahidmahmood:

hello 

i have 5 trades currently open for example

Buy @ 1.1010

Buy @ 1.1040

Buy @ 1.1030

Sell@ 1.1070

Sell@ 1.1050

i want to get max BuyPrice currently open trades like currently open max Buy price is 1.1040  and opposite get min sell price like currently open sell min price is 1.1050

how can i get this

void GetHighestLowest(int magic)
{
   double highest = -10000;
   double lowest = 10000;
   
   for(int cnt=0; cnt<OrdersTotal(); cnt++)
   {
      if(!OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES)) continue;
      if(OrderMagicNumber()!=magic) continue;
      if(OrderOpenPrice()>highest) highest = OrderOpenPrice();
      if(OrderOpenPrice()<lowest) lowest = OrderOpenPrice();
    }
    Print("Highest price is: ", highest);
    Print("Lowest price is: ", lowest);
}
To add comments, please log in or register