Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

RC1 "unable to cancel out live orders"

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

    RC1 "unable to cancel out live orders"

    I had a strategy running which terminated itself with the message "Unable to cancel out live orders, strategy [xyz...] was not started".

    In my options I have strategies set to "Wait until flat before executing live" and for order handling I have checked "Cancel entry orders...." but not checked "Cancel exit orders" and in the strategy properties, "sync" is set to false.

    When I started the strategy, it ran fine and submitted a market order to enter a position and a stop and a target to protect it. It seems it is these orders which the strategy was then unable to cancel out.

    I investigated why it should try to cancel the orders.

    I reproducing the scenario historically and on the bar when the error occurred, the strategy did nothing except leave the orders open. So it is a mystery why NT tried to cancel the orders, and why it failed to cancel them, and why the error message says "strategy not started". It was clearly running / started.

    10 other strategies - same script, different instrument - that I started at the same time are running fine.

    I have enclosed the traces and the logs in case they help.

    Can you tell me if there is a way in script to show whether the strategy is trading in real-time or whether it is being held, i.e. state yellow / waituntilflat?

    I have come across "historical" which obviously doesn't cover this phase, but it is close and looks like it should have this status level.

    Thanks
    Attached Files
    Last edited by adamus; 11-02-2010, 04:20 PM.

    #2
    Hi Adamus, unfortunately you could not check for the WaitUntilFlat programmatically - Historical would be false for the first realtime bar.

    Thanks for the files - what I see is this - you set the strategy to recalculate after a connection loss - this is precisely what happened, could it be the recalculation led then to flat strategy position that would not need any stops / targets to be protected?

    Comment


      #3
      Hi Bertrand,

      thanks for the info on WaitUntilFlat.

      re the error: it could be that the recalculation led to another strategy position. Why would this represent a problem? The orders were generated by the strategy, it should have full control over them, but instead it had problems cancelling them out.

      Comment


        #4
        The strategy has control over the orders, but it would report this failure if it does not get the cancelled orderstate returned from the brokerage, we checked your logs but are unable to say what is happening to this instance of your Rossini strategy -

        02/11/2010 04:03:42|1|128|Enabling NinjaScript strategy 'Rossini004/9d882bbfed6948a48154823f50c52910' : On starting a real-time strategy - StrategySync=WaitUntilFlat SyncAccountPosition=False EntryHandling=AllEntries EntriesPerDirection=1 StopTargetHandling=PerEntryExecution ErrorHandling=StopStrategyCancelOrdersClosePositio ns ExitOnClose=False Set order quantity by=Strategy ConnectionLossHandling=Recalculate DisconnectDelaySeconds=10 CancelEntryOrdersOnDisable=True CancelExitOrdersOnDisable=False MaxRestarts=10 in 5 minutes

        I believe you're running the strategy on various pairs, you would need to see what happend to the orders of this instance then.

        Comment


          #5
          Hi Bertrand,

          tell me what you need to know. The strategy id? the order ids? it was the strategy running on NZD/USD.

          If my memory serves me well, the orders were submitted and open and not in any noticeably different state.

          Comment


            #6
            We need to know the exact information as to what this particular strategy did. When you run multiple instances of the same strategy it is not possible for us to know which instance generated which order set.

            In general, the message you receive happens when the strategy is unable to cancel orders. It would be easiest for you to tell what happened if you looked at the Control Center Orders tab for the orders related to that particular strategy instance and instrument to see what happened to them. They are likely still active orders and that is what is meant by not being able to cancel them since they do not match anything from the strategy.

            Note: If you are running multiple strategies on this instrument then the task becomes even more complicated as you would need to then isolate which orders actually belong to which strategy instance.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              OK then here is my log of what happened:

              Code:
               2010-11-02 02:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 BarUpdate Flat O[0.76570] H[0.76575] L[0.76445] C[0.76495]
              2010-11-02 03:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 BarUpdate Flat O[0.76490] H[0.76530] L[0.76445] C[0.76450]
              2010-11-02 03:00:00 Rossini004 $NZDUSD S tf:60Min Q:75000 placeOrder() SellShort 75000 MKT (PendingSubmit)
              2010-11-02 03:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 Execution SellShort 75000 MKT (Filled) @0.76450
              2010-11-02 03:00:00 Rossini004 $NZDUSD S tf:60Min Q:75000 placeOrder() BuyToCover [email protected] LMT (PendingSubmit)
              2010-11-02 03:00:00 Rossini004 $NZDUSD S tf:60Min Q:75000 placeOrder() BuyToCover [email protected] STP (PendingSubmit)
              2010-11-02 04:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 BarUpdate Short O[0.76450] H[0.76715] L[0.76335] C[0.76435]
              2010-11-02 04:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 BarUpdate OOs: BuyToCover [email protected] LMT (Working), BuyToCover [email protected] STP (Accepted)
              2010-11-02 04:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 OnTermination()
              2010-11-02 04:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 OnTermination(): Real time 2010-11-02 04:01:25

              Comment


                #8
                I ran a backtest over the time period and this is what the strategy did in backtesting mode:

                Code:
                2010-11-02 03:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 BarUpdate Flat O[0.76495] H[0.76530] L[0.76445] C[0.76450]
                2010-11-02 03:00:00 Rossini004 $NZDUSD S tf:60Min Q:75000 placeOrder() SellShort 75000 MKT (PendingSubmit)
                2010-11-02 03:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 Execution SellShort 75000 MKT (Filled) @0.76450
                2010-11-02 03:00:00 Rossini004 $NZDUSD S tf:60Min Q:75000 placeOrder() BuyToCover [email protected] LMT (PendingSubmit)
                2010-11-02 03:00:00 Rossini004 $NZDUSD S tf:60Min Q:75000 placeOrder() BuyToCover [email protected] STP (PendingSubmit)
                2010-11-02 04:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 BarUpdate Short O[0.76450] H[0.76715] L[0.76335] C[0.76430]
                2010-11-02 04:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 BarUpdate OOs: BuyToCover [email protected] LMT (Working), BuyToCover [email protected] STP (Working)
                2010-11-02 05:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 BarUpdate Short O[0.76430] H[0.76605] L[0.76380] C[0.76530]
                2010-11-02 05:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 BarUpdate OOs: BuyToCover [email protected] LMT (Working), BuyToCover [email protected] STP (Working)
                2010-11-02 06:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 BarUpdate Short O[0.76530] H[0.76695] L[0.76500] C[0.76645]
                2010-11-02 06:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 BarUpdate OOs: BuyToCover [email protected] LMT (Working), BuyToCover [email protected] STP (Working)
                2010-11-02 07:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 BarUpdate Short O[0.76645] H[0.76725] L[0.76550] C[0.76595]
                2010-11-02 07:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 BarUpdate OOs: BuyToCover [email protected] LMT (Working), BuyToCover [email protected] STP (Working)
                2010-11-02 08:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 BarUpdate Short O[0.76595] H[0.76695] L[0.76515] C[0.76665]
                2010-11-02 08:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 BarUpdate OOs: BuyToCover [email protected] LMT (Working), BuyToCover [email protected] STP (Working)
                2010-11-02 09:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 BarUpdate Short O[0.76665] H[0.76820] L[0.76640] C[0.76685]
                2010-11-02 09:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 BarUpdate OOs: BuyToCover [email protected] LMT (Working), BuyToCover [email protected] STP (Working)
                2010-11-02 09:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 OrderUpdate Short BuyToCover [email protected] LMT (Cancelled)
                2010-11-02 09:00:00 Rossini004 $NZDUSD LS tf:60Min Q:75000 Execution BuyToCover [email protected] STP (Filled) @0.76920
                Hopefully the logging is obvious enough.

                Comment


                  #9
                  Same thing happened again in two other instances

                  This morning I had to clear up the disorganisation caused by this event happening in 2 strategies, which resulted in a total crash of NT. It looks like NT lost control of some memory hogging process.

                  I'm attaching the traces and logs. I also attach a spreadsheet export of the Orders tab.

                  Here are the logs that show what I recorded for the two strategies - the first is USDCAD (Rossini004/e65ce.....)

                  Code:
                  2010-11-04 01:00:00 Rossini004 $USDCAD 60Min LS 75000 BarUpdate Flat O[1.00855] H[1.00975] L[1.00805] C[1.00965]
                  2010-11-04 01:00:00 Rossini004 $USDCAD 60Min L 75000 placeOrder() Buy 75000 MKT (PendingSubmit)
                  2010-11-04 01:00:00 Rossini004 $USDCAD 60Min LS 75000 Execution Buy 75000 MKT (Filled) @1.00990
                  2010-11-04 01:00:00 Rossini004 $USDCAD 60Min L 75000 placeOrder() Sell [email protected] LMT (PendingSubmit)
                  2010-11-04 01:00:00 Rossini004 $USDCAD 60Min L 75000 placeOrder() Sell [email protected] STP (PendingSubmit)
                  2010-11-04 02:00:00 Rossini004 $USDCAD 60Min LS 75000 BarUpdate Long O[1.00970] H[1.00970] L[1.00750] C[1.00775]
                  2010-11-04 02:00:00 Rossini004 $USDCAD 60Min LS 75000 BarUpdate OOs: Sell [email protected] LMT (Working), Sell [email protected] ST
                  P (Accepted)
                  2010-11-04 03:00:00 Rossini004 $USDCAD 60Min LS 75000 BarUpdate Long O[1.00775] H[1.00875] L[1.00740] C[1.00780]
                  2010-11-04 03:00:00 Rossini004 $USDCAD 60Min LS 75000 BarUpdate OOs: Sell [email protected] LMT (Working), Sell [email protected] ST
                  P (Accepted)
                  2010-11-04 04:00:00 Rossini004 $USDCAD 60Min LS 75000 BarUpdate Long O[1.00780] H[1.00815] L[1.00700] C[1.00770]
                  2010-11-04 04:00:00 Rossini004 $USDCAD 60Min LS 75000 BarUpdate OOs: Sell [email protected] LMT (Working), Sell [email protected] ST
                  P (Accepted)
                  2010-11-04 04:00:00 Rossini004 $USDCAD 60Min LS 75000 OnTermination()
                  2010-11-04 04:00:00 Rossini004 $USDCAD 60Min LS 75000 OnTermination(): Real time 2010-11-04 04:01:13
                  2010-11-04 04:00:00 Rossini004 $USDCAD 60Min LS 75000 <<<<<<<<<<<<<<<<<<<
                  and the second is USDJPY (Rossini004/c7c76.....)
                  Code:
                  2010-11-04 04:00:00 Rossini004 $USDJPY 60Min LS 75000 BarUpdate Flat O[80.93500] H[80.93500] L[80.75000] C[80.83000]
                  2010-11-04 04:00:00 Rossini004 $USDJPY 60Min S 75000 placeOrder() SellShort 75000 MKT (PendingSubmit)
                  2010-11-04 04:00:00 Rossini004 $USDJPY 60Min LS 75000 Execution SellShort 75000 MKT (Filled) @80.83000
                  2010-11-04 04:00:00 Rossini004 $USDJPY 60Min S 75000 placeOrder() BuyToCover [email protected] LMT (PendingSubmit)
                  2010-11-04 04:00:00 Rossini004 $USDJPY 60Min S 75000 placeOrder() BuyToCover [email protected] STP (PendingSubmit)
                  2010-11-04 04:00:00 Rossini004 $USDJPY 60Min LS 75000 OnTermination()
                  2010-11-04 04:00:00 Rossini004 $USDJPY 60Min LS 75000 OnTermination(): Real time 2010-11-04 04:01:13
                  2010-11-04 04:00:00 Rossini004 $USDJPY 60Min LS 75000 <<<<<<<<<<<<<<<<<<<
                  Attached Files
                  Last edited by adamus; 11-04-2010, 04:23 AM.

                  Comment


                    #10
                    Adamus, here what I see for those pairs - it looks related to IB throwing the 202 error natively - can you please check with them why this was reported?

                    04/11/2010 04:02:29|1|32|Order='1713503869/DU58298' Name='xsFirstTarget' New state=PendingCancel Instrument='$USDJPY' Action=BuyToCover Limit price=80.415 Stop price=0 Quantity=75,000 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
                    04/11/2010 04:02:29|1|32|Order='1713503870/DU58298' Name='xsFirstStop' New state=PendingCancel Instrument='$USDJPY' Action=BuyToCover Limit price=0 Stop price=81.5 Quantity=75,000 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''

                    04/11/2010 04:02:29|1|32|Order='1713503866/DU58298' Name='xlFirstTarget' New state=PendingCancel Instrument='$USDCAD' Action=Sell Limit price=1.017 Stop price=0 Quantity=75,000 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
                    04/11/2010 04:02:29|1|32|Order='1713503867/DU58298' Name='xlFirstStop' New state=PendingCancel Instrument='$USDCAD' Action=Sell Limit price=0 Stop price=1.0062 Quantity=75,000 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''

                    04/11/2010 04:02:29|1|32|Order='1713503869/DU58298' Name='xsFirstTarget' New state=Cancelled Instrument='$USDJPY' Action=BuyToCover Limit price=80.415 Stop price=0 Quantity=75,000 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='Order Canceled - reason: (202)'
                    04/11/2010 04:02:29|1|32|Order='1713503870/DU58298' Name='xsFirstStop' New state=Cancelled Instrument='$USDJPY' Action=BuyToCover Limit price=0 Stop price=81.5 Quantity=75,000 Type=Stop Filled=0 Fill price=0 Error=NoError Native error='Order Canceled - reason: (202)'

                    04/11/2010 04:02:29|1|32|Order='1713503867/DU58298' Name='xlFirstStop' New state=Cancelled Instrument='$USDCAD' Action=Sell Limit price=0 Stop price=1.0062 Quantity=75,000 Type=Stop Filled=0 Fill price=0 Error=NoError Native error='Order Canceled - reason: (202)'
                    04/11/2010 04:02:29|1|32|Order='1713503866/DU58298' Name='xlFirstTarget' New state=Cancelled Instrument='$USDCAD' Action=Sell Limit price=1.017 Stop price=0 Quantity=75,000 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='Order Canceled - reason: (202)'

                    04/11/2010 04:05:14|0|128|Unable to cancel out live orders. Strategy 'Rossini004/e65ce13421ef46b0a2dcfca88d313261' was not started. (USDCAD)
                    04/11/2010 04:05:14|0|128|Unable to cancel out live orders. Strategy 'Rossini004/c7c76c8d4ce34063a67eb2351b95d03f' was not started. (USDJPY)

                    Comment


                      #11
                      Hi Bertrand,

                      thanks for the support but honestly I don't want to get involved in a three way conversation between IB and NT again.

                      I'll live with this.

                      I'll keep my fingers crossed that you guys manage to solve the issue.

                      Comment


                        #12
                        you're welcome adamus and I can understand - we would be curious about this: have you seen similar issues also running on our internal Sim101?

                        Comment


                          #13
                          Sorry but I've never used Sim101.

                          Comment


                            #14
                            Ok, thanks adamus - I would want to work with you on reproducing the issue here on my end. For this I would need your exact setup running - you can contact me via email if interested.

                            Comment


                              #15
                              cancel out?

                              I do not even have live orders enabled - nor any positions open when I enable my strategy - why does it give me this "unable to cancel out live orders" error????

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              602 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              347 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              103 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              560 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              559 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X