Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATM Targets

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

    ATM Targets

    In NT7 I am currently using AtmStrategyChangeStopTarget(0, (stopPricevariable), "STOP1", atmStrategyId); to change the Stops for the ATM the script is running. Is there a command to change the Targets?

    Thanks

    #2
    thepcmd, the method you are using can change both stops and targets (hence the name AtmStrategyChangeStopTarget()), so you just have to specify the name of the target ("TARGET1") to change it instead of the stop.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Target do not move - Stops do

      I tested the code as follows:

      if (atmStrategyId.Length > 0
      && GetAtmStrategyMarketPosition(atmStrategyId) == MarketPosition.Short)
      {
      AtmStrategyChangeStopTarget(0, (target1), "TARGET1", atmStrategyId);
      AtmStrategyChangeStopTarget(0, (target2), "TARGET2", atmStrategyId);
      AtmStrategyChangeStopTarget(0, (stopPrice), "STOP1", atmStrategyId);
      AtmStrategyChangeStopTarget(0, (stopPrice), "STOP2", atmStrategyId);
      }

      The Stops move as expected but the Targets remain at the preset value of the ATM.

      Any suggestions?

      Thanks

      Comment


        #4
        Hello there, I will have someone get back to you tomorrow.
        AustinNinjaTrader Customer Service

        Comment


          #5
          thepcmd, can you please print the new stop and target prices you set from the scripts - would they provide new & different values for the targets at all?

          Thanks

          Comment


            #6
            Print to output window

            I tested the code as follows:

            if (atmStrategyId.Length > 0
            && GetAtmStrategyMarketPosition(atmStrategyId) == MarketPosition.Short)
            {
            AtmStrategyChangeStopTarget(0, (target1), "TARGET1", atmStrategyId);
            AtmStrategyChangeStopTarget(0, (target2), "TARGET2", atmStrategyId);
            Print("The current ATM Target 1 position is: " + target1);
            Print("The current ATM Target 2 position is: " + target2);
            AtmStrategyChangeStopTarget(0, (stopPrice), "STOP1", atmStrategyId);
            AtmStrategyChangeStopTarget(0, (stopPrice), "STOP2", atmStrategyId);
            }

            Once the order fires here is the output
            The current ATM Target 1 position is: 8
            The current ATM Target 2 position is: 25

            The ATM is set to 8 and 16 and the targets remained at 8 and 16

            Comment


              #7
              thepcmd,

              When you are changing the target you should be changing the limit price, not the stop price of the target order. Right now you are changing the stop price.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Thanks

                Thank you for the help solving my issue. Once you pointed out that I should have been using a limit order, I was able to solve my programming problem

                Thanks again

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                647 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                369 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                108 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                572 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                573 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X