Is ATR being calculated correctly?

Posted By: swingtraderkk

Is ATR being calculated correctly? - 12/03/13 11:39

Hi jcl,

The manual states that:

Quote:
True Range (TR); max(High,Close)-min(Low,Close) of the current asset price series. See also ATR, ATRS.


I always understood the above formula as simply the range, the true range tries to incorporate opening gaps by comparing to the previous close.

Should the formula not be max(high[0],close[1]) - min(low[0],close[-1]) ?

If it is, then the manual needs to be updated to reflect this on the true range and ATRS entries.
Posted By: jcl

Re: Is ATR being calculated correctly? - 12/03/13 11:55

I admit that I do not know. All classic TA functions as well as their descriptions are from the standard technical indicator library, the TA-Lib that is used by most trading platforms. But I believe that the description is correct, because using close[-1] would peek into the future and thus make no sense. You can easily test this by comparing the TR return value with max(high[0],close[0]) - min(low[0],close[0]).
Posted By: swingtraderkk

Re: Is ATR being calculated correctly? - 12/03/13 12:16

Apologies for the typo, there should be no peek the comparison is with close[1].

Yes it is calculating correctly, so the manual only needs correcting.
Posted By: jcl

Re: Is ATR being calculated correctly? - 12/04/13 08:25

Thanks - will do.
Posted By: byakuren81

Re: Is ATR being calculated correctly? - 01/23/14 14:18

The true range takes the close of the day before into account and not the current close, and is defined as the maximum of :
(current High - current Low)
(current High - previous Close)
(current Low - previous Close) in absolute value
It is another way of measuring the volatility of a market without having an average dependence (or drift dependence) like in the variance calculation. It can be seen as an instantaneous volatility and taking into account the previous close is very important in case an opening jump has occured, this jump has created some volatility even if the intraday variation are very small.
So if I understand the true range in zorro is not calculated like that ?
Posted By: swingtraderkk

Re: Is ATR being calculated correctly? - 01/23/14 22:43

byakuren81,

it calculates correctly:

max(high[0],close[1]) - min(low[0],close[1])

the manual was misleading.
Posted By: byakuren81

Re: Is ATR being calculated correctly? - 01/24/14 15:50

yep indeed thx
© 2024 lite-C Forums