多空持仓订单数量统计
函数统计当前持仓订单的多空单数量。OrdersPerSymbol = 0;
for(cnt = OrdersTotal(); cnt >= 0; cnt--)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber)
{
OrdersPerSymbol++;
if(OrderType() == OP_BUY)
{
OrdersBUY++;
}
if(OrderType() == OP_SELL)
{
OrdersSELL++;
}
}
}
页:
[1]