求教 请问如何判断多个货币对的订单数量

erli zhinian  
 //只要以下货币对的订单货币对数量大于5,就停止开单。但是自己下面写的这些好像不可以
string    总_st_1 = "GBPUSDm";
 string    总_st_2 = "EURUSDm";
 string    总_st_3 = "USDJPYm";
 string    总_st_4 = "USDCADm";
 string    总_st_5 = "AUDUSDm";

int OnInit()
  {

   return(INIT_SUCCEEDED);
  }

void OnDeinit(const int reason)
  {

   
  }

void OnTick()
  {
    if(buydanshu()>5)
     {
      //停止开单
     }
   
  }
int buydanshu()
  {
     int a=0;
     for(int i=0;i<OrdersTotal();i++)
      {
        if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)
          {
            if(OrderSymbol()==总_st_1 )
              {
                a++;
              }
            if(OrderSymbol()==总_st_2 )
              {
                a++;
              }
            if(OrderSymbol()==总_st_3 )
              {
                a++;
              }
            if(OrderSymbol()==总_st_4 )
              {
                a++;
              }
            if(OrderSymbol()==总_st_5 )
              {
                a++;
              }

          }
      }
    return(a);
  }
原因: