double yingb1() //如何找到历史订单最新平仓的单 有时侯多有时候空?怎么定位住
{
double temp;
double temp1;
if(OrdersHistoryTotal()>0)
{
for(int i=OrdersHistoryTotal()-1;i>0;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY))
{
if(OrderSymbol()==Symbol())
{
if(OrderType()==OP_BUY && OrderMagicNumber()==magic)
{
{
temp=OrderOpenPrice()*OrderLots();
temp1=OrderLots();
}
}
}
}
}
}
if(temp1==0.0)
return(9999);
else
return(NormalizeDouble(((Close[0]-(temp/temp1))/Point),0));
}
double yings1() //如何找到历史订单最新平仓的单 有时侯多有时候空?怎么定位住
{
double temp;
double temp1;
if(OrdersHistoryTotal()>0)
{
for(int i=OrdersHistoryTotal()-1;i>0;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY))
{
if(OrderSymbol()==Symbol())
{
if( OrderType()==OP_SELL && OrderMagicNumber()==magic)
{
{
temp=OrderOpenPrice()*OrderLots();
temp1=OrderLots();
}
}
}
}
}
}
if(temp1==0.0)
return(9999);
else
return(NormalizeDouble((((temp/temp1)-Close[0])/Point),0));
} |