The Gaussian Filter is a convolution: each value is a weighted sum of the current price and the prices before it, with weights taken from a Gaussian bell curve. The kernel has 2 * ceil(3 * Sigma) + 1 taps, the weights fall off as exp(-x^2 / (2 * Sigma^2)) from the centre tap, and they are scaled to add up to one.
The taps are laid against the bars counting back from the current one, so the current bar takes the first tap and the oldest bar in the window takes the last. Because the curve is symmetric, the newest and oldest bars get the smallest weights and the bars in the middle of the window get the most.
On early bars, where the full window is not yet available, only the existing taps are used and the sum is divided by the weight actually used, so the filter answers from the first bar.
How to read Gaussian Filter (GAUSS)
Read the line as a smooth version of price centred some bars in the past. Its slope gives the trend direction and its turns mark swings at the scale of Sigma. Because the heaviest weights sit in the middle of the window, the line lags by about half the window, roughly 3 * Sigma bars.
A small Sigma gives a short window that follows price closely; a large one gives a wide, very smooth line that turns late. The bell shape avoids the jumps a simple moving average shows when a big bar enters or leaves its window.
Settings
- Sigma
- The width of the Gaussian kernel. Larger values use more bars, smooth harder and lag more.
- Source
- The price series the filter averages, the close by default.
Frequently asked questions
How many bars does the filter use?
2 * ceil(3 * Sigma) + 1. At the default Sigma of 1 that is 7 bars; at 1.5 it is 11.
Why does the line lag about half the window?
The kernel is a symmetric bell laid over the window, so the most weight falls on the middle bars, not on the newest one.
Why does it start on the first bar?
Early bars use only the taps that have a bar under them and divide by those weights, so a value exists from the very first bar.
