Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

ATR Calculation

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

    ATR Calculation

    Hi

    Somehow I am stuck with understanding how the ATR is calculated. I understand the formula and the code, but somehow I get different results.
    I have this data: (Date, Open, High, Low, Close)
    15.10.2012 1428.75 1441.31 1427.24 1440.13 16.10.2012 1440.31 1455.51 1440.31 1454.92 17.10.2012 1454.22 1462.2 1453.35 1460.91 18.10.2012 1460.94 1464.02 1452.63 1457.34
    When I calculate ATR(1) with NT I get these values:
    15.10.2012: 14.07
    16.10.2012: 15.38
    17.10.2012: 8.85
    18.10.2012: 11.39
    They are correct.
    When I calcluate ATR(2) with NT I get these values:
    17.10.2012: 11.57
    18.10.2012: 11.48

    To my understanding this should be the average of 2 ATR. But it is not. The average would be 12.12 and 10.12

    thanks for your feedback
    Do I overlook something

    #2
    Hello Beauregard,
    The SMA is calculated as the (current value + last average value)/2. You can calculating it as current value + previous value)/2.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Joydeep View Post
      Hello Beauregard,
      The SMA is calculated as the (current value + last average value)/2. You can calculating it as current value + previous value)/2.
      Edited 17.11:
      Ok, I see what was misleading to me. The definition in the help section it is written that ATR is a moving average, which I assumed to be a simple moving average. In fact it is an exponential one
      Last edited by Beauregard; 11-17-2012, 08:57 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by kaywai, 09-01-2023, 08:44 PM
      5 responses
      602 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by xiinteractive, 04-09-2024, 08:08 AM
      6 responses
      22 views
      0 likes
      Last Post xiinteractive  
      Started by Pattontje, Yesterday, 02:10 PM
      2 responses
      20 views
      0 likes
      Last Post Pattontje  
      Started by flybuzz, 04-21-2024, 04:07 PM
      17 responses
      230 views
      0 likes
      Last Post TradingLoss  
      Started by agclub, 04-21-2024, 08:57 PM
      3 responses
      17 views
      0 likes
      Last Post TradingLoss  
      Working...
      X