After checking the built in ATR study with 2 or 3 different efs studies I have found that the built in study differs on every bar and on every time period using matching study periods. All the efs studies I have used match each other and use the following formula:-
True Range for each bar :-
TodayRange = (high()- low());
nTdHYsC = Math.abs(high() - close9-1));
nTdLYsC = Math.abs(low() - close(-1));
nTR = Math.max(nTodayRange, Math.max( nTdHYsC, nTdLYsC))
Initial ATR = Simple Moving Average of the first nPeriod Bars
2nd ATR and onwards based on Wilders Average:-
(((Previous ATR*(nPeriod-1))+nTR)/nPeriod)
Has anyone got any idea why the built in ATR differs and how is it calculated if not based on the above formula.
I have also checked the built in ATR against other averaging methods such as a Simple and Exponential Moving Average still with no correlation.
Robert
True Range for each bar :-
TodayRange = (high()- low());
nTdHYsC = Math.abs(high() - close9-1));
nTdLYsC = Math.abs(low() - close(-1));
nTR = Math.max(nTodayRange, Math.max( nTdHYsC, nTdLYsC))
Initial ATR = Simple Moving Average of the first nPeriod Bars
2nd ATR and onwards based on Wilders Average:-
(((Previous ATR*(nPeriod-1))+nTR)/nPeriod)
Has anyone got any idea why the built in ATR differs and how is it calculated if not based on the above formula.
I have also checked the built in ATR against other averaging methods such as a Simple and Exponential Moving Average still with no correlation.
Robert
Comment