Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SampleOnOrderUpdate - TD Ameritrade

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

    SampleOnOrderUpdate - TD Ameritrade

    Hello:

    How can the code for stopOrder and targetOrder in OnExecution(IExecution execution) be combined to reflect TD Ameritrade's requirement of both StopLoss and ProfitTarget being applied at the same time? There is no ExitLongStopLimit variable. Once this is figured out, I am sure that moving the StopLoss up to Postion.AvgPrice code when price is 1/2 or greater of ProfitTarget will also require some adjustment. I recognize that this is not required for other providers, and welcome help in this matter.

    Thanks.

    Tony

    #2
    Tony, I'm not sure I fully follow - looking throught the sample both the stop and target order are submitted at the same time once entryOrder reports as filled.

    If you work with the Set() methods, you would need to set WaitForOcoClosingBracket = true -

    BertrandNinjaTrader Customer Service

    Comment


      #3
      SampleOnOrderUpdate - ExitLongStopLimit?

      Hi Bertrand:

      I asked this question because of my searching through the forums and trying to find problems with autotrading using TD Ameritrade. My gist of the main problem found was that a profit target and stop loss must be placed at the same time. In OnExecution(IExecution execution) part of SampleOnOrderUpdate, stopOrder and targetOrder appear to be submitted separately. If my premise is correct, shouldn't I use a variable to handle both? I am not using SetProfitTarget(), SetStopLoss(), or SetTrailStop(). I have successfully merged the code with my trading program and it works well within both charting and Strategy Analyzer. Thanks.

      Tony

      Comment


        #4
        tonyh, I believe this issue has been resolved. Are you actually running into errors or are you just assuming it won't work because it hasn't in the past?
        AustinNinjaTrader Customer Service

        Comment


          #5
          TD Ameritrade Issue Resolved?

          Hello Austin:

          If the error has been rectified, I must have missed it in the forums. I am about to purchase a live version, and just wish to have as many possible order entry issues addressed as possible. SampleOnOrderUpdate will be my primary way to buy and sell shares via TD Ameritrade. Thanks.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Segwin, 05-07-2018, 02:15 PM
          14 responses
          1,788 views
          0 likes
          Last Post aligator  
          Started by Jimmyk, 01-26-2018, 05:19 AM
          6 responses
          837 views
          0 likes
          Last Post emuns
          by emuns
           
          Started by jxs_xrj, 01-12-2020, 09:49 AM
          6 responses
          3,293 views
          1 like
          Last Post jgualdronc  
          Started by Touch-Ups, Today, 10:36 AM
          0 responses
          13 views
          0 likes
          Last Post Touch-Ups  
          Started by geddyisodin, 04-25-2024, 05:20 AM
          11 responses
          63 views
          0 likes
          Last Post halgo_boulder  
          Working...
          X