Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Quad), 509 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[Zorro] Possible bug in ATRS in include.c #445505
09/11/14 21:22
09/11/14 21:22
Joined: Nov 2013
Posts: 123
Mithrandir77 Offline OP
Member
Mithrandir77  Offline OP
Member

Joined: Nov 2013
Posts: 123
I was digging in indicators.c when I spotted a possibly error in the implementation of the ATRS indicator:

Code:
// Simple ATR based on SMA
var ATRS(int Period)
{
	Period = max(1,Period);
	var vATRS =  0;
	for(g_count = 0; g_count < Period; g_count++)
		vATRS = priceHigh(g_count)-priceLow(g_count);
	return vATRS/Period;
}



Shouldn't it be inside the for

Code:
vATRS += priceHigh(g_count)-priceLow(g_count);



? because in the present version it is not adding up the ATR ranges, only the last one is returned.

Re: [Zorro] Possible bug in ATRS in include.c [Re: Mithrandir77] #445515
09/12/14 08:22
09/12/14 08:22
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Thanks, this was indeed a bug and will be fixed in the next release.

Workaround: Copy the ATRS code in your script, rename the function to "ATRS_Fixed", and replace the = with a += in the for loop.


Moderated by  jcl, Nems, Spirit, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1