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
<http://stockcharts.com/school/doku.php?id=chart_school:technical_indica\
tors:average_true_range_atr>  , 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

Reply via email to