Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AtmStrategyChangeStopTarget

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

    AtmStrategyChangeStopTarget

    I am trying to use this method in a strategy I've written to adjust my stop orders. However, no matter what I use as the orderName parameter, the code is changing the profit target order. How do I change the stop order with this method?

    #2
    toptrader,

    You need to use the order name of the entry order. Please post exact code snippet of what you currently have. Thank you.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      This code creates the ATM strategy...

      Code:
      atmStrategyId = GetAtmStrategyUniqueId();
      orderId = GetAtmStrategyUniqueId();
      AtmStrategyCreate(Cbi.Action.Buy, OrderType.Market, 0, 0, TimeInForce.Day, orderId, atmtemplate, atmStrategyId);
      This code is what I am using to try and change the stop...

      Code:
      AtmStrategyChangeStopTarget(0, stop, "STOP1", atmStrategyId);
      I see a parameter in AtmStrategyChangeStopTarget that allows me to define an order name, but I don't see where to define this name in the ATM strategy above.

      Comment


        #4
        Please try the atmStrategyId as string...i.e.

        Code:
         
        AtmStrategyChangeStopTarget(0, stop, "STOP1", "atmStrategyId");

        Comment


          #5
          The AtmStrategyId is a string, however it is a user input parameter so I can select which ATM template I want to use.

          Comment


            #6
            Not sure I follow you here, atmStrategyTemplate (the one you call from the SuperDOM / ChartTrader templates collection created) is not the same as the atmStrategyId to reference the active one in your script.

            Comment


              #7
              My mistake. AtmStrategyId is retrieved by calling GetAtmStrategyUniqueId(). AtmTemplate is a user input parameter. They are both strings.

              Comment


                #8
                toptrader,

                Please run through your code and debug the string for atmStrategyId. Make sure you are not changing it to something else while that current ATM is active. I suspect this to be the case.
                Josh P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

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