Bayesian Trend Filter Pass Node
Bayesian Trend Probability Filter — Series Input
Overview
The Bayesian Trend Filter Pass Node applies the Bayesian Trend Filter algorithm to a series input. It uses a Bayesian smoothing approach (controlled by the lambda parameter) to separate the underlying trend signal from noise — computing a probability-weighted smoothed output from any numeric series.
As a Pass node, it accepts any { values, timestamps } series rather than raw OHLCV data. This allows the filter to be chained after other indicators — smoothing RSI, volume, or custom composites — making it a versatile denoising and trend extraction tool within a node graph pipeline.
Algorithm
Parameters
| Parameter | Default | Description |
|---|---|---|
| lambda | 50 | Smoothing sensitivity. Higher values produce more smoothing and slower trend tracking. |
Inputs & Outputs
| Slot | Direction | Type | Description |
|---|---|---|---|
| input | Input | { values, timestamps } | Any numeric series to filter |
| values | Output | (number | null)[] | Bayesian-smoothed values aligned to input |
| timestamps | Output | number[] | Unix timestamps aligned to input |
Use Cases
Noise-Filtered Trend Line
Apply to close price to extract a smooth trend line that reacts to large moves (genuine trend changes) while ignoring small fluctuations. The Bayesian weighting adapts the filter strength to the magnitude of each price change.
Pre-Processing for Other Nodes
Chain this node before oscillators (RSI, MACD) to pre-smooth noisy inputs. Applying RSI Pass to a Bayesian-filtered price series rather than raw price produces a more stable oscillator output with fewer whipsaws.
Regime Boundary Detection
Compare the raw input to the Bayesian-filtered output: when price diverges significantly from the filter, it signals a potential trend change or spike. Use the difference as a regime transition signal.
Tips & Best Practices
Tuning Lambda
For price series: lambda=10–30 gives responsive filtering; lambda=50–100 gives heavy smoothing close to a moving average. For indicator series (like RSI 0–100), use smaller lambda values (5–20) as the data range is compressed.
No Fixed Warm-Up
The Bayesian filter is recursive and initializes from bar 0 (smooth[0] = x[0]). There is no formal warm-up period, but the first few bars may have higher estimation uncertainty as the filter settles.
vs. Kalman Smoother
Bayesian Trend Filter and Kalman Smoother are both adaptive filters. The Bayesian approach is more robust to outliers (large spikes reduce their own influence via the likelihood term), while Kalman is optimal under Gaussian assumptions without outliers.