Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90


How do I trap Order Ignore error messages

  • Filter
  • Time
  • Show
Clear All
new posts

    How do I trap Order Ignore error messages

    How do I trap these kinds of errors:

    "Strategy 'MOSTStrategy/217158595': An order has been ignored since the stop price ‘13065.5’ near the bar stamped ‘23/03/2021 18:06:19’ is invalid based on the price range of the bar. This is an invalid order and subsequent orders may also be ignored."

    This does not trigger the OnOrderUpdate Event handler so I can not catch this error here. What event handler should I be checking?

    You can enable tradeorder.
    protected override void OnStateChange()
        if (State == State.SetDefaults)
            TraceOrders = true;


      ARE YOU USING SubmitOrderUnmanaged ??
      and also the OrderType == StopMarket ??


        Hello MarkF60,

        I recall a previous thread where you had brought up running into this here:

        For the thread's reference, this is most often seen with Standard Order Fill Resolution where the order fills are estimated using "virtual bars" and formation of the virtual bars indicate that the order cannot be filled with that price action. Setting Order Fill Resolution to High and using a 1 tick data series as the fill series or submitting orders to a single tick data series would be a good way to avoid those types of errors.

        The errors would be constituted as rejections where the order is submitted to the other side of the market when testing realtime data. They would be handled with realtime data as order rejections in OnOrderUpdate if you use RealtimeErrorHandling, but there is not a way to handle order rejections in a backtest. Other factors are involved with realtime testing, like simulated delays on the Sim101 account, and actual delays seen when the order is submitted to a live or paper trading account, so the issue may be missed if you tried reproducing with mimicked realtime data in the Playback Connection. This also would not be an apples to apples approach for the issue as the error is specific to backtesting.

        I gave your test script another test to see if I could reproduce the order submissions in question, and I still cannot reproduce those trades or any trades within the time frame suggested. The script was also ~1200 lines of code, despite your proprietary signal logic being excluded.

        The best way for us to look into and advise on errors like this where High Order Fill Resolution or submitting orders to a single tick data series does not resolve is if we receive a minimal strategy that simply looks for a specific bar or time to submit an order so the exact order submission in question is reproduced. Similar to the test script I have provided in the linked thread. We would then need to know your data provider, as well as your time zone so we can perform the same test and give our analysis.

        I did not receive this in the previous thread, but if you could provide the requested simplified test strategy with the information requested above, I will be more than happy to take another look and give my analysis.

        We look forward to assisting.

        JimNinjaTrader Customer Service


        Latest Posts


        Topics Statistics Last Post
        Started by WHICKED, 06-27-2023, 12:07 PM
        66 responses
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by tkaboris, 06-11-2024, 08:06 AM
        11 responses
        Last Post tkaboris  
        Started by Matt Skinner, Yesterday, 12:23 AM
        3 responses
        Last Post Matt Skinner  
        Started by Dan_TUK, Today, 05:14 AM
        0 responses
        Last Post Dan_TUK
        by Dan_TUK
        Started by wzgy0920, 04-20-2024, 06:09 PM
        7 responses
        Last Post Joia_
        by Joia_