OPEN-SOURCE SCRIPT

WMA MAD Trend | RakoQuant

85
WMA MAD Trend | RakoQuant is a robust volatility-regime trend system built on Weighted Moving Average structure and Median Absolute Deviation dispersion, engineered to produce clean directional states while suppressing wick-driven noise and unstable ATR distortions.
This tool belongs to the RakoQuant protected research line, combining a smooth WMA baseline, statistically robust volatility envelopes (MAD bands), SuperTrend-style regime logic, and a strength-aware visualization layer designed for consistent performance across trending, mean-reverting, and mixed market environments.

Core Concept
This indicator answers one fundamental question:
Is price holding a statistically meaningful deviation from its WMA baseline, or reverting back into range?
Unlike classic SuperTrend variants that rely on ATR (highly sensitive to spikes and wicks), WMA MAD Trend uses Median Absolute Deviation as its volatility engine — a robust dispersion measure that remains stable in the presence of outliers.

How It Works
1) WMA Baseline (Directional Structure)
At its core, the indicator defines the market’s structural center using a Weighted Moving Average:
* WMA Baseline tracks directional bias with smoother, trend-weighted responsiveness
* The baseline can optionally be smoothed further in intraday mode to reduce micro-chop
This provides a stable anchor for dispersion-based regime classification.

2) MAD Volatility Engine (Robust Dispersion Core)
Instead of ATR, volatility is measured via Median Absolute Deviation (MAD) around the baseline:
* Compute absolute deviation:
|Close − Baseline|
* Take rolling median of deviation over madLen
* Optional normalization scales MAD toward a stdev-like measure (via constant factor)
This makes volatility estimation:
* Outlier-resistant
* Wick-resistant
* Regime-stable during abnormal price spikes

3) MAD Bands + SuperTrend Trailing Logic (Regime State Model)
Bands are built as:
* Upper Band = Baseline + Factor × MAD
* Lower Band = Baseline − Factor × MAD
Then classic SuperTrend-style trailing constraints are applied so the active band persists until a true regime break occurs.
That produces a state engine:
* Bull regime when price breaks above the trailing upper logic (transition into trend-up state)
* Bear regime when price breaks below the trailing lower logic (transition into trend-down state)
This behaves like a structural market regime model, not a reactive oscillator.

4) Strength Engine (Deviation-Based Intensity)
A defining layer of this tool is the MAD Z-score intensity system:
* Compute Z-score:
z = |Close − Baseline| / MAD
* Map into a 0 → 1 strength scale
Interpretation:
* Low deviation = weak regime confidence (likely chop / mean reversion)
* High deviation = strong regime confidence (trend expansion)

5) Intensity Visual Engine (Signal Clarity Layer)
WMA MAD Trend includes a protected visual engine that scales opacity with strength:
* Strong expansion = solid trend band
* Weak deviation = faded band
This gives immediate clarity:
Not all flips are equal — strength is displayed structurally.

6) Optional Institutional Filters
Two optional confirmation modules allow institutional-grade filtering:
Baseline Confirmation
* Bull flips only accepted if price is above baseline
* Bear flips only accepted if price is below baseline
EMA Stack Filter
* Bull only when Fast EMA > Slow EMA
* Bear only when Fast EMA < Slow EMA
These modules make the tool suitable for:
* Directional portfolio bias frameworks (RSPS)
* Regime classification overlays
* Trend confirmation filters for execution systems

7) Strong Flip Tier Alerts
Signal quality is tiered:
* Standard flip alerts
* Strong flip alerts only when deviation strength exceeds a threshold
This produces a higher-confidence regime transition model for swing positioning and exposure scaling.

How To Use
✅ Trend regime overlay
✅ Wick-resistant volatility trend filter
✅ MAD-based deviation strength engine
✅ Directional bias tool for portfolio systems
Best use cases:
* 1H–1D trend frameworks
* Regime filters for signal stacking
* Chop suppression in volatile markets
Suggested workflow:
* Bull bias when the regime is bullish and strength is rising
* Reduce risk / defensive when strength fades or a bearish flip occurs
* Pair with execution tools (breakout/mean-reversion entries) for timing

Screenshot Placement
📸 Example chart / screenshot: snapshot
снимок

Отказ от ответственности

Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.