OPEN-SOURCE SCRIPT
MA Distance Monitor

MA Distance Monitor [5 MAs] - Custom
Overview
The MA Distance Monitor is a professional-grade dashboard designed for traders who need to track the relationship between price and multiple Moving Averages simultaneously.
Unlike standard indicators that simply plot lines, this tool quantifies exactly how far the price is from your key levels (in Percentage or Price terms). This is crucial for identifying Mean Reversion opportunities (when price is overextended) and confirming Trend Strength.
Key Features
1. 5 Fully Configurable Moving Averages
Monitor 5 distinct MAs at once.
Default Setup: 5, 10, 20, 50, and 200 SMA (Simple Moving Average) — widely used institutional levels.
Customization: Switch any individual MA between SMA and EMA (Exponential Moving Average) and change lengths to fit your strategy.
2. Smart Dashboard (Clean Mode by Default)
The on-screen table gives you real-time data without cluttering your chart.
Clean Mode: By default, it shows only the Distance %, giving you a minimalist view of market extension.
Expandable: In the settings, you can enable additional columns to see the MA Name, MA Price, and Warning Thresholds.
Borders: Toggle table grid lines on or off for a seamless look.
3. "Overextended" Warning System
Set a specific "Warn %" threshold for each MA (e.g., 5%).
If the price deviates beyond this threshold, the indicator highlights the data in Orange (or your custom color).
Use Case: This helps identify when price has moved too far, too fast, signaling a potential pullback or reversal.
4. Chart Scale Labels
Floating labels appear on the right-side price scale, marking the exact price level of your MAs.
These labels dynamically show the current distance %, keeping your eyes on the price action.
5. Advanced Theming
Dark Mode: High-contrast colors optimized for dark charts.
Light Mode: Optimized for bright backgrounds.
Custom: Fully control every color (Bullish, Bearish, Warning, Text, Headers, Borders) to match your chart aesthetic perfectly.
How to Use
Interpreting the Data
Green: Price is Above the Moving Average (Bullish Trend).
Red: Price is Below the Moving Average (Bearish Trend).
Orange (Warning): Price is Overextended (Distance > Threshold). Watch for mean reversion.
Settings Guide
MA Configuration: Set your Lengths and Types (SMA/EMA).
Display & Styling: * Toggle Show Dashboard Table to hide/view the table.
Toggle Show Table Header or Show Table Borders for layout preference.
Enable Show MA Name or Show MA Price for more detailed data.
Colors: Select "Custom" in the Theme dropdown to apply your own color palette.
Alerts
This script includes built-in alertcondition events for automation:
Crossover: Triggered when Price crosses OVER a specific MA.
Crossunder: Triggered when Price crosses UNDER a specific MA.
To set an alert:
Click the "Alert" button in TradingView.
Select "MA Dist Custom" as the condition.
Choose the specific crossing event (e.g., "Cross Over MA 5").
Created by Psycholfye
Overview
The MA Distance Monitor is a professional-grade dashboard designed for traders who need to track the relationship between price and multiple Moving Averages simultaneously.
Unlike standard indicators that simply plot lines, this tool quantifies exactly how far the price is from your key levels (in Percentage or Price terms). This is crucial for identifying Mean Reversion opportunities (when price is overextended) and confirming Trend Strength.
Key Features
1. 5 Fully Configurable Moving Averages
Monitor 5 distinct MAs at once.
Default Setup: 5, 10, 20, 50, and 200 SMA (Simple Moving Average) — widely used institutional levels.
Customization: Switch any individual MA between SMA and EMA (Exponential Moving Average) and change lengths to fit your strategy.
2. Smart Dashboard (Clean Mode by Default)
The on-screen table gives you real-time data without cluttering your chart.
Clean Mode: By default, it shows only the Distance %, giving you a minimalist view of market extension.
Expandable: In the settings, you can enable additional columns to see the MA Name, MA Price, and Warning Thresholds.
Borders: Toggle table grid lines on or off for a seamless look.
3. "Overextended" Warning System
Set a specific "Warn %" threshold for each MA (e.g., 5%).
If the price deviates beyond this threshold, the indicator highlights the data in Orange (or your custom color).
Use Case: This helps identify when price has moved too far, too fast, signaling a potential pullback or reversal.
4. Chart Scale Labels
Floating labels appear on the right-side price scale, marking the exact price level of your MAs.
These labels dynamically show the current distance %, keeping your eyes on the price action.
5. Advanced Theming
Dark Mode: High-contrast colors optimized for dark charts.
Light Mode: Optimized for bright backgrounds.
Custom: Fully control every color (Bullish, Bearish, Warning, Text, Headers, Borders) to match your chart aesthetic perfectly.
How to Use
Interpreting the Data
Green: Price is Above the Moving Average (Bullish Trend).
Red: Price is Below the Moving Average (Bearish Trend).
Orange (Warning): Price is Overextended (Distance > Threshold). Watch for mean reversion.
Settings Guide
MA Configuration: Set your Lengths and Types (SMA/EMA).
Display & Styling: * Toggle Show Dashboard Table to hide/view the table.
Toggle Show Table Header or Show Table Borders for layout preference.
Enable Show MA Name or Show MA Price for more detailed data.
Colors: Select "Custom" in the Theme dropdown to apply your own color palette.
Alerts
This script includes built-in alertcondition events for automation:
Crossover: Triggered when Price crosses OVER a specific MA.
Crossunder: Triggered when Price crosses UNDER a specific MA.
To set an alert:
Click the "Alert" button in TradingView.
Select "MA Dist Custom" as the condition.
Choose the specific crossing event (e.g., "Cross Over MA 5").
Created by Psycholfye
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.