PROTECTED SOURCE SCRIPT

Price Extension Risk Monitor

38
Price Extension Risk Monitor
Price Extension Risk Monitor is a chart-overlay indicator designed to provide context on how extended price is relative to commonly used moving averages, using both volatility-adjusted and percentage-based distance measures.
The indicator evaluates price extension from two configurable moving averages and combines those distances into a normalized risk score. This helps users assess when price is relatively balanced, stretched, or increasingly vulnerable to mean reversion—without generating trade signals or placing orders.
What the indicator measures
• ATR-based extension: Distance between price and a primary moving average, normalized by ATR to account for volatility.
• Percent extension: Percentage distance between price and a secondary moving average.
• Extension score: A weighted blend of ATR and percent extension, scaled from 0 to 100 for consistency across instruments and timeframes.
Risk classification
Based on the extension score, the indicator classifies price context into simple descriptive states:
• Normal: Price is within typical extension bounds.
• Caution: Extension is elevated and worth monitoring.
• Reversal Risk: Extension is high relative to configured thresholds.
These labels are descriptive only and are not predictions or trade recommendations.
Visual output
• A compact table panel summarizes:
o ATR extension (with reference MA)
o Percent extension (with reference MA)
o Combined extension score
o Current risk status
• The panel location, text size, and color behavior are user-configurable.
• No lines, markers, or bar coloring are drawn on the chart to keep the display unobtrusive.
Alerts
Optional alerts notify when:
• ATR-based extension exceeds its threshold
• Percent-based extension exceeds its threshold
• Overall extension risk becomes elevated
Alerts are evaluated on confirmed bars.
Intended use
This indicator is designed as a risk and context tool, not a standalone trading system. It can be used alongside trend analysis, structure, or other indicators to help interpret how stretched price may be relative to recent behavior.
Notes
• Indicator only — no orders are placed.
• Designed for bar-close confirmation; values may update on realtime (forming) bars.
• Multi-timeframe values use request.security() with lookahead disabled.
• Educational and informational use only. Not financial advice.

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.