Set order to expire after 20 mins if the price is not hit

To add comments, please log in or register
Nickbahson
8
Nickbahson  

The following code works but the order is not canceled after the expiration.

datetime expiration=TimeTradeServer()+PeriodSeconds(PERIOD_M20);

trade.BuyStop(0.10,Ask+100*_Point,_Symbol,buySl,Ask+300*_Point,ORDER_TIME_GTC,expiration,0);

I have defined by buySl as a variable and it gets set, how ever my time variable is like it's being ignored

To add comments, please log in or register