Download MetaTrader 5
To add comments, please log in or register
Do you have Linux? Find out how to install MetaTrader on it!
Yassine
5
Yassine 2015.10.19 21:01 

Hi everyone 


could someone  help me to get a function for counting open orders 

thank you very much :)

DeanDeV
330
DeanDeV 2015.10.19 21:04  
Jeannyflare:

Hi everyone 


could someone  help me to get a function for counting open orders 

thank you very much :)

You're not learning anything by asking for something. You should learn to code and attempt it yourself, then post your attempt here. Then we would assist you and guide where possible. Anyways, here:

 

int OpenOrdersThisPair(string pair)
  {
   int total=0;
   
   for(int a=OrdersTotal()-1; a>=0; a--)
    {
     if(OrderSelect(a,SELECT_BY_POS,MODE_TRADES))
      if(OrderType()<=1)
       if(OrderSymbol()==pair) total++;
    }
     return(total);
  }
/
To add comments, please log in or register