TradingView
anieri
14 mag 2019 03:41

Savitzky-Golay Smoothing Filter 

IRB(RE) ON NMB3

Descrizione

The Savitzky-Golay Filter is a polynomial smoothing filter.
This version implements 3rd degree polynomials using coefficients from Savitzky and Golay's table, specifically the coefficients for a 5-, 7-, 9-, 15- and 25-point window moving averages.
The filters are offset to the left by the number of coefficients (n-1)/2 so it smooths on top of the actual curve.
You can turn off some of the smoothing curves, as it can get cluttered displaying all at once.
Any feedback is very welcome.

Note di rilascio

Savitzky-Golay digital filter, useful for smoothing data.
This script implements the 5-, 7-, 9-, 15-, and 25-point window 3rd degree polynomial fit coefficients.
The plots are offset by (n-1)/2 where n is the window size, so it fits the original data.
Any feedback is welcome.
Commenti
interestratearb_
you peckerhead, why are you offsetting a filter!? You got me all exited for nothing >:(
RicardoSantos
what you think of multi staging this filter for noise reduction, i tried something with it, but never got around to do much with it and ended up forgotten.
tradingview.com/script/6RZ4xY7X-Function-Savitzky-Golay-Filter-with-7-Vectors-V0/
anieri
@RicardoSantos, I've found it very useful to apply it more than once to the same input, although I do not fully understand the consequences of doing so.
One of the nicest uses was to further smooth a simple moving average (which is not far from the savitzky-golay filter): when you take, for example, a derivative of the smoothed SMA, you get much nicer results.
RicardoSantos
@anieri, ok, thank you for the reply
Altro