Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problems with strategy on live Ameritrade account

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

    Problems with strategy on live Ameritrade account

    Hello,

    I'm running a very simple strategy, which places an order with a StopLoss and ProfitTarget on my Ameritrade account.

    I'm aware of the limitations with OCO orders and Ameritrade, but I'm not using any trail stops, or modifying the OCO order in any way with my strategy.

    The problem is that when the order is placed I see 2 stops within NT, one orange and one blue. The live order is submitted to Ameritrade just fine, and I see the OCO order executed in TOS, however once the order gets stopped out on the Ameritrade side, I still see the orange stop in Ninjatrader (see attached screenshots for reference). Also, when I look in the orders I still see order initialized and change pending.

    How could I place a simple OCO order with a stop/target from my strategy that will work with Ameritrade and update in NT correctly once the profit/stoploss is hit?
    Attached Files

    #2
    Hi zgdesign, thanks for writing in. Is this only happening in your script or can you reproduce it with manual orders or an ATM strategy? This will tell us if it's a coding issue or if there is some issue with the TDA connection that we will need to look at. If you are not able to reproduce with a manual/ATM strategy order please send me your script to scriptingsupport at ninjatrader.com, reference "Attn ChrisL 3638682"

    Kind regards,
    -ChrisL

    Comment


      #3
      Originally posted by NinjaTrader_ChrisL View Post
      Hi zgdesign, thanks for writing in. Is this only happening in your script or can you reproduce it with manual orders or an ATM strategy? This will tell us if it's a coding issue or if there is some issue with the TDA connection that we will need to look at. If you are not able to reproduce with a manual/ATM strategy order please send me your script to scriptingsupport at ninjatrader.com, reference "Attn ChrisL 3638682"

      Kind regards,
      -ChrisL
      Hi Chris,

      The same thing happens when I place an order manually with a simple ATM strategy as well, without any trailing stops. Just a stoploss and profit target.

      Comment


        #4
        Another few observations:

        1) Once I place the manual ATM OCO order and it executes in TOS, I get 2 colored stops in Ninjatrader, one pink and one orange. If I move the pink stop it actually updates the OCO order stop in TOS. I thought OCO orders couldn't be modified with Ameritrade after it executes?

        2) What is the orange stop for? If I try to move it it doesn't let me.

        3) If i close the position manually within Ninjatrader, I get an error that the order couldn't be closed and it has to be done manually from the Ameritrade side.

        Comment


          #5
          Hi zgdesign, We are testing this on our TDA account right now. Can you share your script with us in case we are not able to reproduce it?

          1. OCO orders are natively supported on the TDA servers. The stop or target must be fully canceled and re-submitted to change it on TDA.
          2. We are testing this now to see if we can reproduce it.
          3. We are testing it now.

          Kind regards,
          -ChrisL
          Last edited by NinjaTrader_ChrisL; 06-08-2022, 08:29 AM.

          Comment


            #6
            Hi Chris,
            I basically got the ChartOrderButtonsStrategyExample from you guys, so I can fire the EnterLong(1, @"Buy1"); via a button, without having to wait for my strategy condition.

            All I did was add the stops and targets with this code:

            SetProfitTarget(@"Buy1", CalculationMode.Ticks, 4);
            SetStopLoss(@"Buy1", CalculationMode.Ticks, 4, false);

            Comment


              #7
              Hi zgdesign, thanks for sharing. Where are you calling SetProfitTarget and SetStopLoss? In State.Configure, before the entry order, or after the entry order?

              Comment


                #8
                Hi Chris,

                I'm calling it before, in the State.DataLoaded, please see below...


                else if (State == State.DataLoaded)
                {

                SetProfitTarget(@"Buy1", CalculationMode.Ticks, 4);

                SetStopLoss(@"Buy1", CalculationMode.Ticks, 4, false);

                Comment


                  #9
                  Hi zgdesign, We were able to reproduce what you reported. I have submitted a ticket with our development team on the issue. Ill update you here once I have more information.

                  Kind regards,
                  -ChrisL

                  Comment


                    #10
                    Hi Chris
                    Any idea how long it will take to figure this out? Right now I'm pretty much at a standstill.

                    Comment


                      #11
                      Hi zgdesign, I can not give an exact time frame, but It will likely be until the next revision. It could be 2 weeks to 2 months, I do not know at this point.

                      Comment


                        #12
                        Is there any workaround until then? I purchased the multibroker lifetime license which wasn't cheap, and if I have to wait 2 months to use it that's a major issue.

                        Comment


                          #13
                          HI zgdesign, for now, you can enter the market, turn on OCO mode with Control+Z on your keyboard, then place a stop/limit orders for the bracket. Turn off OCO mode with Control+Z again after you are done submitting the protective orders.

                          Comment


                            #14
                            Hi Chris,
                            But this has to be done manually? I was referring to running my automated strategies.
                            Is this issue with the latest version of NT? What if I revert to an older version?
                            Is there any code I can add to keep track of the current trade profit/loss and exit manually? Would that work?

                            Comment


                              #15
                              Hi zgdesign, It would be for manual orders. For the strategy, please try this method of submitting protective orders:



                              This is the first time the issue has been reported, so it's possible it showed up in R26. You can try reverting back to R25 by first uninstalling through the Windows Control Panel, then install the previous version from here (look below the current release)
                              ninjatrader.com/GetStarted

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by NullPointStrategies, Yesterday, 05:17 AM
                              0 responses
                              62 views
                              0 likes
                              Last Post NullPointStrategies  
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              134 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              75 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