Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT Autotrade is canceling stop loss orders leaving positions active

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

    NT Autotrade is canceling stop loss orders leaving positions active

    Running a strategy that has never failed before but all of a sudden when the stop loss limit should have been triggered, NT canceled the order instead. Leaving me in the position.

    I thought, how odd. Let me reload the script and reload to see if I can duplicate it. Sure enough the backtest exit worked as expected but the next time a stop loss should have been triggered, the same thing happened. It canceled the stop leaving me in the position.

    NT6.5.1000.18 Sim

    It ran fine for days on live trades and then switching back to sim it just craps out now.

    Any thoughts on how to troubleshoot this?

    On the chart, the stop loss should have been triggered at 2:04AM on 11/11, yet it was canceled instead.



    Attached Files

    #2
    RDPoS, you would need to run your script with TraceOrders to see why the order was cancelled here -

    BertrandNinjaTrader Customer Service

    Comment


      #3
      Funny, I opened the script to add the command and NT crashed. I will restart and add the command. I can't send logs to tech support because the mailer does not work in Ninja.

      Comment


        #4
        You can also forward the log / trace files manually if you attach the ones from today (they all have a date) to an email to support at ninjatrader dot com. You can locate the files via the Log / Trace folders under MyDocuments > NinjaTrader 6.5 / 7
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Sent and scripts updated with TraceOrders().

          How do I make use of this information now?

          Comment


            #6
            Please take a look at the link I posted - you would open the output window and get additional order debug info helping you hopefully pin down why the cancellation happens.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              So that is a popup output window?

              Comment


                #8
                No, you would open the regular output window via Tools > Output Window.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Is it possible to get the value of the variables to print out when the orders are updated on the output log as well? That might be helpful as well.

                  Comment


                    #10
                    Yes, you could add Prints throughout your code to achieve this level of insight -

                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Ok I got NT to duplicate the error where it canceled the order that should have been executed.

                      From the TraceOrder() log:

                      11/12/2010 4:48:25 AM Amended matching order: Action=Sell OrderType=StopLimit Quantity=0 LimitPrice=1.3674 StopPrice=1.3674 SignalName=Sell' FromEntrySignal=''
                      11/12/2010 4:48:34 AM Entered internal PlaceOrder() method at 11/12/2010 4:48:34 AM: Action=Sell OrderType=StopLimit Quantity=0 LimitPrice=1.3684 StopPrice=1.3684 SignalName='' FromEntrySignal=''
                      11/12/2010 4:48:34 AM Amended matching order: Action=Sell OrderType=StopLimit Quantity=0 LimitPrice=1.3684 StopPrice=1.3684 SignalName=Sell' FromEntrySignal=''
                      11/12/2010 4:52:24 AM Entered internal PlaceOrder() method at 11/12/2010 4:52:24 AM: Action=Sell OrderType=StopLimit Quantity=0 LimitPrice=1.3690 StopPrice=1.3690 SignalName='' FromEntrySignal=''
                      11/12/2010 4:52:24 AM Amended matching order: Action=Sell OrderType=StopLimit Quantity=0 LimitPrice=1.3690 StopPrice=1.3690 SignalName=Sell' FromEntrySignal=''
                      11/12/2010 4:58:47 AM Entered internal PlaceOrder() method at 11/12/2010 4:58:47 AM: Action=Sell OrderType=StopLimit Quantity=0 LimitPrice=1.3690 StopPrice=1.3690 SignalName='' FromEntrySignal=''
                      11/12/2010 4:58:47 AM Ignored PlaceOrder() method: Action=Sell OrderType=StopLimit Quantity=0 LimitPrice=1.3690 StopPrice=1.3690 SignalName=Sell' FromEntrySignal='' Reason='There already is a matching order with same prices and quantity'
                      11/12/2010 5:01:12 AM Entered internal PlaceOrder() method at 11/12/2010 5:01:12 AM: Action=Sell OrderType=StopLimit Quantity=0 LimitPrice=1.3690 StopPrice=1.3690 SignalName='' FromEntrySignal=''
                      11/12/2010 5:01:12 AM Ignored PlaceOrder() method: Action=Sell OrderType=StopLimit Quantity=0 LimitPrice=1.3690 StopPrice=1.3690 SignalName=Sell' FromEntrySignal='' Reason='There already is a matching order with same prices and quantity'
                      11/12/2010 5:02:06 AM Entered internal PlaceOrder() method at 11/12/2010 5:02:06 AM: Action=Sell OrderType=StopLimit Quantity=0 LimitPrice=1.3690 StopPrice=1.3690 SignalName='' FromEntrySignal=''
                      11/12/2010 5:02:06 AM Ignored PlaceOrder() method: Action=Sell OrderType=StopLimit Quantity=0 LimitPrice=1.3690 StopPrice=1.3690 SignalName=Sell' FromEntrySignal='' Reason='There already is a matching order with same prices and quantity'
                      11/12/2010 5:07:35 AM Entered internal PlaceOrder() method at 11/12/2010 5:07:35 AM: Action=Sell OrderType=StopLimit Quantity=0 LimitPrice=1.3690 StopPrice=1.3690 SignalName='' FromEntrySignal=''
                      11/12/2010 5:07:35 AM Ignored PlaceOrder() method: Action=Sell OrderType=StopLimit Quantity=0 LimitPrice=1.3690 StopPrice=1.3690 SignalName=Sell' FromEntrySignal='' Reason='There already is a matching order with same prices and quantity'
                      11/12/2010 5:07:38 AM Entered internal PlaceOrder() method at 11/12/2010 5:07:38 AM: Action=Buy OrderType=StopLimit Quantity=1 LimitPrice=1.3742 StopPrice=1.3742 SignalName='' FromEntrySignal=''
                      11/12/2010 5:07:38 AM Ignored PlaceOrder() method at 11/12/2010 5:07:38 AM: Action=Buy OrderType=StopLimit Quantity=1 LimitPrice=1.3742 StopPrice=1.3742 SignalName='Buy' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'
                      11/12/2010 5:07:38 AM Cancelled expired order: BarsInProgress=0: Order='7207b8fe0e084f598b526e8f13f64fcb/Sim101' Name='Sell' State=Working Instrument='M6E 12-10' Action=Sell Limit price=1.369 Stop price=1.369 Quantity=1 Strategy='FX4Chandy54Long' Type=StopLimit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='7207b8fe0e084f598b526e8f13f64fcb' Gtd='12/1/2099 12:00:00 AM'
                      11/12/2010 5:07:49 AM Entered internal PlaceOrder() method at 11/12/2010 5:07:49 AM: Action=Buy OrderType=StopLimit Quantity=1 LimitPrice=1.3731 StopPrice=1.3731 SignalName='' FromEntrySignal=''
                      11/12/2010 5:07:49 AM Ignored PlaceOrder() method at 11/12/2010 5:07:49 AM: Action=Buy OrderType=StopLimit Quantity=1 LimitPrice=1.3731 StopPrice=1.3731 SignalName='Buy' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'
                      11/12/2010 5:07:58 AM Entered internal PlaceOrder() method at 11/12/2010 5:07:58 AM: Action=Buy OrderType=StopLimit Quantity=1 LimitPrice=1.3721 StopPrice=1.3721 SignalName='' FromEntrySignal=''
                      11/12/2010 5:07:58 AM Ignored PlaceOrder() method at 11/12/2010 5:07:58 AM: Action=Buy OrderType=StopLimit Quantity=1 LimitPrice=1.3721 StopPrice=1.3721 SignalName='Buy' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'
                      11/12/2010 5:08:35 AM Entered internal PlaceOrder() method at 11/12/2010 5:08:35 AM: Action=Buy OrderType=StopLimit Quantity=1 LimitPrice=1.3721 StopPrice=1.3721 SignalName='' FromEntrySignal=''

                      Not seeing how it is an expired order since it was just called in seconds before. What happened? It is a single order strategy.

                      Comment


                        #12
                        You normally submit your order on each new bar so it would get resubmitted - at this point in time where the expiry happend your stops switched to the upperside and thus not providing a resubmitted order to keep it alive (stop and limit order expire after one bar in NT if not resubmitted or sent with liveUntilCancelled = true).
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          But how can it switch without being filled first? That is the part I don't understand.

                          Comment


                            #14
                            You would need to debug the strategy sequence of events to exactly understand what is happening - you use StopLimit orders for exit correct? Those could leave you unfilled and thus expiring on next bar.
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              Ok let's think about this. I am using 10-range bars.

                              The bar started at 1.3699.
                              The stop limit was placed at 1.3691

                              The price dropped to 1.3691 so for the bar to complete and thus cancel the order, it must continue dropping to 1.3689 or rise above 1.3701.

                              If it did rise back up to 1.3701 I could see never being filled on the limit and the order being placed in the book or the broker would hold it, but it cannot be canceled until the next bar begins.

                              Because it did not rise, but kept falling down to 1.3689, In real life the stop would be triggered and the order would be filled by any responsible broker. But this is just sim without slippage and NT did not fill the order, but canceled the order instead.

                              Couldn't that be an NT bug?

                              IF the range had broken out higher, I could buy the explanation, but because it continued lower, it makes zero sense to have the order canceled.

                              Why would NT cancel an order on SIM or not fill an order on SIM within an active bar?

                              My floor people say there is no way in real life that would have been canceled, so why is NT canceling the order?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by The_Sec, Yesterday, 03:37 PM
                              1 response
                              11 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by vecnopus, Today, 06:15 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post vecnopus  
                              Started by Aviram Y, Today, 05:29 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post Aviram Y  
                              Started by quantismo, 04-17-2024, 05:13 PM
                              3 responses
                              27 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by ScottWalsh, 04-16-2024, 04:29 PM
                              7 responses
                              36 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Working...
                              X