获取持仓订单的开仓价
该函数获取持仓订单的开仓价。过滤条件:货币对、订单注释、订单类型。.int T=0;
int B=0;
for(int i=0;i<OrdersTotal();i++)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()==Symbol() && OrderComment()==Name_Expert)
{
int type=OrderType();
switch(type)
{
case OP_BUY:
sB=1;
T++;
LastB=OrderOpenPrice();
break;
case OP_SELL:
sS=2;
B++;
LastS=OrderOpenPrice();
break;
}
}
}
页:
[1]