I hope this message finds you well. I'm currently in the process of developing and refining a trading strategy using the Unmanaged approach in NinjaTrader. This gives me the granular control I need over my order handling.
As part of the development process, I have created my own order management class which allows me to keep track of order references and handle them according to my strategy's requirements.
To ensure that my code is robust and resilient, I'm seeking ways to simulate various trading scenarios, especially those involving order rejections. These could occur for both entry and exit orders. My goal is to understand how my strategy and order management class handle these situations, and whether they can recover gracefully from such events or if they lead to any undesirable behavior.
To illustrate, here are some scenarios I would like to simulate:
- Entry order rejection: This could occur for several reasons such as insufficient margin, trading halt on the instrument, or a technical glitch at the broker's end.
- Exit order rejection: This could happen due to insufficient quantity to sell (perhaps due to a partial fill on the entry), a trading halt, or again, a technical issue.
Simulating these scenarios will prove invaluable in ensuring my strategy is robust and capable of handling real-world trading events.
Can anyone guide me on how these scenarios can be simulated within NinjaTrader, specifically using the Unmanaged approach? Is there a specific tool, feature, or workaround that would allow me to programmatically introduce these conditions for testing purposes?
Additionally, if you can suggest any other trading scenarios that you believe are crucial for a strategy to handle, especially when using an Unmanaged approach, I would greatly appreciate it.
Thank you in advance for your guidance and support. I eagerly await your insights and suggestions.
Best Regards, Aviram Y.

Comment