Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simulating Various Trading Scenarios including Order Rejections - Unmanaged Approach

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Simulating Various Trading Scenarios including Order Rejections - Unmanaged Approach

    Hello NinjaTrader Community,

    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:
    1. 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.
    2. 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.
    Aviram Y
    NinjaTrader Ecosystem Vendor - Aviram Y

    #2
    Hello Aviram Y,

    With simulating a insufficient margin error, you could use a really large quantity that would cost more than the simulation account has in cash value.

    With simulating a trading halt, I'm not sure there would be a way to simulate this. It may be possible to pump data using the API to the external data feed and then just stop pumping data. (The Trading Hours templates would not cause an order to be rejected if there is streaming data).
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    135 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X