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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        89 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        135 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        119 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        69 views
        0 likes
        Last Post PaulMohn  
        Working...
        X