Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cancelling All Orders

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

    Cancelling All Orders

    Any way to cancel all orders with a single method instead of having to track each one and cancel individually?

    Thanks

    #2
    paulca, there's unfortunately no supported way to achieve that in our NinjaScript, each order would need to be cancelled via an explicit CancelOrder() call to your IOrder. What use scenario do you have in mind? Would this be just a one time command for when you would disable the script for reaching a given session pnl for example?

    Comment


      #3
      Bertrand,

      Two scenarios:

      I have multiple entry orders and if I get an error on any order I would like to cancel all existing entry orders and suspend trading..

      I have a time limit and when I reach that limit I would like to cancel all entry orders..

      Comment


        #4
        Thanks.

        1. For error you mean a rejection? Then the real-time error handling per default would take care of canceling - http://www.ninjatrader.com/support/h...htsub=realtime

        2. Ok for this case you would need to issue a CancelOrder call for each IOrder of your entries. You could also look into the unsupported FlattenEverything call from the SuperDOM, however this would be an extreme action I feel for those scenarios.

        Comment


          #5
          Bertrand,

          Thank you, that handles one of my scenarios nicely.

          Paul

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          64 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          149 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          162 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          99 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          286 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Working...
          X