Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Days to load / ATR indicator

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

  • Harry
    replied
    Originally posted by fLife View Post
    Thanks. Did not know that.
    So generally speaking, any given indicator shows VALUES with 20 days of delay (considering I would use daily chart)?

    And I would like to ask about EMA - I want to know EMA for last 5 days on daily chart, does it mean it is not accurate/possible, since first 20 bars are not calculated?

    There are basically two types of moving averages

    - FIR (finite impulse response) filters
    - IIIR (infinite impulse response) filters

    The value of a finite impulse reponse (FIR) filter only depends on a finite - limited - number of bars. An example for a FIR filter is the SMA. A SMA(20) just averages the last 20 bars, therefore it does not depend from the closing price 21 bars ago.

    The value of an infinite impulse response (IIR) filter depends on an infinite number of bars. An IIR filter has a recursive element in its formula. An example for a IIR filter is the EMA. Each value for the EMA is calculated as a weighted average of its previous value and the last closing price. Therefore an EMA(20) depends on all closing prices over the lookback value of the chart. In particular it also depends on the closing price 20 bars, 60 bars or 90 bars ago. However, a the dependance of an EMA(20) on the price 90 bars ago is pretty small. As a rule of thumb you may consider that an EMA(20) is accurate, if the lookback period of your chart exceeds the period of the EMA by a factor 3 to 4. You should be fine with 80 bars for an EMA(20).

    The behaviour of the EMA relative of the SMA suggests that you should not use an exponential moving average of the true range, but a simple moving average of the true range. Instead of ATR(N) you may use a SMA(TR, 2*N-1), where TR is the true range and 2N-1 is the period to be used with the SMA. The conversion is necessary, because Wilder used a special vesion of the EMA called Wilder's average, which has a different smoothing factor.

    For example if you have an ATR(14), you can replace it with a SMA(TR, 27). The values of the SMA(TR, 27) only depend on the last 27 bars, as it behaves as a FIR filter. NinjaTrader does not have a true range indicator, but you can use the ATR and set the period to 1. Therefore you can replace the ATR(14) indicator with SMA(ATR(1), 27).
    Last edited by Harry; 08-22-2014, 04:44 AM.

    Leave a comment:


  • NinjaTrader_Jason
    replied
    Yes, it applies to any bar type. If you scroll back to the beginning of the chart, you will always see no indicators values for the first 20 price bars.

    The 'Maximum bars look back' setting is related as well. If set to TwoHundredFiftySix, it will produce the same indicator values if the amount of bars exceed 256. If the chart has less than 256 price bars, you can see differences.

    It is accurate once enough price bars are loaded in the chart. If you like no indicator changes, I recommend to always load more than 256 price bars in your charts (providing 'Maximum bars look back' is set to TwoHundredFiftySix).

    Leave a comment:


  • fLife
    replied
    Thanks. Did not know that.
    So generally speaking, any given indicator shows VALUES with 20 days of delay (considering I would use daily chart)?

    And I would like to ask about EMA - I want to know EMA for last 5 days on daily chart, does it mean it is not accurate/possible, since first 20 bars are not calculated?

    Leave a comment:


  • NinjaTrader_Jason
    replied
    Hello fLife,

    This is because indicators are not calculated on the first 20 bars. If you create a daily chart with 30 days, you will see the indicator only plotted on the last 10 days. If you now increase the amount of historical data to 50, you will see the indicator calculated on more days.

    The EMA plots an exponential moving average, so it applies more weight to recent prices compared to the SMA.

    Leave a comment:


  • fLife
    started a topic Days to load / ATR indicator

    Days to load / ATR indicator

    Hi I noticed very interresting phenomenon.

    I was crunching several parameters of ATR for statistics purposes (example: ATR values for last 14/30/60 days on 1/5/15/30 min timeframe; ES)

    Of course I set adequate value for "Days to load" (30 days to load for ATR of last 30 days ; 14 days to load for ATR of last 14 days, etc.).
    HOWEVER - I see that ATR of last 30 days on 30 minute timeframe changes with the number of days to load - it is different when I load 30 days, different when I load 60; 90; 120 and so on. How is that even possible?

    First of all it would make its relevance pretty insignificant if not irrelevant at all. ATR is supposed to load values for last X days. So it should not make any difference whether it has 60 or 120 days loaded, since it calculates last 30 days anyway.

    Speaking of this issue, how about indicator such as EMA which also calculates on day results? How relevant are those?

    Thank you for any response.

Latest Posts

Collapse

Topics Statistics Last Post
Started by Stanfillirenfro, Yesterday, 09:19 AM
7 responses
51 views
0 likes
Last Post NinjaTrader_Gaby  
Started by TraderCro, 04-12-2024, 11:36 AM
4 responses
70 views
0 likes
Last Post Mindset
by Mindset
 
Started by Mindset, Yesterday, 02:04 AM
1 response
15 views
0 likes
Last Post Mindset
by Mindset
 
Started by agclub, 04-21-2024, 08:57 PM
4 responses
18 views
0 likes
Last Post NinjaTrader_Gaby  
Started by Irukandji, Today, 04:58 AM
0 responses
6 views
0 likes
Last Post Irukandji  
Working...
X