atr = ta.atr(60) normalized_atr = (atr - ta.lowest(atr, 60)) / ((ta.highest(atr, 60)) - ta.lowest(atr, 60)) smoothed_normalized_atr = ta.wma(normalized_atr, 13) WHERE ta.WMA uses the below calculation. PLEASE ONLY USE THIS CALCULATION FOR WMA pine_wma(x, y) => norm = 0.0 sum = 0.0 for i = 0 to y - 1 weight = (y - i) * y norm := norm + weight sum := sum + x[i] * weight sum / norm