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 kinfxhk, 07-13-2026, 10:18 AM
                0 responses
                28 views
                0 likes
                Last Post kinfxhk
                by kinfxhk
                 
                Started by kinfxhk, 07-13-2026, 09:50 AM
                0 responses
                17 views
                0 likes
                Last Post kinfxhk
                by kinfxhk
                 
                Started by kinfxhk, 07-13-2026, 07:21 AM
                0 responses
                26 views
                0 likes
                Last Post kinfxhk
                by kinfxhk
                 
                Started by kinfxhk, 07-11-2026, 02:11 AM
                0 responses
                24 views
                0 likes
                Last Post kinfxhk
                by kinfxhk
                 
                Started by SalmaTrader, 07-07-2026, 10:26 PM
                0 responses
                139 views
                0 likes
                Last Post SalmaTrader  
                Working...
                X