I have a strategy that, when entering a position, should also place stop and limit orders. The stop and limit orders are being placed, but not until the current bar finishes and the next one starts.
I have `Calculate = Calculate.OnPriceChange;` in my `OnStateChange()` method, so I expect that the stop and limit orders should be placed as soon as the price changes (in the current bar).
(I also see "OnPriceChange" selected in the Strategy popup window if I view that.)
I'm using "separate logic" to place the initial order (and set a flag), and then on subsequent `OnBarUpdate()` calls, I check to see if the flag is set, and if so, use `ExitLongStopMarket()`, `ExitShortStopMarket()`, `ExitLongLimit()` and `ExitShortLimit()` methods to set the closing orders.
So, I'm confused as to why the stop/limit orders aren't being set on the very next bar update after the order is placed.
Any hints to point me in the right direction?
Thanks!
Comment