Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
    Chris L.NinjaTrader Customer Service

    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
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by funk10101, Today, 12:02 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by GLFX005, Today, 03:23 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by nandhumca, Yesterday, 03:41 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by The_Sec, Yesterday, 03:37 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by vecnopus, Today, 06:15 AM
        0 responses
        1 view
        0 likes
        Last Post vecnopus  
        Working...
        X