• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Average True Range (ATR) calculation

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

    Average True Range (ATR) calculation

    Hello. I didn't pay attention to ATR indicator results, before saw other result for the same instrument and period. Can anybody explain why ATR with 14 periods back shows 26.72 in ES 12-15 EOD 30.10.2015?! I even calculate the same in Excel and get 21.92.

    #2
    Hello alexstox,

    Thanks for your post.

    I applied the ATR indicator, set to a period of 14, set to CalculateOnBarClose = false, using Kinetic End of day data, on ES 12-15. The ATR value on 10-30-2015 is as you show 26.72.

    Can you clarify how you calculated the ATR at 21.92?
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Here is Excel file calculation
      ATR ES 12-15 Last.zip

      Comment


        #4
        Hello alexstox,

        Thanks for your reply.

        I have been able to confirm that your true range values match what is produced in Ninjatrader. However to complete the calculations for the ATR you would need to:

        ((period -1) * Value[1] + true range) / period

        Where period in this case is 14 and Value[1] is the prior ATR value and true range is this periods true range.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by alexstox View Post
          Here is Excel file calculation
          [ATTACH]35544[/ATTACH]
          Your Excel file is calculating based on an SMA: NT calculates based on an EMA. (More specifically, the Wilder's Moving Average).
          Last edited by koganam; 11-02-2015, 01:48 PM.

          Comment


            #6
            Originally posted by NinjaTrader_Paul View Post
            Hello alexstox,

            Thanks for your reply.

            I have been able to confirm that your true range values match what is produced in Ninjatrader. However to complete the calculations for the ATR you would need to:

            ((period -1) * Value[1] + true range) / period

            Where period in this case is 14 and Value[1] is the prior ATR value and true range is this periods true range.
            Still can't get NT value =)))
            ATR ES 12-15 Last.zip

            Comment


              #7
              Hello alexstox,

              Thanks for your reply.

              The forumla in the spreadsheet is not correct and it is important to make sure that you start with the previous ATR value (which is based on the previous 14 ATRs).

              Starting with row 3, the true range value is 19.25 and the previous ATR value needs to be 34.94518. Period is 14 so the formula, for row 3, needs to be:

              ATR = (Period -1 * previous ATR + true range) / Period

              ATR = (13 * 34.94518 + 19.25) / 14

              ATR for row 3 = 33.8241

              When you extend that to the last row of your spreadsheet, the ATR value is 26.72354 which matches the ATR on the chart.
              Paul H.NinjaTrader Customer Service

              Comment


                #8
                Let us look a bit at the history of technical analysis.

                The average true range was created by Welles Wilder. I have read his wonderful book "New Concepts in Technical Trading Systems" from 1978. At that time there were no PCs available. The book shows manually drawn charts on graph paper. All the indicator values had to be calculated by hand every day.

                If you have to calculate indicator values by hand, you will soon find out that an EMA is much easier to calculate compared to a SMA. You just need to enter two values, yesterday's indicator value and today's price and then calculate the new indicator value.

                NinjaTrader's implementation of the ATR follows Wilder's concept. This means that the ATR is calculated as Wilder's average of the true range - and not as a regular EMA of the true range. The EMA formula which is in use today was only suggested by Jack K. Hutson in 1984 (cmp. March 1984 issue of "Stocks & Commodities"). The main difference is the relationship between the indicator period N and the smoothing constant. If you select a period N, Wilder uses a smoothing constant of 1/N, while Hutson (and all modern charting programs) use a smoothing constant of 2/(N+1) for calculating the EMA.

                For example if you select a period K for the average true range, you will find

                ATR(K) = EMA(TR, 2*K-1)

                This can be easily shown with a NinjaTrader chart, see chart attached. The True Range itself is not available as a NinjaTrader indicator, but you can substitute TR = ATR(1).

                Now there are many charting packages that do not follow the original idea of Wilder Welles, but they suggest to use a formula where

                Average True Range = SMA(TR, 2*K-1)

                Of course this is possible, as you can use different averages for smoothing the true range. Both concepts have an advantage and an inconvenient.

                Simple smoothing: If the lookback period is 14, you only need 14 bars to calculate the exact value. Large bars dropping out of the calculation at the other end have a significant impact on the indicator value.

                Exponential smoothing: The exponentially smoothed ATR is a IIR filter which means that the current value is influenced by all prior values of the True Range. In practice this will require 3 times as many bars for an accurate calculation, before you get the exact value.

                Again, NinjaTrader uses exponential smoothing in line with the original concept developed by Welles Wilder, and AFAIK everything is correct.
                Attached Files

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NinjaCustomer, Today, 10:06 AM
                0 responses
                2 views
                0 likes
                Last Post NinjaCustomer  
                Started by crabman777, Today, 09:52 AM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by Arkadiy_B, Today, 06:43 AM
                0 responses
                2 views
                0 likes
                Last Post Arkadiy_B  
                Started by leontancfa, Today, 06:09 AM
                1 response
                10 views
                0 likes
                Last Post NinjaTrader_PatrickG  
                Started by soulfx, 12-01-2017, 08:44 AM
                3 responses
                1,020 views
                0 likes
                Last Post NinjaTrader_EricB  
                Working...
                X