OPEN-SOURCE SCRIPT
Wavelet Trend Filter

What it is
A denoised price line whose smoothing is derived from measured noise, not a period you pick — plus the tool's signature number, the noise fraction (what share of the recent move is noise vs structure). Most published "wavelet denoising improves prediction" results denoise the whole series including future bars, which is lookahead-contaminated and impossible live. This tool refuses that: it runs a Haar wavelet transform over a trailing power-of-two window and keeps only the endpoint as today's value, fixed at close and never revised. Strictly causal, non-repainting, no forecast.
How it's built
The engine is a five-step Donoho-Johnstone wavelet shrinkage, run every bar over a trailing window (default 128 bars): a Haar DWT (shortest support, fewest boundary coefficients — the right choice for short causal series); noise scale σ = MAD(finest detail coefficients)/0.6745 (robust to outliers); the universal threshold λ = σ·√(2 ln n) with an optional multiplier; soft or hard shrinkage of the detail coefficients; and an inverse transform, keeping the endpoint. Optional symmetric reflection padding reduces edge distortion. Because the threshold self-scales from measured noise, a quiet tape is smoothed less and a noisy tape more — automatically, on any timeframe.
Derived reads: noise fraction = 1 − var(denoised)/var(raw) over the window (share the transform removed), ranked into a percentile; trend slope in noise-σ units; and a signal-to-noise strength = slope (σ) × structure share (1 − noise fraction), the single "is this trend real?" number.
How you read it — and the honest actionable signal
The noise fraction gates everything. A bold chop/structure ribbon along the bottom of the chart shows the whole regime spectrum (green = structure/low noise/trend trustworthy, red = chop/high noise/stand aside), and a ±1σ noise envelope around the denoised line makes the removed noise visible — so it's obviously not just a moving average.
The actionable markers are structure-gated: a green ▲ / red ▼ prints when the denoised slope turns up/down and the tape has structure (low noise); in chop the tool withholds and marks the turn with a small caution dot instead. A hysteresis on the structure state keeps the signals from re-firing as noise oscillates. This is not a blind crossover generator — it goes quiet exactly when the tape is too noisy to trust, which is when ordinary signals whipsaw. The panel's "Read" row states the current call in plain English ("up-trend · structure ✓", "chop — stand aside").
Exports & alerts
EXP_Denoised · EXP_NoiseSigma · EXP_NoiseFrac (0–1) · EXP_Slope (σ) · EXP_SNR (trend strength) · EXP_Stance (+1 up·structure / −1 down·structure / 0). Alerts: noise fraction entering top / bottom quartile (chop / structure) · denoised slope turning up / down · confirmed up-trend / down-trend with structure present.
A denoised price line whose smoothing is derived from measured noise, not a period you pick — plus the tool's signature number, the noise fraction (what share of the recent move is noise vs structure). Most published "wavelet denoising improves prediction" results denoise the whole series including future bars, which is lookahead-contaminated and impossible live. This tool refuses that: it runs a Haar wavelet transform over a trailing power-of-two window and keeps only the endpoint as today's value, fixed at close and never revised. Strictly causal, non-repainting, no forecast.
How it's built
The engine is a five-step Donoho-Johnstone wavelet shrinkage, run every bar over a trailing window (default 128 bars): a Haar DWT (shortest support, fewest boundary coefficients — the right choice for short causal series); noise scale σ = MAD(finest detail coefficients)/0.6745 (robust to outliers); the universal threshold λ = σ·√(2 ln n) with an optional multiplier; soft or hard shrinkage of the detail coefficients; and an inverse transform, keeping the endpoint. Optional symmetric reflection padding reduces edge distortion. Because the threshold self-scales from measured noise, a quiet tape is smoothed less and a noisy tape more — automatically, on any timeframe.
Derived reads: noise fraction = 1 − var(denoised)/var(raw) over the window (share the transform removed), ranked into a percentile; trend slope in noise-σ units; and a signal-to-noise strength = slope (σ) × structure share (1 − noise fraction), the single "is this trend real?" number.
How you read it — and the honest actionable signal
The noise fraction gates everything. A bold chop/structure ribbon along the bottom of the chart shows the whole regime spectrum (green = structure/low noise/trend trustworthy, red = chop/high noise/stand aside), and a ±1σ noise envelope around the denoised line makes the removed noise visible — so it's obviously not just a moving average.
The actionable markers are structure-gated: a green ▲ / red ▼ prints when the denoised slope turns up/down and the tape has structure (low noise); in chop the tool withholds and marks the turn with a small caution dot instead. A hysteresis on the structure state keeps the signals from re-firing as noise oscillates. This is not a blind crossover generator — it goes quiet exactly when the tape is too noisy to trust, which is when ordinary signals whipsaw. The panel's "Read" row states the current call in plain English ("up-trend · structure ✓", "chop — stand aside").
Exports & alerts
EXP_Denoised · EXP_NoiseSigma · EXP_NoiseFrac (0–1) · EXP_Slope (σ) · EXP_SNR (trend strength) · EXP_Stance (+1 up·structure / −1 down·structure / 0). Alerts: noise fraction entering top / bottom quartile (chop / structure) · denoised slope turning up / down · confirmed up-trend / down-trend with structure present.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.