SWT Trend + Momentum
A complete wavelet-based trading system combining a smooth trend overlay with a directional energy momentum oscillator. Uses the Stationary Wavelet Transform (SWT/MODWT) for shift-invariant, noise-reduced trend analysis.
Overview
The SWT Trend + Momentum system provides:
- Trend Line: Wavelet-smoothed price overlay showing underlying market direction
- Momentum Oscillator: Directional energy measurement confirming trend strength
- Automated Strategy: Optional buy/sell signals with position management
Unlike traditional moving averages that lag and react to noise, the wavelet trend line separates signal from noise mathematically, providing clearer trend visualization.
How It Works
Wavelet Decomposition
- Decomposition: Price data is transformed using SWT into multiple frequency layers
- Approximation (A_J): The lowest frequency layer represents the primary trend
- Details (D_J...D_1): Higher frequency layers contain noise and short-term fluctuations
- Denoising: Optional BayesShrink filter removes statistical noise from detail layers
- Reconstruction: Final trend = A_J + optional coarsest details for responsiveness
Directional Energy Momentum
The momentum oscillator measures trend conviction using wavelet energy:
Momentum = RMS(detail_coefficients) × sign(energy_asymmetry)
- Positive (Green): Bullish energy dominates
- Negative (Red): Bearish energy dominates
- Magnitude: Strength of directional conviction
Display
Study Version
Price Chart (Overlay)
- Blue trend line on price
Momentum Panel (Below)
- Green histogram bars: Positive momentum
- Red histogram bars: Negative momentum
- Optional normalization: None, SNR, or Z-Score
Strategy Version
Same display plus:
- Entry/exit arrows on chart
- Position status in panel
Settings
Wavelet Transform
| Setting | Default | Description |
|---|---|---|
| Wavelet Type | DB4 | Wavelet family (DB4, DB6, SYM4, HAAR, etc.) |
| Decomposition Levels | 4 | Smoothness control (higher = smoother) |
| Use Denoised Signal | true | Apply BayesShrink noise reduction |
| Trend Coarse Details (k) | 1 | Lag reduction (0 = smoothest, 1-2 = more responsive) |
Momentum
| Setting | Default | Description |
|---|---|---|
| Normalization | None | None, SNR (signal-to-noise), or Z-Score |
| Momentum Threshold | 1.0 | Signal threshold (scaled by 100x internally) |
Window Settings
| Setting | Default | Description |
|---|---|---|
| Auto Window Size | true | Automatically calculate required bars |
| Auto Window Margin (γ) | 6.0 | Safety margin for auto calculation |
| Manual Window | 1024 | Manual lookback if auto disabled |
Strategy Settings (Strategy Version Only)
| Setting | Default | Description |
|---|---|---|
| Min Slope Threshold | 0.05 | Minimum price points for trend confirmation |
| Trade Lots | 1.0 | Position size multiplier |
| Enable Long/Short | Both | Directional filtering |
Usage Patterns
Trend Filter
Use the trend line slope to filter trades from other systems:
- Slope Up: Only consider long trades
- Slope Down: Only consider short trades
- Flat: Avoid trend-following strategies
Example: Only act on RSI oversold signals when the wavelet trend is sloping up.
Dynamic Support/Resistance
The trend line acts as dynamic S/R:
- Uptrend: Pullbacks find support near the trend line
- Downtrend: Rallies stall near the trend line
Momentum Confirmation
Combine trend direction with momentum strength:
| Trend | Momentum | Signal |
|---|---|---|
| Up | Strong positive | High-conviction long |
| Up | Weak/negative | Wait for confirmation |
| Down | Strong negative | High-conviction short |
| Down | Weak/positive | Wait for confirmation |
Divergence Detection
Watch for momentum divergence:
- Price makes new high, momentum doesn't → potential bearish reversal
- Price makes new low, momentum doesn't → potential bullish reversal
Tuning Guide
Trend Too Slow?
- Decrease Decomposition Levels by 1
- Increase Trend Coarse Details (k) to 1 or 2
Trend Too Choppy?
- Increase Decomposition Levels by 1
- Ensure Use Denoised Signal is enabled
- Set Trend Coarse Details (k) to 0
Recommended Starting Points
| Timeframe | Levels | k | Notes |
|---|---|---|---|
| 1-5 min | 4 | 1 | Default, balanced |
| 15-30 min | 4-5 | 1 | Slightly smoother |
| 1 hour+ | 5 | 0 | Very smooth for position trading |
Troubleshooting
Study Not Plotting
- Ensure sufficient historical data (256+ bars typically required)
- Enable Auto Window Size for automatic calculation
Poor Performance
- Stick to Auto Window sizing
- Avoid very large manual window sizes on tick charts
See Also
- Wavelet Analysis - Multi-scale diagnostic decomposition
- Wavelet ATR - Volatility-based stop placement
- VectorWave SWT Guide - Technical SWT documentation