订单按时间关闭

时间:2020-04-08 13:01:02

标签: mql4

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 ;
             }
         }    
     }

我有一些代码可以关闭购买订单,这取决于自开仓以来经过的时间,还取决于当前的市场价格(出价必须高于订单开盘价)。但是,当我将其附加到终端的图表中时,它在真实市场中打开了订单,但是在经过一段时间后关闭了它,而没有考虑当前的市场价格。

但是在测试中却没有发生

这就是测试中发生的事情:
 this is what happen in testing

0 个答案:

没有答案