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 jaybedreamin, Today, 05:56 PM
      0 responses
      3 views
      0 likes
      Last Post jaybedreamin  
      Started by DJ888, 04-16-2024, 06:09 PM
      6 responses
      18 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Jon17, Today, 04:33 PM
      0 responses
      1 view
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      6 views
      0 likes
      Last Post Javierw.ok  
      Started by timmbbo, Today, 08:59 AM
      2 responses
      10 views
      0 likes
      Last Post bltdavid  
      Working...
      X