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

Avg True Range



PureBytes Links

Trading Reference Links

To calc the ATR for Data 2 in an intra-day chart I have this code - which is
really end of day code .. what changes do I make to correct it for intraday
time frames?

Input:Len(Numericsimple);
Vars:TrueHiD2(0),TruLoD2(0),TruRangeD2(0);

if Close[1] of data2> High of data2 then
	TrueHiD2 = Close[1] of data2
else
	TrueHiD2 = High of data2 ;

if Close[1] of data2 < Low of data2 then 
	TruLoD2 = Close[1] of data2 
else
	TruLoD2 = Low of data2 ;

TruRangeD2=TrueHiD2-TruLoD2;


ATRD2 = Average( TruRangeD2, Len) ;

CE
Thx in advance