- #define MAGICMA 20050610
- int CalculateCurrentOrders(string symbol)
- {
- int buys=0;
- int sells=0;
-
- for (int i=0; i<OrdersTotal(); i++)
- {
- if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES) ==false)
- break;
- if ( OrderSymbol() ==Symbol() && OrderMagicNumber() ==MAGICMA)
- {
- if ( OrderType()==OP_BUY)
- buys++;
- if ( OrderType()==OP_SELL)
- sells++;
- }
- }
- //---- 返回单子数量
- if(buys>0)
- return(buys);
- else
- return(-sells);
- }
复制代码
|