This filter breaks the price into a coarse approximation plus several layers of detail, using a causal undecimated wavelet transform built from two-tap averages. Level 1 averages this bar with the previous bar; level 2 averages that result with its value 2 bars back; level 3 uses 4 bars back, and so on, doubling each time up to 128 bars at level 8. At every level the detail is what the averaging removed.
The noise level is estimated from the finest detail: the mean absolute level 1 detail over the last 2^levels bars, divided by 0.6745. The threshold is that estimate times sqrt(2 * ln(2^levels)), times the Threshold Multiplier. Each detail is then soft thresholded: a detail smaller than the threshold is dropped, and a larger one is shrunk toward zero by the threshold.
The output is the approximation at the chosen level plus all the shrunk details. Large, persistent moves survive almost untouched, while small, short-lived wiggles are removed. A multiplier of 0 removes nothing and returns the price itself.
How to read Wavelet Denoising Filter (WAVELET)
Read the line as price with its small, noisy moves taken out. In a quiet market it flattens into steps; when price makes a decisive move larger than the noise threshold, the line follows it closely. A change of direction in the line is a move the filter judged larger than noise.
More levels and a higher multiplier give a smoother line that reacts later. The filter only uses bars that have closed, so it does not repaint, but it is a description of recent price rather than a forecast.
Settings
- Decomposition Levels
- How many layers of detail the price is split into. Each level doubles the span of the coarsest average, and the noise window is 2 to the power of this number.
- Threshold Multiplier
- Scales the noise threshold. 0 keeps every detail and returns the price; higher values remove larger moves as noise.
- Source
- The price series the filter cleans, the close by default.
Frequently asked questions
Why does the line sometimes look like steps?
When every detail is smaller than the threshold, only the coarse approximation remains, and it moves slowly. A larger move pushes a detail past the threshold and the line jumps to follow.
What does a Threshold Multiplier of 0 do?
The threshold becomes zero, so no detail is shrunk, and the approximation plus all details rebuilds the source exactly.
How far back does it look?
The coarsest level reaches back up to 2 to the power of the level setting, and the noise estimate uses the same number of bars.
