Smart Moving Average Dynamics [ChartNation]

What it does:
SMAD maps how far price deviates from a chosen moving average and normalizes that distance into a bounded oscillator (−100…+100). It detects extreme expansions and prints non-repainting dots when the move exits an extreme. Price-level rails are drawn from those events (with optional fade/expiry) to highlight likely reaction zones. The MA line is colored by bias. A slim gauge summarizes the current oscillator percentile; a compact info panel shows TF, Trend, Volume rank, and Volatility rank.
How it works (high-level, closed-source)
Core signal: diff = price – MA(type, length) where MA can be SMA/EMA/RMA/WMA/VWMA.
Normalization (choose one):
- Highest Abs (N): scales diff by the highest absolute excursion over N bars (fast, adaptive).
- Z-Score: scales by stdev(diff, N) and maps ±σ to ±100 via a user factor.
- ATR-Scaled: scales by ATR * k, relating deviation to current volatility.
Percent Rank: ranks the magnitude of |diff| over N bars and reapplies the original sign.
All methods clamp to −100…+100 to keep visuals consistent across assets/TFs.
Extremes & confirmation: Dots print only when an extreme exits ±100 (optionally on bar close) and can be filtered by linger bars and short-term slope flip, reducing one-bar spikes.
Rails: When an extreme confirms, a rail is anchored at the corresponding price swing and can soft-fade and/or expire after X bars.
Trend color: MA color = Up (green) when oscillator > threshold and MA slope > 0; Down (magenta) for the opposite; Neutral otherwise.
Context panels:
Slim Gauge: current oscillator bucket (0–20) with the exact normalized reading.
Info Panel: TF, Trend, and 0–100 percent-ranks of Volume and ATR-based volatility grouped as Low / Medium / High.
SMAD isn’t a collection of plots; it’s a single framework that integrates:
- a deviation-from-MA engine,
- four interchangeable normalization models (selected per market regime),
- a gated extreme detector (linger + slope + confirm-on-close), and
- time-aware rails with soft fade/expiry, presented with a minimal gauge and info panel so traders can compare regimes across TFs without recalibrating thresholds.
How to use (examples, not signals)
- Mean-revert plays: When price exits an extreme and prints a dot, look for reactions near the new rail. Combine with your S/R and risk model.
- Trend continuation: In strong trends the oscillator will spend more time above/below zero; the colored MA helps keep you aligned and avoid fading every push.
- Regime switching: Try Percent Rank or ATR-Scaled on choppy/alts; Z-Score on majors; Highest Abs (N) when you want fastest adaptation.
- Risk ideas: Rails can be used as partial-take or invalidate levels. Always backtest on your pair/TF.
Key settings
- Normalization: Highest Abs / Z-Score / ATR-Scaled / Percent Rank (with N & factors).
- Filters: Extreme threshold, linger bars, slope lookback, confirm on close.
- Rails: Expire after X bars; soft-fade step.
- Panels: Slim gauge (bottom-right), Info panel (middle-right).
Notes & limits
Prints confirm after the extreme exits ±100; nothing repaints retroactively.
Normalization can change sensitivity—choose the one matching your asset’s regime.
What it does:
SMAD maps how far price deviates from a chosen moving average and normalizes that distance into a bounded oscillator (−100…+100). It detects extreme expansions and prints non-repainting dots when the move exits an extreme. Price-level rails are drawn from those events (with optional fade/expiry) to highlight likely reaction zones. The MA line is colored by bias. A slim gauge summarizes the current oscillator percentile; a compact info panel shows TF, Trend, Volume rank, and Volatility rank.
How it works:
Core signal: diff = price – MA(type, length) where MA can be SMA/EMA/RMA/WMA/VWMA.
Normalization (choose one):
- Highest Abs (N): scales diff by the highest absolute excursion over N bars (fast, adaptive).
- Z-Score: scales by stdev(diff, N) and maps ±σ to ±100 via a user factor.
- ATR-Scaled: scales by ATR * k, relating deviation to current volatility.
- Percent Rank: ranks the magnitude of |diff| over N bars and reapplies the original sign. All methods clamp to −100…+100 to keep visuals consistent across assets/TFs.
Extremes & confirmation: Dots print only when an extreme exits ±100 (optionally on bar close) and can be filtered by linger bars and short-term slope flip, reducing one-bar spikes.
Rails: When an extreme confirms, a rail is anchored at the corresponding price swing and can soft-fade and/or expire after X bars.
Trend color: MA color = Up (green) when oscillator > threshold and MA slope > 0; Down (magenta) for the opposite; Neutral otherwise.
Context panels:
- Slim Gauge: current oscillator bucket (0–20) with the exact normalized reading.
- Info Panel: TF, Trend, and 0–100 percent-ranks of Volume and ATR-based volatility grouped as Low / Medium / High.
SMAD isn’t a collection of plots; it’s a single framework that integrates:
- a deviation-from-MA engine,
- four interchangeable normalization models (selected per market regime),
- a gated extreme detector (linger + slope + confirm-on-close), and
- time-aware rails with soft fade/expiry, presented with a minimal gauge and info panel so traders can compare regimes across TFs without recalibrating thresholds.
How to use (examples, not signals)
- Mean-revert plays: When price exits an extreme and prints a dot, look for reactions near the new rail. Combine with your S/R and risk model.
- Trend continuation: In strong trends the oscillator will spend more time above/below zero; the colored MA helps keep you aligned and avoid fading every push.
- Regime switching: Try Percent Rank or ATR-Scaled on choppy/alts; Z-Score on majors; Highest Abs (N) when you want fastest adaptation.
- Risk ideas: Rails can be used as partial-take or invalidate levels. Always backtest on your pair/TF.
Key settings
- Normalization: Highest Abs / Z-Score / ATR-Scaled / Percent Rank (with N & factors).
- Filters: Extreme threshold, linger bars, slope lookback, confirm on close.
- Rails: Expire after X bars; soft-fade step.
- Panels: Slim gauge (bottom-right), Info panel (middle-right).
Notes & limits
- Prints confirm after the extreme exits ±100; nothing repaints retroactively.
- Normalization can change sensitivity—choose the one matching your asset’s regime.
สคริปต์แบบเฉพาะผู้ได้รับเชิญเท่านั้น
เฉพาะผู้ใช้ที่ได้รับการอนุมัติจากผู้เขียนเท่านั้นที่สามารถเข้าถึงสคริปต์นี้ได้ คุณจะต้องร้องขอและได้รับอนุญาตก่อนจึงจะสามารถใช้งานได้ โดยปกติจะได้รับอนุญาตหลังจากชำระเงินแล้ว สำหรับรายละเอียดเพิ่มเติม ทำตามคำแนะนำของผู้เขียนด้านล่างหรือติดต่อ chartnation โดยตรง
TradingView ไม่แนะนำให้ชำระเงินหรือใช้สคริปต์ เว้นแต่ว่าคุณจะเชื่อถือผู้เขียนสคริปต์และเข้าใจวิธีการทำงานของมัน คุณยังอาจพบทางเลือกของโอเพนซอร์ส แบบฟรีในสคริปต์ชุมชนของเรา
คำแนะนำของผู้เขียน
คำจำกัดสิทธิ์ความรับผิดชอบ
สคริปต์แบบเฉพาะผู้ได้รับเชิญเท่านั้น
เฉพาะผู้ใช้ที่ได้รับการอนุมัติจากผู้เขียนเท่านั้นที่สามารถเข้าถึงสคริปต์นี้ได้ คุณจะต้องร้องขอและได้รับอนุญาตก่อนจึงจะสามารถใช้งานได้ โดยปกติจะได้รับอนุญาตหลังจากชำระเงินแล้ว สำหรับรายละเอียดเพิ่มเติม ทำตามคำแนะนำของผู้เขียนด้านล่างหรือติดต่อ chartnation โดยตรง
TradingView ไม่แนะนำให้ชำระเงินหรือใช้สคริปต์ เว้นแต่ว่าคุณจะเชื่อถือผู้เขียนสคริปต์และเข้าใจวิธีการทำงานของมัน คุณยังอาจพบทางเลือกของโอเพนซอร์ส แบบฟรีในสคริปต์ชุมชนของเรา