Announcement

Collapse

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

Collapse

How do I trap Order Ignore error messages

Collapse
X
 
  • 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?

    #2
    You can enable tradeorder.
    Code:
    protected override void OnStateChange()
    {
        if (State == State.SetDefaults)
        {
            TraceOrders = true;
        }
    }

    Comment


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

      Comment


        #4
        Hello MarkF60,

        I recall a previous thread where you had brought up running into this here: https://ninjatrader.com/support/foru...ategy-analyzer

        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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by sofortune, Today, 02:31 AM
        0 responses
        6 views
        0 likes
        Last Post sofortune  
        Started by sofortune, Today, 01:55 AM
        1 response
        5 views
        0 likes
        Last Post sofortune  
        Started by cls71, Today, 01:37 AM
        0 responses
        6 views
        0 likes
        Last Post cls71
        by cls71
         
        Started by WHICKED, 06-27-2023, 12:07 PM
        63 responses
        763 views
        1 like
        Last Post Leeroy_Jenkins  
        Started by rtwave, Today, 12:10 AM
        0 responses
        5 views
        0 likes
        Last Post rtwave
        by rtwave
         
        Working...
        X