[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help with average true range, atr(p) != ma(tr, p) ?



PureBytes Links

Trading Reference Links



Dear trader !
I like to build a modified version of atr(), but before this, I want to be 
sure that I have the correct formula for average true range. The following 
code:
graphXspace = 2; barNb = 14;Cy= ref(C, 
-1); // Close of yesterdaytr = max(H-L, max( abs(Cy-L), abs(Cy-H) ));// 
True Rangegraph0 = atr(barNb); graph1 = ma(tr, barNb);
show AmiBroker atr() in graph0 and a AFL recalculation in graph1 !. The 2 
graph doesn't superimpose, can someone tell me if my formula is wrong ? or there 
is a problem with the AFL atr() function ?
Thanks for any help !
Jon