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 NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        58 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        133 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        73 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X