Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,484 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
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: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
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