Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JimNinjaTrader Customer Service

    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.
          JimNinjaTrader Customer Service

          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.

              JimNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by habeebft, Today, 07:27 AM
              1 response
              11 views
              0 likes
              Last Post NinjaTrader_ChristopherS  
              Started by AveryFlynn, Today, 04:57 AM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by Max238, Today, 01:28 AM
              4 responses
              37 views
              0 likes
              Last Post Max238
              by Max238
               
              Started by r68cervera, Today, 05:29 AM
              1 response
              10 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by geddyisodin, Today, 05:20 AM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Working...
              X