Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

TD Ameritrade and OnExecutionUpdate

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

    TD Ameritrade and OnExecutionUpdate

    I'm developing a strategy for TD Ameritrade account.
    Usually I update my stops and targets with those lines within OnExecutionUpdate:

    Code:
    stopOrders[i] = ExitLongStopMarket(IsBacktest ? TickChartIdx : 0, true, execution.Order.Filled, s, "MyStop" + i, "Long" + i);
    targetOrders[i] = ExitLongLimit(IsBacktest ? TickChartIdx : 0, true, execution.Order.Filled, l, "MyTarget" + i, "Long" + i);
    I suppose I can't use it with TDA. Is it correct?
    How would you suggest managing partial fills for TDA?

    Thank you!

    #2
    Hi frslvr, thanks for writing in.

    There's nothing different about using OnExecuationUpdate with a TDA connection. The only caveat with TDA strategies is that market orders need to be in TIF = DAY, otherwise the connection works the same way as the others. Was there some unexpected behavior with the code you are showing here?

    Kind regards,
    -ChrisL

    Comment


      #3
      Hi Chris,

      Thank you for your reply.
      I mean if the following is true then I can't add/modify orders as I did.
      When submitting orders within an OCO group, the orders must be submitted as a pair and after submission, those orders will no longer be modifiable. To make a change to an OCO grouped order it must be cancelled and resubmitted.

      Comment


        #4
        Hi frslvr, thanks for your reply.

        Only the Set methods and unmanaged orders will use an OCO group. The Exit methods can be used normally. The forum post I linked below demonstrates the case where you would need to use Account.Cancel to cancel a stop loss order.

        https://ninjatrader.com/support/foru...rade-and-oco-s

        Best regards,
        -ChrisL

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        43 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        21 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        30 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        50 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        40 views
        0 likes
        Last Post CarlTrading  
        Working...
        X