MT4 ATR indicator replication. Please Help!

 

Hello, 


I would like to replicate MT 4 ATR value in the other platform.. but it's not easy to do


AFAIK,   ATR[i] = ATR[i-1] + ( TR[i] - TR[i-n] ) / n; // n is the ATR period  is the formula. 

I do not understand that there are two different figures, i and n. If I want to calculate ATR for 20 candles, wouldn't this be


ATR[20] = ATR[20 - 1] + (TR[20] - TR[20-20]) / 20. So is it an ATR indicator based upon other ATR?? 


If there is no ATR calculated before, how can I place an ATR[20 -1]? 


What am I missing? Please help!

This website uses cookies. Learn more about our Cookies Policy.