Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Move ATM Targets to desired price

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

    Move ATM Targets to desired price

    I am utilizing an ATM in my strategy. Works great. Right after entering to initial Targets and Stops, I want the Targets and Stop to go to a specific Price (ATR for this discussion) As soon as I place the ATM, and try to utilize ATMStrategyStopTarget(), I get an error message, 'AtmStrategyChangeStopTarget' method error: ATM strategy ID 'ATM2' does not exist or is already in a terminated state.
    Here is the Code that initiates the ATM and right under that the change request. I also included Output screen that generated the error and hopefully prints to let me know whats going on.
    I guess my first question #1: Am I utilizing the correct change code ? ATMStrategyStopTarget(), - if not can you direct me to the correct one. 2nd question: Why am I getting the error?
    Thank you..






    #2
    Hello JohnnyCat,

    You will need to supply the Atm instance ID and not the template name. In your screenshot you are using the variable atmStrategyId to store this.

    AtmStrategyChangeStopTarget(double limitPrice, double stopPrice, string orderName, string atmStrategyId)

    https://ninjatrader.com/support/help...stoptarget.htm

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you, Chelsea for the response. I dont think I get it yet, Is the atmStrategyId​ The one I have in this screen shot? Something like -Strat ID: 2890508cc7c94a6c8a80e78ddb39cce4 ?
      I am getting the same error so I dont understand the code yet. Here is where I am at: I understand that I need to change the Last part of the code - just not sure to what? I've tried many different ways. Not giving up....Read the Link - didnt ring any bells - read some other links - still not getting it,






      Comment


        #4
        Hello JohnnyCat,

        Yes, that would be the id that was generated.

        "atmStrategyId" <-- this is a string with the text "atmStrategyId"

        atmStrategyId <-- without the quotation marks, this is a variable that holds a string with the text "2890508cc7c94a6c8a80e78ddb39cce4"

        Supply the variable. Remove the quotation marks. The variable will be white and not blue.

        I am also including a link to a forum post with helpful resources on getting started with C#.
        https://ninjatrader.com/support/foru...pts#post786040
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks Chelsea for the links - have some light reading to do. I changed the variable and still the same error.






          Comment


            #6
            Hello JohnnyCat,

            Are you certain the entry order has filled?

            Is isAtmStrategyCreated true or false?

            Is GetAtmStrategyEntryOrderStatus()[2] returning filled?



            Has the stop or target already filled and closed the atm strategy?


            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              So Chelsea, It does seems to be working, however I have to wait for the next Bar. Same as the sampleATMStrategy. I thought that since I put the AtmStrategyChangeStopTarget() under the entry area, I would be able to launch the ATM and them quickly move the targets within the Bar. Is it possible to move the Targets quickly with the same time frame/Bar as when the ATM is launched?

              Comment


                #8
                Hello JohnnyCat,

                It takes time for the entry to be submitted, become working, fill, and then update the position. This will not happen in the exact same moment that the order was submitted and you will need to wait.

                As you are using Atm Strategy methods instead of placing regular strategy order methods the strategy is not able to see these orders or know when they have filled.

                If you were using regular strategy order methods, OnOrderUpdate() / OnExecutionUpdate() / OnPositionUpdate() would trigger the moment the order fills, or the execution fill updates, or the moment the position updates.

                Instead, you will need to check back after a while that the order has filled either every tick or every bar close depending on how you have set the Calculate setting.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  I am using the Atm Strategy method.
                  Thank you - gives me enough to do some digging. Thank you.. If I cant figure it out, I will be back. I will study before I come back.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by NullPointStrategies, Yesterday, 05:17 AM
                  0 responses
                  81 views
                  0 likes
                  Last Post NullPointStrategies  
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  149 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  79 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  52 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  59 views
                  0 likes
                  Last Post TheRealMorford  
                  Working...
                  X