Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AbrahamR), 717 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Is ATR being calculated correctly? #433592
12/03/13 11:39
12/03/13 11:39
Joined: May 2013
Posts: 245
S
swingtraderkk Offline OP
Member
swingtraderkk  Offline OP
Member
S

Joined: May 2013
Posts: 245
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.

Last edited by swingtraderkk; 12/03/13 11:46.
Re: Is ATR being calculated correctly? [Re: swingtraderkk] #433596
12/03/13 11:55
12/03/13 11:55
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
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]).

Re: Is ATR being calculated correctly? [Re: jcl] #433599
12/03/13 12:16
12/03/13 12:16
Joined: May 2013
Posts: 245
S
swingtraderkk Offline OP
Member
swingtraderkk  Offline OP
Member
S

Joined: May 2013
Posts: 245
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.

Last edited by swingtraderkk; 12/03/13 12:54.
Re: Is ATR being calculated correctly? [Re: swingtraderkk] #433663
12/04/13 08:25
12/04/13 08:25
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Thanks - will do.

Re: Is ATR being calculated correctly? [Re: jcl] #436324
01/23/14 14:18
01/23/14 14:18
Joined: Jan 2014
Posts: 86
London City
B
byakuren81 Offline
Junior Member
byakuren81  Offline
Junior Member
B

Joined: Jan 2014
Posts: 86
London City
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 ?

Re: Is ATR being calculated correctly? [Re: byakuren81] #436354
01/23/14 22:43
01/23/14 22:43
Joined: May 2013
Posts: 245
S
swingtraderkk Offline OP
Member
swingtraderkk  Offline OP
Member
S

Joined: May 2013
Posts: 245
byakuren81,

it calculates correctly:

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

the manual was misleading.

Re: Is ATR being calculated correctly? [Re: swingtraderkk] #436385
01/24/14 15:50
01/24/14 15:50
Joined: Jan 2014
Posts: 86
London City
B
byakuren81 Offline
Junior Member
byakuren81  Offline
Junior Member
B

Joined: Jan 2014
Posts: 86
London City
yep indeed thx


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1