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.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
True Wave Scanner - scanner.elliottwavestrading.com
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
True Wave Scanner - scanner.elliottwavestrading.com
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.