• 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

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 onevefiefe, Today, 07:42 AM
0 responses
2 views
0 likes
Last Post onevefiefe  
Started by J_o_s, Today, 06:09 AM
0 responses
6 views
0 likes
Last Post J_o_s
by J_o_s
 
Started by jeronymite, 03-23-2020, 12:27 AM
3 responses
34 views
0 likes
Last Post leontancfa  
Started by asmmbillah, Today, 04:53 AM
0 responses
5 views
0 likes
Last Post asmmbillah  
Started by davidnorton, Today, 04:29 AM
0 responses
2 views
0 likes
Last Post davidnorton  
Working...
X