Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitLong() not removing order.

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

    #16
    Hello clabough,

    This is a known issue involving the API not sending NinjaTrader order/execution/position feedback and TDA has acknowledged this issue being on their end. It is most often not our intention to add workarounds or "band-aid" fixes to our Connection Adapters to address acknowledged issues with an API. Such changes can make the code harder to maintain, and could lead down a path where new issues come up if there are changes on the API end and we are not following specifications to a T.

    That said, if you have a suggestion for a workaround that you believe is non-invasive and worth suggesting to our development team, I am willing to bring it up. Please send me an email to scriptingsupport [at] ninjatrader [dot] com with the text "Attn Jim 3263026" and we can continue discussing there.

    Otherwise, you could consider trading stocks with Interactive Brokers through NinjaTrader, where the Connection Adapter does not exhibit these API issues, and we will be happy to help with any strategy development specific questions you have there.

    Comment


      #17
      NinjaTrader_Jim

      Well... I can manually clear the problem with NT by disconnecting from TDA via the connections panel then reconnect, then removing and adding the strategy back to the chart, so if I can do it by pressing buttons in NT, then that tells me that the API has enough information for you to be able to fix this problem in your code.

      Like I said, in ThinkOrSwim, I see the orders bought and sold that NT is sending, but NT doesn't clear the position after selling. I am pretty sure I'm seeing the confirmation come back through OnExecutionUpdate, OnOrderUpdate, or OnPositionUpdate, but I will run a test to confirm that tomorrow - since NT can't send orders to TDA outside market hours.
      Last edited by clabough; 09-16-2021, 03:42 PM.

      Comment


        #18
        I'd like to revisit this bug - at least for manual entries.

        When I manually press a buy button, the order shows on the chart and in the Orders list as Filled. When I then press a sell button, the order gets executed (verified on TDA's activity list) and the NT Orders list shows the sell action as Filled, yet the initial buy order remains on the chart and in the Positions list. If the Orders list knows it was filled, then NT should know that the position has been closed or at least reduced by the quantity sold.

        If I disconnect from TDA and reconnect, NT then removes the ghost position from the list.

        Comment


          #19
          Hello clabough,

          NinjaTrader handles orders, executions and positions differently, and tries to get this information natively from each broker.

          If you want, we could submit an enhancement request to have NinjaTrader try and patch in information for missing order/execution/position updates when it is not provided by the broker.

          We had another request to consider adding an additional method/menu item so users could manually fetch account position information in case it has not been given, so a reconnect would not be needed.

          If you have interest in either one of those, I will be happy to create a new internal ticket, or add a vote on your behalf to suggest those enhancements.

          Comment


            #20
            You can add my vote, but I've seen so few enhancement suggestions implemented from this forum, I'm hesitant to do either.

            Comment


              #21
              Hello clabough,

              We cannot make promises for every feature/enhancement/change request made. Client interest is weighed against feasibility and necessity for the change before it is considered.

              The impact here with TDA is known, and your interest behind implementing a workaround has been tracked.

              We are tracking interest behind a Method/Function to fetch account information with ticket ID SFT-5336. Changes are noted in the Release Notes page of the Help Guide when a new release is published. The ID number will different, but descriptions may be referenced to see if a particular change has been made.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              576 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              334 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              553 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              551 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X