函数执行平仓多单。过滤条件:货币对、订单类型。
- void closelongs()
- {
- int trade;
- int trades=OrdersTotal();
- for(trade=0;trade<trades;trade++)
- {
- OrderSelect(trade,SELECT_BY_POS,MODE_TRADES);
- if(OrderSymbol()!=Symbol())
- continue;
- if(OrderType()==OP_BUY)
- OrderClose(OrderTicket(),OrderLots(),Bid,0,Blue);
- }//for
- }
|