OPEN-SOURCE SCRIPT
Güncellendi

Chebyshev-Gauss Moving Average

55
This indicator applies the principles of Chebyshev-Gauss Quadrature to create a novel type of moving average. Inspired by reading https://rohangautam.github.io/blog/chebyshev_gauss/

What is Chebyshev-Gauss Quadrature?
It's a numerical method to approximate the integral of a function f(x) that is weighted by
Pine Script®
1/sqrt(1-x^2)
over the interval [-1, 1]. The approximation is a simple sum:
Pine Script®
∫ f(x)/sqrt(1-x^2) dx ≈ (π/n) * Σ f(xᵢ)
where xᵢ are special points called Chebyshev nodes.

How is this applied to a Moving Average?
A moving average can be seen as the "mean value" of the price over a lookback window. The mean value of a function with the Chebyshev weight is calculated as:

Pine Script®
Mean = [∫ f(x)*w(x) dx] / [∫ w(x) dx]


The math simplifies beautifully, resulting in the mean being the simple arithmetic average of the function evaluated at the Chebyshev nodes:

Pine Script®
Mean = (1/n) * Σ f(xᵢ)


What's unique about this MA?
The Chebyshev nodes xᵢ are not evenly spaced. They are clustered towards the ends of the interval [-1, 1]. We map this interval to our lookback period. This means the moving average samples prices more intensely from the beginning and the end of the lookback window, and less intensely from the middle. This gives it a unique character, responding quickly to recent changes while also having a long "memory" of the start of the trend.
Sürüm Notları
Updated to use library

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.