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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    64 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    139 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    75 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X