"ATR(int TimePeriod): var
Average True Range. A measure of price volatility; useful for calculating stop loss or profit target distances. Formula: ATR = (ATR1 * (TimePeriod-1) + max(High,Close)-min(Low,Close)) / TimePeriod, where ATR1 is the ATR from the last bar. Uses the current asset prices. The function internally creates series when TimeFrame is > 1, and must then be called in a fixed order in the script."