最近成交的订单的手数获取方法
最近成交的订单的手数获取方法double LastBuyLots;
double LastSellLots;
for(int cnt=OrdersTotal()-1;cnt>=0;cnt--){
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()!=Symbol()||OrderMagicNumber()!=MagicNumber)continue;
if(OrderSymbol()==Symbol()&&OrderMagicNumber()==MagicNumber)
if(OrderType()==OP_BUY)
{
LastBuyLots=OrderLots();
break;
}
if(OrderSymbol()==Symbol()&&OrderMagicNumber()==MagicNumber)
if(OrderType()==OP_SELL)
{
LastSellLots=OrderLots();
break;
}
}
页:
[1]