I was studying Average True Range indicator that I realized the calculation used in standard MT4 indicator is different than original formula. The calculation of ATR in MT4 is based on following formula:
But the original formula as described in the book
New Concepts in Technical Trading Systems is:
many of implemented indicators are different compared to original.
in case of Wilders indicator, one of the reason would be optimization: Welles was calculating practically everything manually, so he was optimising calculations in favour of calculation speed on the cost of precision.
ATR[i] = ATR[i-1] + ( TR[i] - TR[i-n] ) / n; // n is the ATR period
ATR[i] = ( ATR[i-1] * (n-1) + TR[i] ) / n; // n is the ATR period
ATR[i] = ATR[i-1] + (TR[i] - ATR[i-1]) / n; // n is the ATR period
ATR[i] = ATR[i-1] + (TR[i] - ATR[i-1] ) * 2/(N+1);
To add comments, please log in or register