Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using NT8 scrip to change an order in TDAmeritrade

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

    Using NT8 scrip to change an order in TDAmeritrade

    Hi, Support Folks,

    When I was connecting to TDAmeritrade, it prompted a note saying changing an order is not supported for TDAmeritrade. Then I have a few questions here:
    1) Is this true?
    2) If yes, I would have to let my scripts cancel the existing order and re-submit a new one when conditions change; How does this affect the performance, delay within 1 second, or a few seconds comparing to a typical changing an order?
    3) Is changing order limitation only applicable to TDAmeritrade?

    Thanks.

    #2
    Hello localappleseed,

    Thank you for your posts.

    When creating strategies for use with TD Ameritrade, there are some important limitations to keep in mind.

    TD Ameritrade connections are particularly strict with NinjaScript strategies, especially with Native OCO enabled on the connection. TDA is also strict on the order in which they receive orders of different Order Actions. I.E. receiving a Buy before a Buy To Cover is received will result in a rejection.

    Once an OCO pair is submitted, it must be cancelled and replaced and TD Ameritrade will not allow modifying the orders. Set method orders cannot be canceled with CancelOrder(). Exit methods will not use OCO and can work around this limitation. (ExitLong(), for example).

    If a position is protected with working orders and NinjaTrader submits another order to exit the position, we can receive an Overbought/Oversold error.

    2020-06-03 13:50:59:743|1|32|Order='1132281582/AccountName' Name='Profit target' New state='Working' Instrument='IBM' Action='Buy to cover' Limit price=128.57 Stop price=0 Quantity=51 Type='Limit' Time in force=DAY Oco='1132281579:1371573263' Filled=0 Fill price=0 Error='No error' Native error=''

    2020-06-03 13:52:06:957|1|32|Order='4b0936b609014ef98df583e2e a3bce10/AccountName' Name='Buy to cover' New state='Rejected' Instrument='IBM' Action='Buy to cover' Limit price=0 Stop price=0 Quantity=51 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='Order rejected' Native error='This order may result in an oversold/overbought position in your account. Please check your position quantity and/or open orders.'

    Reversing orders may not work since NinjaTrader is multi threaded and it is possible for a Buy for a reversal to be submitted before the Buy To Cover order when reversing from a short position.

    There is also an on going issue where TDA has a delay on sending the Execution of an order after it fills.

    The above limitations are all specific to TD Ameritrade. You would need to cancel and resubmit any orders you need to change, and this would have a minor effect on performance, but I do not have a measurement of how much it would affect the performance compared to changing an order. It would likely be fairly negligible.

    Please let us know if we may be of further assistance to you.


    Kate W.NinjaTrader Customer Service

    Comment


      #3
      What are good alternatives to TD Ameritrade?
      Something that doesn't charge me to buy and sell contracts. (NASDAQ, S&P)
      I live in the US.

      I too noticed that using them for a broker with Ninja is all sorts of problems.

      Comment


        #4
        Hello vixtor,

        Thank you for your reply.

        While I cannot give any recommendations as to your choice of broker, you can see our supported providers here:

        https://ninjatrader.com/support/help...y_provider.htm

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          In your earlier replies about "especially with Native OCO enabled on the connection".
          If without OCO enabled, or if I just submit a single EnterLongLimit() order through TDA, can I use ChangeOrder()?

          Comment


            #6
            Hello localappleseed,

            Thank you for your reply.

            Local OCO does not work with TD Ameritrade; when this option is enabled in the options for the TD Ameritrade connection and you try to submit an ATM strategy (or manual OCO), TDA is not aware of any link between the orders.

            Because TDA has internal order handling rules to prevent oversold/overbought positions with unlinked orders, an error message will be received on trying to submit the second order:

            "This order may result in an oversold/overbought position in your account".

            Single, non-OCO linked orders, such as a single EnterLongLimit() entry order, would work with ChangeOrder().

            Please let us know if we may be of further assistance to you.
            Kate W.NinjaTrader Customer Service

            Comment


              #7
              Thank you very much for the clear answer on this.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by condorhero, Today, 09:28 PM
              0 responses
              5 views
              0 likes
              Last Post condorhero  
              Started by MaraAnkh, Today, 08:44 PM
              0 responses
              6 views
              0 likes
              Last Post MaraAnkh  
              Started by wooofad, Today, 05:38 PM
              0 responses
              7 views
              0 likes
              Last Post wooofad
              by wooofad
               
              Started by caacapital, Today, 10:10 AM
              2 responses
              18 views
              0 likes
              Last Post caacapital  
              Started by DiverG20, Today, 10:23 AM
              0 responses
              23 views
              0 likes
              Last Post DiverG20  
              Working...
              X