OPEN-SOURCE SCRIPT
Updated Wavelet Energy Oscillator

Wavelet Energy Oscillator
What it does
The Wavelet Energy Oscillator decomposes price into three cycle bands at once — fast, mid and slow — and shows two things together: a single composite momentum line (in σ units) and a live energy spectrum telling you which band currently drives the market.
Why this is different (and original)
Cycle and dominant-period tools lock onto one period and follow it. The problem is that markets hand control between timescales: a fast, choppy regime gives way to a slower swing, and a single-period reading only turns after that has happened. By running a bank of band-pass filters in parallel and measuring the energy in each band, this oscillator shows the whole spectrum simultaneously — so a fast band losing energy to a slow band is visible as an early footprint of a regime change. Presenting the live energy split next to a dominant-band-coloured composite, with a built-in edge test, is what makes it original.
How it works
Three band-pass filters (recursive, near-orthogonal) are centred on the fast, mid and slow periods you choose.
Each band's energy is its smoothed squared output. The three energies are normalized to percentage shares so the dashboard reads as a live spectrum.
The composite is the summed band output, z-scored over the normalization window into the σ oscillator and coloured by whichever band currently dominates.
How to use it
Read the spectrum first. Fast share dominant → short, choppy moves; slow share dominant → a longer swing is in control; a shift between them flags a changing regime.
Composite zero-crosses (triangles) time the swing in the dominant band; the σ bands (red top, green bottom) flag stretched readings.
The line's colour tells you which timeframe is driving at a glance.
Read the EDGE row. The harness checks whether composite crosses preceded a favourable ≥ k×ATR move within the horizon, versus the unconditional Base %. EDGE = Hit − Base.
Settings guide
01 · Cycle Bands — source, the three centre periods, bandwidth (narrow = sharper/ringier, wide = smoother), energy smoothing, universal price source.
02 · Normalization — z-score window, output smoothing.
03 · Calibration — horizon, favourable-move threshold (×ATR), base-rate window.
04 · Bands — swing and extreme σ bands.
05 · Display & Theme — visual style, regime tint, dashboard, and per-band + band-zone colors.
Non-repaint
All filters are recursive and run on closed bars — no recalculation of history, no future leak.
Concept credit
Band-pass / roofing digital-signal-processing filters for market cycles — John Ehlers, Cycle Analytics for Traders (2013) and Rocket Science for Traders (2001).
Disclaimer
For research and education only. Not financial advice, not a recommendation, and not a guarantee of future results. Market cycles are non-stationary — band energy describes the recent spectrum, it does not predict it. All statistics are in-sample, close-to-close, and exclude costs. Do your own research and manage your own risk.
What it does
The Wavelet Energy Oscillator decomposes price into three cycle bands at once — fast, mid and slow — and shows two things together: a single composite momentum line (in σ units) and a live energy spectrum telling you which band currently drives the market.
Why this is different (and original)
Cycle and dominant-period tools lock onto one period and follow it. The problem is that markets hand control between timescales: a fast, choppy regime gives way to a slower swing, and a single-period reading only turns after that has happened. By running a bank of band-pass filters in parallel and measuring the energy in each band, this oscillator shows the whole spectrum simultaneously — so a fast band losing energy to a slow band is visible as an early footprint of a regime change. Presenting the live energy split next to a dominant-band-coloured composite, with a built-in edge test, is what makes it original.
How it works
Three band-pass filters (recursive, near-orthogonal) are centred on the fast, mid and slow periods you choose.
Each band's energy is its smoothed squared output. The three energies are normalized to percentage shares so the dashboard reads as a live spectrum.
The composite is the summed band output, z-scored over the normalization window into the σ oscillator and coloured by whichever band currently dominates.
How to use it
Read the spectrum first. Fast share dominant → short, choppy moves; slow share dominant → a longer swing is in control; a shift between them flags a changing regime.
Composite zero-crosses (triangles) time the swing in the dominant band; the σ bands (red top, green bottom) flag stretched readings.
The line's colour tells you which timeframe is driving at a glance.
Read the EDGE row. The harness checks whether composite crosses preceded a favourable ≥ k×ATR move within the horizon, versus the unconditional Base %. EDGE = Hit − Base.
Settings guide
01 · Cycle Bands — source, the three centre periods, bandwidth (narrow = sharper/ringier, wide = smoother), energy smoothing, universal price source.
02 · Normalization — z-score window, output smoothing.
03 · Calibration — horizon, favourable-move threshold (×ATR), base-rate window.
04 · Bands — swing and extreme σ bands.
05 · Display & Theme — visual style, regime tint, dashboard, and per-band + band-zone colors.
Non-repaint
All filters are recursive and run on closed bars — no recalculation of history, no future leak.
Concept credit
Band-pass / roofing digital-signal-processing filters for market cycles — John Ehlers, Cycle Analytics for Traders (2013) and Rocket Science for Traders (2001).
Disclaimer
For research and education only. Not financial advice, not a recommendation, and not a guarantee of future results. Market cycles are non-stationary — band energy describes the recent spectrum, it does not predict it. All statistics are in-sample, close-to-close, and exclude costs. Do your own research and manage your own risk.
Release Notes
Wavelet Energy Oscillator (short name: Wavelet Energy)New in this update — spectral purity and energy hand-off. The dashboard now shows how concentrated the spectrum is (the dominant band's share of total energy) alongside which band — fast, mid or slow — currently rules and the period it represents. When energy hands off from one band to another, that transition is flagged: it is the early footprint of a regime change that single-cycle tools miss.
New dashboard rows: Purity / Dominant-band, Edge floor.
New exports: EXP_Composite, EXP_DomBand, EXP_DomPeriod, EXP_FastShare, EXP_MidShare, EXP_SlowShare, EXP_SNR, EXP_Edge, EXP_EdgeLB, EXP_RunsZ.
Honest note: market cycles are non-stationary — purity describes the recent spectrum, it does not forecast. Read the Edge floor.
Release Notes
v2.1 — A ground-up engine upgrade. The three ad-hoc band-pass filters are replaced by a genuine shift-invariant MODWT (5 undecimated scales), a wavelet-leaders multifractal read (Hurst c1 + multifractality c2) is added, the forward test is reworked to HARNESS+ (uniqueness-weighted effective N, in/out-of-sample split, deflated significance), and the composite gains optional robust-MAD normalization + a lag-minimal smoother. This reads differently from the published band-pass version by design — it is a more rigorous tool, not a tweak.1. Real wavelet transform (v2.0). The spectral core is now a Maximal-Overlap DWT computed by the causal à-trous algorithm with a Daubechies-4 (or Haar) filter. Five undecimated scales (≈2·4·8·16·32 bars) are extracted; because the MODWT is not decimated it is shift-invariant — the reading doesn't jump when a new bar arrives, which a decimated DWT would. Each scale's energy is its smoothed squared coefficient, normalized to percentage shares (grouped fast / mid / slow for the dashboard). The composite is price minus the level-5 wavelet smooth.
2. Multifractal wavelet-leaders spectrum (v2.0). From the wavelet coefficients the script builds wavelet leaders (cross-scale local suprema) and estimates the first two log-cumulants across scale: c1 (self-similarity / Hurst — persistence vs roughness) and c2 (multifractality width — 0 = uniform, strongly negative = intermittent / bursty / turbulent). c2 is an early fragility read a single-scale oscillator cannot give.
3. HARNESS+ forward test (v2.0). The Hit/Base/EDGE record now reports a uniqueness-weighted effective sample size, an in-sample / out-of-sample split (the OOS edge is the one to trust — exported as EXP_EdgeOOS), and a multiple-testing deflated significance bar. Runs-test retained. Compact (default) / Pro dashboard and optional on-price overlay signals added.
4. Robust normalization + lag-minimal smoother + 3-window consensus (v2.1 · Wave A/U8). The composite z can be standardized with a median/MAD statistic (default on) and smoothed with Ehlers' UltimateSmoother (default on); an opt-in 3-window extreme consensus (default off) marks a reading extreme only when short/medium/long windows agree. Set Z-score mode = "Classic (mean/stdev)", Output smoother = "EMA", Extreme normalization = "Single window" to fall back to the v2.0 output.
Market cycles are non-stationary — band energy describes the recent spectrum, it does not predict. Non-repaint: the MODWT is causal (à-trous, closed bars); the calibration resolves on confirmed bars. Concept credits: MODWT / à-trous — Percival & Walden (2000), Shensa (1992); Daubechies wavelets — Daubechies (1988); wavelet leaders & multifractal log-cumulants — Jaffard, Wendt-Abry-Jaffard (2007); out-of-sample / uniqueness weighting — López de Prado (2018); plus Ehlers UltimateSmoother and the median/MAD robust z-score.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.