https://it.tradingview.com/script/th7NZ ... g-Average/
The original indicator calculates a Gaussian Moving Average with adaptive parameters based on market volatility.
All the original parameters are preserved:
- Length: The lookback period for the moving average (default: 14)
- Adaptive: Toggle to use adaptive standard deviation (default: true)
- VolatilityPeriod: Period for volatility calculation (default: 20)
- CustomSigma: Fixed standard deviation value when not adaptive (default: 1.0)
When adaptive is enabled, calculates the standard deviation of closing prices over the volatility period
Otherwise uses the custom sigma value
Gaussian Weighting:
Implements the same Gaussian weight formula:
Code: Select all
exp(-((i-(length-1))/(2*sigma))²/2)Price Range:
Finds the highest high and lowest low over varying lookback periods
Combines these values and applies the Gaussian weighting