Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order Cancel Pending

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

    Order Cancel Pending

    Hello,
    I am running a strategy and I run into an issue where occasionally, the strategy will attempt to cancel an order, but the order will be stuck in "cancel pending". How can I change my strategy to avoid this issue?

    #2
    Hello samish18,

    CRITICAL - If your inquiry involves live orders, please always reach out to your broker's Orders Desk immediately to confirm and manage your live orders and positions.

    When an order receives a 'Cancel pending' state, it indicates NinjaTrader Desktop sent the cancellation request to the broker/exchange. Once the order is cancelled, a signal is sent back to NinjaTrader Desktop and the order state will change to 'Cancelled'.

    The display of the 'Cancel pending' order will be removed the next trading day. If not, please perform a restart of NinjaTrader Desktop.

    I'm not sure why the order did not get a 'Cancelled' state. If the order was indeed cancelled, it is likely a connectivity issue. NinjaTrader Desktop did not receive a signal back that the order was cancelled. If the issue persists, please troubleshoot with the steps below. Check if orders are cancelled successful after each step.
    • Restart NinjaTrader
    • Restart your modem and (if applicable) router
    • Restart your PC
    • Clear your DNS
    • - Open the Command Prompt: https://www.howtogeek.com/235101/10-...in-windows-10/
    • - In the command prompt, run this command: ipconfig /flushdns
    • If you are not already and the option is available to you, connect to the internet using an ethernet cable. Wireless connections are significantly more unreliable.
    • Ensure exceptions have been added into any firewall/antivirus/backup programs for the Documents > "NinjaTrader 8" folder.
    • Ensure that your computer is not turning off your Network Adapter to conserve power:
    • - Right-click on your Start button
    • - Select 'Device Manager'
    • - Expand 'Network Adapters'
    • - Right-click on your Network Adapter and select Properties > Power Management
    • - Uncheck 'Allow the computer to turn off this device to save power' option
    • - Click 'OK' to save the changes
    • - Do this for all Network Adapters

    Comment


      #3
      I am testing out a strategy on a sim account. When restrarting ninjatrader, the cancel pending is still there. I manually go into document > Ninjatrader 8 > db to reset. I repeatedly run into this issue when running my strategy, my question is how may I change my code to avoid this?

      Comment


        #4
        You can remove the order stuck in a 'Cancel pending' state by resetting the simulation account.
        • Go to Control Center-->Accounts-tab.
        • Right click the simulation account and select 'Edit Account'.
        • Click reset in the lower right.
        • Click Yes-->OK.
        I'm not a programmer myself, so I will not be much help with changing code. Please create a new forum thread under NinjaTrader Desktop - Strategy Development for assistance in this regard.

        Comment


          #5
          What if this happens, but I don't want to reset my account because I don't want to lose the performance history... is there no other way to remove "cancel pending" orders from a sim account?

          Comment


            #6
            Originally posted by lanredocemo View Post
            What if this happens, but I don't want to reset my account because I don't want to lose the performance history... is there no other way to remove "cancel pending" orders from a sim account?
            You might be able to open the NinjaTrader.sqlite db file in an editor and edit out the orders

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            60 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            39 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            21 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            23 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            51 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X