Attachments forums

List of attachments posted on this forum.


All files on forums: 161139

Re: MT5 Moving Averages (MAs)

AlgoAlex811, Mon Apr 07, 2025 10:37 pm

Adaptive Gaussian Moving Average

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)
Standard Deviation Calculation:

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)
Weights are higher for values closer to the current bar


Price Range:

Finds the highest high and lowest low over varying lookback periods
Combines these values and applies the Gaussian weighting
All files in topic