PROTECTED SOURCE SCRIPT
已更新 MA Distance Percentile - HighQ Tools

HighQTools — MA Distance Percentile (MADP)
As always, if anyone has any tips or additional features they'd like to see, feel free to reach out!
MA Distance Percentile (MADP) measures how far price is from its moving average relative to its own recent history.
Instead of showing raw distance (which varies by symbol, volatility, and timeframe), MADP normalizes price-to-MA distance into a 0–100 percentile rank over a rolling lookback window. This allows traders to quickly identify when price is relatively extended or compressed compared to recent conditions.
🔍 How It Works
A moving average is calculated (EMA by default, configurable).
The ratio of price / MA is computed.
That ratio is percentile-ranked over a user-defined lookback window.
The result is optionally smoothed for clarity.
High values (e.g., 80–100): Price is more extended above its MA than it has been recently.
Low values (e.g., 0–20): Price is relatively compressed or discounted vs its MA.
🧭 How to Use It
MADP is best used as a context tool, not a standalone signal:
Identify mean-reversion potential at relative extremes
Distinguish trend continuation vs exhaustion
Filter entries taken near highs/lows vs those taken in compression
Combine with structure, volume, delta, or VWAP-based tools
Optional visual levels (20 / 50 / 80) are provided for quick reference. Simple signals are included but disabled by default to encourage discretionary use.
⚙️ Defaults & Notes
Default MA: 20-period EMA
Default lookback: 200 bars
Designed for intraday and swing analysis
Does not repaint
Percentile-based normalization makes it robust across symbols and timeframes
This indicator is part of the HighQTools framework: clean, transparent tools designed to provide context first, not overfitted signals.
As always, if anyone has any tips or additional features they'd like to see, feel free to reach out!
MA Distance Percentile (MADP) measures how far price is from its moving average relative to its own recent history.
Instead of showing raw distance (which varies by symbol, volatility, and timeframe), MADP normalizes price-to-MA distance into a 0–100 percentile rank over a rolling lookback window. This allows traders to quickly identify when price is relatively extended or compressed compared to recent conditions.
🔍 How It Works
A moving average is calculated (EMA by default, configurable).
The ratio of price / MA is computed.
That ratio is percentile-ranked over a user-defined lookback window.
The result is optionally smoothed for clarity.
High values (e.g., 80–100): Price is more extended above its MA than it has been recently.
Low values (e.g., 0–20): Price is relatively compressed or discounted vs its MA.
🧭 How to Use It
MADP is best used as a context tool, not a standalone signal:
Identify mean-reversion potential at relative extremes
Distinguish trend continuation vs exhaustion
Filter entries taken near highs/lows vs those taken in compression
Combine with structure, volume, delta, or VWAP-based tools
Optional visual levels (20 / 50 / 80) are provided for quick reference. Simple signals are included but disabled by default to encourage discretionary use.
⚙️ Defaults & Notes
Default MA: 20-period EMA
Default lookback: 200 bars
Designed for intraday and swing analysis
Does not repaint
Percentile-based normalization makes it robust across symbols and timeframes
This indicator is part of the HighQTools framework: clean, transparent tools designed to provide context first, not overfitted signals.
發行說明
HighQTools — MA Distance Percentile (MADP)As always, if anyone has any tips or additional features they'd like to see, feel free to reach out!
MA Distance Percentile (MADP) measures how far price is from its moving average relative to its own recent history.
Instead of showing raw distance (which varies by symbol, volatility, and timeframe), MADP normalizes price-to-MA distance into a 0–100 percentile rank over a rolling lookback window. This makes it easier to spot when price is relatively extended or compressed compared to recent conditions.
🔍 How It Works
A moving average is calculated (EMA by default, configurable).
The ratio of price / MA is computed.
That ratio is percentile-ranked over a user-defined lookback window.
The result is optionally smoothed for clarity.
High values (80–100): Price is more extended above its MA than it has been recently.
Low values (0–20): Price is relatively compressed or discounted vs its MA.
🧭 How to Use It
MADP is best used as a context tool, not a standalone system:
Identify mean-reversion potential at relative extremes
Distinguish trend continuation vs exhaustion
Filter entries taken near highs/lows vs those taken in compression
Combine with structure, volume, delta, or VWAP-based tools
Optional visual levels (20 / 50 / 80) are provided for quick reference.
🟢 Signal Settings (Optional)
MADP includes optional signals to help highlight “reversion completed → expansion begins” type moments. Signals are OFF by default.
Enable via Show Simple Signals, then choose a Signal Mode:
1) Cross Levels
This mode triggers when MADP crosses key levels (Low/Mid/High). It can be used to confirm a shift in regime:
A cross up through the Low (e.g., 20) suggests price may be leaving a discounted / compressed condition and reverting back toward “normal.”
A cross down through the High (e.g., 80) suggests price may be leaving an overextended condition and reverting.
2) Extremes Revert (recommended for mean reversion use)
This mode is designed specifically to catch the moment when price stops pressing the extreme and begins moving away from it:
After MADP spends time near the Low level, a bullish signal prints when MADP crosses back up through the Low level (e.g., 20). Conceptually: reversion away from the downside extreme has begun.
After MADP spends time near the High level, a bearish signal prints when MADP crosses back down through the High level (e.g., 80). Conceptually: reversion away from the upside extreme has begun.
Practical entry concept:
Rather than fading an extreme immediately, many traders prefer waiting for confirmation that the extreme has stopped expanding and price has started moving back toward balance. These signals aim to highlight that “turning point” behavior, which can then be combined with your execution triggers (structure, volume, delta, VWAP, etc.).
⚙️ Defaults & Notes
Default MA: 20-period EMA
Default lookback: 200 bars
Designed for intraday and swing analysis
Does not repaint
Percentile-based normalization makes it robust across symbols and timeframes
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由使用,沒有任何限制 — 點擊此處了解更多。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由使用,沒有任何限制 — 點擊此處了解更多。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。