Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Determining the current stop and target values generated by an ATM

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

    Determining the current stop and target values generated by an ATM

    I there any way to determine what the current stops and targets are from the ATM that is used in a Strategy?

    I wish to move these parameters once I am in a trade as conditions change, and need to know what the current values are.

    Rod

    #2
    I think when most people are creating an ATM inside a Strategy, the ATM itself is very simple. Just an initial stop(s) and profit target(s). There is no custom stop strategy associated with the ATM.

    Therefore, once your order is filled, you now know where your stop and targets are based upon the average fill price of your entry order. You can know use AtmStrategyChangeStopTarget() to change your stop(s) and/or targets() to what ever you want and when you want. You can use GetAtmStrategyStopTargetOrderStatus()
    to see if any of your stop(s) or targets(s) have been filled.

    Comment


      #3
      I thought that was going to be the case. The initial stop is easy to calculate and work with - the more complicated ATM features will be tough to compute.

      thanks for the reply

      Comment


        #4
        The problem is not solved, and not as simple as scjohn makes it out to be. I ran into this today myself.

        My strategy has a situation where if the ATM strategy position hasn't exited by itself after a certain time interval, then the stoploss must be moved to break-even if it is possible to do so.

        Naturally I can test whether the current price is better than the ATM's average fill price, and move the stop to break-even. That's simple.

        The trouble is, I have no way of knowing if I am moving the stop to a LESS favorable position if the ATM strategy auto-trail rules have already moved it to a more favorable position. If the stop is already better than break-even I don't want to move it. Therefore, my strategy MUST have access to the ATM's current stoploss!

        It seems ridiculous to have my strategy try to simulate the behavior of the ATM auto-trail and auto-breakeven activity just to get the current stoploss price. That's a horribly complex solution for something that should be trivial.

        Edit: GetAtmStrategyStopTargetOrderStatus() could return the current stop value as the average fill price for orders that haven't yet been filled. (Maybe it does already? I'll have to check, but I doubt it.)

        -Alex
        Last edited by anachronist; 05-14-2012, 12:42 PM.

        Comment


          #5
          I tend to agree with you....

          Comment


            #6
            I have never used GetAtmStrategyStopTargetOrderStatus() but this is probably your best bet to accomplish what you want to do. The question that needs to be answered is what value shows up in "Average Fill price" during the various Order states. You need to determine what the "average fill" price is when the Order state is 'Accepted' or 'working'.

            The Example given for GetAtmStrategyStopTargetOrderStatus() in the docs should allow you to monitor the action of the stop(s) and see if "Average fill" reflects what is happening on the chart.

            Comment


              #7
              I agree. Absent a reply from NT support, I guess I'll have to run a test that creates an ATM strategy that couldn't possibly get filled, and print the average fill price to the output window. If it prints the current stop or target price, then all is well. Otherwise I still have a problem. I'll do that later this week and report the results here.

              -Alex
              Last edited by anachronist; 05-15-2012, 09:02 AM.

              Comment


                #8
                anachronist,

                Typically, if the discussion is between individuals we don't get involved. If you would like me to answer any questions, I would be happy to. Please outline them for me and I will do my best to answer.
                Adam P.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks AdamP. If you happen to know the answer, the question is:

                  Does GetAtmStrategyStopTargetOrderStatus() return anything meaningful for the average fill price if the exit order is still in a "Working" state, not yet filled?

                  The preference would be for this field to return the current stop or limit price. That way a strategy can determine if the ATM strategy has moved the stoploss.

                  Regardless of that preference, the documentation should include a description of the behavior.

                  -Alex

                  Comment


                    #10
                    anachronist,

                    The GetAtmStrategyStopTargetOrderStatus() should return the price of the stop loss or profit target unique by order name, e.g. calling with "STOP1" returns the STOP1 price, etc. The only time it would be an average price of two orders is if "STOP1" was partially filled or something. I will mention to the proper people about clarifying in the help guide.

                    Please let me know if I may assist further.
                    Adam P.NinjaTrader Customer Service

                    Comment


                      #11
                      Thanks! That answers the question that started this thread.
                      -Alex

                      Comment


                        #12
                        Just create ATM strategy that uses your Stop(s) setting but without any Profit Target(s). Then monitor the Print statements associated with the GetAtmStrategyStopTargetOrderStatus() in the Output window when running your strategy.

                        Comment


                          #13
                          Yup, that's what I was planning to do, but I think now that NT support has answered, it won't be necessary.
                          -A

                          Comment


                            #14
                            I wasn't confident in my ability to code this situation correctly, so my work-around was to open a second chart with the same instrument and engage the Chart Trader. When the Atm is triggered from the Strategy, the usual atm chart trader flags show up on the second chart. It's not very elegant,but it gets the job done if I understand this discussion.

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                            0 responses
                            656 views
                            0 likes
                            Last Post Geovanny Suaza  
                            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                            0 responses
                            371 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
                            574 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by RFrosty, 01-28-2026, 06:49 PM
                            0 responses
                            579 views
                            1 like
                            Last Post RFrosty
                            by RFrosty
                             
                            Working...
                            X