PureBytes Links
Trading Reference Links
|
Hello,
the ATR uses Wilders smoothing while you used simple smoothing. Here is the
code that matches the build-in calculation.
TrueRange = Max( H - L, Max( abs( H - Ref( C, -1 ) ), abs( L - Ref( C, -1 )
) ) );
myATR = Wilders(TrueRange, 3);
Plot(myATR, "myATR", colorBlue, 1);
Thomas
www.PatternExplorer.com
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
Of tomeklutel
Sent: Friday, December 05, 2008 10:01 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] ATR formula in AmiBroker
Hi,
I'm trying to write my own ATR to work exactly like AmiBroker ATR (for
further implementation of weights). I attempted to apply formula from here ,
unfortunately it returns different results and performs worse than AmiBroker
implementation in BackTester. Could you help me with that ? This is what I
have so far:
amiATR=ATR(3);
myATR = (
Ref(Max(H-L,Max(abs(H-Ref(C,-1)),abs(L-Ref(C,-1)))),0) +
Ref(Max(H-L,Max(abs(H-Ref(C,-1)),abs(L-Ref(C,-1)))),-1) +
Ref(Max(H-L,Max(abs(H-Ref(C,-1)),abs(L-Ref(C,-1)))),-2)
) / 3;
Plot(amiATR,"AmiBroker ATR",colorBlack);
Plot(myATR ,"my ATR",colorRed)
Regards,
Tomek
------------------------------------
**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
*********************
TO GET TECHNICAL SUPPORT from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
*********************
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
*********************************
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|