I'm new to trading priciples and still a bit confused about all the order handling options. Basically, I would like to cancel a stop order when the price moves too far away in the opposite direction and I would like for this to happen by incoming tick and not just on the close of a bar. I wonder what's the best way to do it and if there is already a method that does what I require. Here's how I would do it:
Say, on the close of a 15min bar my conditions apply and I place a liveUntilCancelled EnterLongStopLimit order with stop and limit higher than the current High. If the Order is filled, SetProfitTarget and SetStopLoss take care of the Exit and, if I understand correctly, all these methods are handling my orders independently from the 15min clocking of OnBarUpdate(). Now, if the price breaks the current Low I would like to cancel everything, independently from the 15min timing as well.
Do I simply set "CalculateOnBarClose = false" until either the price reaches the Low and I CancelOrder() or the entry order is filled, and then I set "CalculateOnBarClose = true" again to continue as normal? Or is there a more CPU-friendly solution for this, e.g. through one of the order handling methods?
Comment