Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Analyzer holds trade in "Working" state

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

    Strategy Analyzer holds trade in "Working" state

    Hello,

    I'm reviewing trades from 12/18 that fired in live mode and retesting with the strategy analyzer. I'm expecting to see 6 trades that date, however, when reviewing the analyzer results, 5 given. Digging a little deeper, I see that 1 trade is in a "working" state but is never filled. Any sense of why this would happen? Any help would be appreciated. I've been pulling my hair on on this one.


    I'm running with the following config:

    Code:
    else if (State == State.Configure)
    {
    //https://ninjatrader.com/support/helpGuides/nt8/index.html?realtimeerrorhandling.htm
    //RealtimeErrorHandling = RealtimeErrorHandling.IgnoreAllErrors;
    EntriesPerDirection = 10;
    EntryHandling = EntryHandling.UniqueEntries;
    TraceOrders = true;
    and here's the debug (with annotations) for trades 1-3, included as a attachment, with the second one marked as problematic.​
    Attached Files

    #2
    Hello morr0723,

    That may relate to how the historical fill engine works and the price used for the order. The order would need to evaluate as a fill based on the historical fill rules so it may differ from realtime in that way.

    Comment


      #3
      Hi Jesse, thanks for the reply. I understand historical replay will always be a little different, I'm just perplexed why I executed an order on a new signal but can't get any additional debug why it's not filled.

      Comment


        #4
        Hello morr0723,

        There is no debug info on why an order did not fill, that would just indicate the prices never met the orders criteria so nothing would be logged. You can add your own debugging to verify the orders price and price of the market however the order will need to fall into the fill logic for the historical fill engine to be filled. You can read about that here. https://developer.ninjatrader.com/do...backfill_logic

        Comment


          #5
          This applies for market orders?

          Comment


            #6
            Hello morr0723,

            Yes in the guide I linked it shows how market orders would be processed as well.

            Comment


              #7
              Hi Jesse,

              I don't see anything in the backfill logic that will explain why a submitted market order would not get filled. There wasn't much price action on MNQ, 12/18 at 0956.

              12/18/2024 9:56:00 AM Strategy 'moMoney/-1': Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='RTH-0956' Mode=Ticks Value=200 IsSimulatedStop=False IsMarketIfTouched=False
              Enter Long: RTH-0956 : 1
              12/18/2024 9:56:00 AM Strategy 'moMoney/-1': Entered internal SubmitOrderManaged() method at 12/18/2024 9:56:00 AM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='RTH-0956' FromEntrySignal=''
              12/18/2024 9:56:00 AM, OnOrderUpdate: name=RTH-0956, orderState=Submitted, quantity=1, filled=0, error=NoError, comment=
              12/18/2024 9:56:00 AM, OnOrderUpdate: name=RTH-0956, orderState=Accepted, quantity=1, filled=0, error=NoError, comment=
              12/18/2024 9:56:00 AM, OnOrderUpdate: name=RTH-0956, orderState=Working, quantity=1, filled=0, error=NoError, comment=
              orderId='NT-00003-1078' account='Backtest' name='RTH-0956' orderState=Working instrument='MNQ MAR25' orderAction=Buy orderType='Market' limitPrice=0 stopPrice=0 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2024-12-18 09:56:00' gtd='2099-12-01' statementDate='2025-01-09'​

              Please let me know if and what else I can do to debug. I'd like to see consistency on replays to help build trust that the strategy is operating as expected. I think this is a gap and it's worrisome.

              Comment


                #8
                I went ahead and adjusted the stop to 210 ticks and the order was filled. I'm really not sure what that was the case given the price action at the time. It would be great if we can get some output from NT that explains this particular condition.



                12/18/2024 9:56:00 AM Strategy 'moMoney/-1': Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='RTH-0956' Mode=Ticks Value=210 IsSimulatedStop=False IsMarketIfTouched=False
                Enter Long: RTH-0956 : 1
                12/18/2024 9:56:00 AM Strategy 'moMoney/-1': Entered internal SubmitOrderManaged() method at 12/18/2024 9:56:00 AM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='RTH-0956' FromEntrySignal=''
                12/18/2024 9:56:00 AM, OnOrderUpdate: name=RTH-0956, orderState=Submitted, quantity=1, filled=0, error=NoError, comment=
                12/18/2024 9:56:00 AM, OnOrderUpdate: name=RTH-0956, orderState=Accepted, quantity=1, filled=0, error=NoError, comment=
                12/18/2024 9:56:00 AM, OnOrderUpdate: name=RTH-0956, orderState=Working, quantity=1, filled=0, error=NoError, comment=
                orderId='NT-00003-1118' account='Backtest' name='RTH-0956' orderState=Working instrument='MNQ MAR25' orderAction=Buy orderType='Market' limitPrice=0 stopPrice=0 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2024-12-18 09:56:00' gtd='2099-12-01' statementDate='2025-01-09'
                12/18/2024 9:56:00 AM, execute trade, ExecutionPlan,direction=Long,IsActive=True,contrac ts=1
                12/18/2024 9:56:00 AM, OnOrderUpdate: name=Stop loss, orderState=Submitted, quantity=1, filled=0, error=NoError, comment=
                12/18/2024 9:56:00 AM, OnOrderUpdate: name=Stop loss, orderState=Accepted, quantity=1, filled=0, error=NoError, comment=
                12/18/2024 9:56:00 AM, OnOrderUpdate: name=Stop loss, orderState=Working, quantity=1, filled=0, error=NoError, comment=
                12/18/2024 9:56:00 AM, OnOrderUpdate: name=RTH-0956, orderState=Filled, quantity=1, filled=1, error=NoError, comment=

                Comment


                  #9
                  Hello morr0723,

                  Unfortunately I wouldn't be able to say what may have happened, if this is working now after changing the value I will close the case. As this is listed as a nt7 issue I could only suggest to try this again in NT8 and if you still have a problem make a new post in the nt8 strategy development sub forum.

                  Comment


                    #10
                    Jesse -

                    Apologies for the confusion here. I am using NT8. I think the problem still exists and seems to occur around closing out a trade and then opening one a minute later. When looking at about 1500 trades over a 2 year period, I was able to determine about 70 trades ran into this exact condition (market close at time t, market order at time t+1). The closed trade is reflected in the results one minute after it was closed, implying there is something under the hood that should be reviewed by the dev team.

                    Can we move this tread over to NT8?

                    Comment


                      #11
                      Adjusting the stop does fully address the case but waiting an extra minute will.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      547 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      323 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      99 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      543 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      545 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X