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, 05-11-2026, 05:56 AM
        0 responses
        58 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        34 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        195 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        359 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        281 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X