I'm currently working on a NinjaScript strategy and I'm seeking advice on the best approach for setting up a bracket order to handle fast market conditions.
Here's my current approach:
- In the OnBarUpdate method, when a valid long condition is met, I enter a long position
- If the long entry is filled, I set the stop loss and limit orders for the bracket in the OnExecutionUpdate
Time Category Message 6/7/2024 8:30:01 AM Order Sim101, Stop price can't be changed above the market. affected Order: Sell 1 StopMarket @ 5366.25
The behavior I want to avoid is having a naked long position with no stop order, which is what happening in this edge case.
I would greatly appreciate any insights, suggestions, or alternative approaches to handle this scenario effectively. The goal is to ensure that the stop loss and target orders are always placed, even in fast market conditions, to prevent naked positions.
Thank you in advance for your help!

Comment