- //+------------------------------------------------------------------+
- //|平仓删挂单 |
- //+------------------------------------------------------------------+
- void closeall()
- {
- for(int i = OrdersTotal(); i >= 0; i--)
- {
- if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == true)
- {
- if(OrderType() <= 1 )
- {
- bool ret1 = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), Green);
- }
- if(OrderType() >= 2)
- {
- bool ret2 = OrderDelete(OrderTicket());
- }
- }
- }
- }
复制代码
|