if( OrderMagicNumber()==2 )
{
if( TimeCurrent() - OrderOpenTime() > 1800 && Bid - OrderOpenPrice() > 5*_Point )
{
OrderClose(OrderTicket(),OrderLots(),Bid,3,Yellow);
}
if( Bid - OrderOpenPrice() > 50*_Point ){
RevSF = true ;
}
if( RevSF == true )
{
if( Bid -OrderOpenPrice() < 10*_Point && Bid -OrderOpenPrice() > 8*_Point )
{
OrderClose(OrderTicket(),OrderLots(),Bid,3,Yellow);
RevSF = false ;
}
}
}
我有一些代码可以关闭购买订单,这取决于自开仓以来经过的时间,还取决于当前的市场价格(出价必须高于订单开盘价)。但是,当我将其附加到终端的图表中时,它在真实市场中打开了订单,但是在经过一段时间后关闭了它,而没有考虑当前的市场价格。
但是在测试中却没有发生