- int CountTrades()
- {
- int count = 0;
- for(int trade = OrdersTotal() - 1; trade >= 0; trade--)
- {
- if(OrderSelect(trade, SELECT_BY_POS, MODE_TRADES) == true)
- {
- if(OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber)
- {
- continue;
- }
- if(OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber)
- {
- if(OrderType() == OP_SELL || OrderType() == OP_BUY)
- {
- count++;
- }
- }
- }
- }
- return (count);
- }
-
复制代码
|