OPEN-SOURCE SCRIPT
[EWT] MA Extension Risk Stats

[EWT] MA Extension Risk Stats helps traders objectively measure how extended a stock, index, or any instrument is relative to its own historical behavior from a moving average.
Instead of guessing whether price “looks high,” this indicator calculates the percentage distance of every historical bar from a configurable SMA or EMA and then displays the Maximum, Mean, and Median deviations in a clean, updating table. By comparing the current deviation against these historical benchmarks, you get clear, data-driven context for profit booking decisions.
Key Benefits
Practical Use Cases
Whether you trade stocks, indices, forex, or crypto, [EWT] MA Extension Risk Stats gives you a professional, repeatable framework to manage extension risk and improve profit-taking discipline. It is especially valuable for traders who want to move from subjective “it looks extended” decisions to quantifiable, historically grounded rules.
Add it to your chart, adjust the MA period to match your style, and start making more confident, data-backed decisions on when to lock in profits.
Instead of guessing whether price “looks high,” this indicator calculates the percentage distance of every historical bar from a configurable SMA or EMA and then displays the Maximum, Mean, and Median deviations in a clean, updating table. By comparing the current deviation against these historical benchmarks, you get clear, data-driven context for profit booking decisions.
Key Benefits
- Objective Extension Measurement: See exactly where the current price stands in the instrument’s historical distribution of moves away from its moving average.
- Better Profit Booking Decisions: Know whether the current extension is normal, moderate, high, or near the historical maximum — removing emotion from scaling out of positions.
- Risk Context at a Glance: Color-coded risk levels (Low / Moderate / High / Very High) combined with concise guidance help you quickly decide whether to book partial profits (30-50%) or exit most/all of a position.
- All-History Perspective: Unlike rolling-window tools, this indicator uses the entire available dataset on your chart, giving you a complete picture across different market regimes.
- Fully Customizable: Choose SMA or EMA, any period length, and position the compact table anywhere on the chart. The table automatically adapts to your light or dark chart theme for excellent readability.
Practical Use Cases
- Trend Following & Swing Trading: When price stretches far above its MA during a strong uptrend, use the stats to scale out systematically instead of hoping for more upside.
- Mean Reversion Setups: Identify when price has extended unusually far below its MA and prepare for potential bounces with better risk awareness.
- Position Management: Apply consistent rules such as “book 50% when current deviation exceeds 1.5× median” or “exit fully when approaching historical maximum.”
- Multi-Timeframe Analysis: Run it on daily charts for swing trades and weekly charts for positional decisions using the same logic.
Whether you trade stocks, indices, forex, or crypto, [EWT] MA Extension Risk Stats gives you a professional, repeatable framework to manage extension risk and improve profit-taking discipline. It is especially valuable for traders who want to move from subjective “it looks extended” decisions to quantifiable, historically grounded rules.
Add it to your chart, adjust the MA period to match your style, and start making more confident, data-backed decisions on when to lock in profits.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
True Wave Scanner - scanner.elliottwavestrading.com
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
True Wave Scanner - scanner.elliottwavestrading.com
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.