Please help to auto close order

 

Hi, please help me. This is what i want: I open order on bar. After 3 new bars, this order will auto close

 
tvh168:

Hi, please help me. This is what i want: I open order on bar. After 3 new bars, this order will auto close

Select the order, check it's OrderOpenTime(), use iBarShift() with that time and if it returns 3 or greater 3 bars has elapsed.
Reason: