Nickbahson / Publications
Forum
Set order to expire after 20 mins if the price is not hit
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