空单全部平仓
函数执行空单全部平仓。过滤条件:货币对、订单类型。void closeshrts()
{
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_SELL)
OrderClose(OrderTicket(),OrderLots(),Ask,0,Red);
}//for
}
相当不错,感谢无私分享精神!
页:
[1]