For a custom strategy, I am trying to code limit entry orders that are based on a moving average plus or minus an ATR-based range.
If the order is not filled in the first bar in which it is entered, though, I would like to cancel that old limit order and enter a *new limit order* that is based on the *new moving average value* plus or minus the *new ATR-based range* [all of these will have changed in the next bar]. If that new one does not fill, I would like to cancel and again re-enter a new limit order in the next bar [etc].
Would you have any particular recommended approaches for this?
If you have an approach in mind, I would really appreciate it. I googled but didn’t see this question answered in the forums.
Thank you,
Comment