OPEN-SOURCE SCRIPT

EMA Momentum & Cross Engine

381
Indicator Summary: EMA Momentum & Cross Engine
This indicator is an advanced, fully customizable trend and momentum tool built around the 20 and 50 Exponential Moving Averages (EMAs). Instead of solely relying on traditional, lagging crossover signals, it proactively identifies high-probability reversals by mathematically measuring the tension between the moving averages.

Core Features:

Early Reversal Detection (DIV Signals): It measures the distance between the 20 and 50 EMA. When this distance becomes severely overextended (exhaustion) and suddenly snaps back with high velocity, it fires early "BUY DIV" or "SELL DIV" signals before a crossover ever happens.

Standard Crossovers: Plots standard trend-following buy and sell signals when the EMAs actually cross.

Smart Filtering Engine: Includes a built-in cooldown timer and max-signal limiters. This prevents rapid-fire false signals during choppy, sideways markets and keeps the chart perfectly clean.

Deep Customization: Every visual element is customizable. You can change the text, colors, label sizes, and even the precise mathematical distance the labels sit away from the candle wicks. It also features floating, dynamic labels at the end of the EMA lines so you never lose track of them.

Why ATR-Normalized Divergence is Better Than Slope
When trying to catch early trend changes or pullbacks, measuring the Average True Range (ATR) normalized spread between the EMAs is vastly superior to just measuring the slope of the lines. Here is why:

1. It Eliminates the "Visual Illusion"
The slope (angle) of a moving average on your screen is an illusion. If you zoom out or stretch the y-axis of your chart, a "flat" slope suddenly looks incredibly steep. Measuring the ATR spread relies on hard, objective math—not how your monitor happens to be scaled at that exact second.

2. It Automatically Adapts to Market Volatility
A 10-point distance between the 20 and 50 EMA means something completely different depending on the market environment.

If market volatility is dead, a 10-point gap is a massive, overextended move.

If the market is wildly volatile (like during a major news event), a 10-point gap is just normal background noise.
By dividing the EMA distance by the ATR, the indicator standardizes the measurement. A value of 1.0 means the EMAs are stretched exactly 1x the normal volatility of the current market, ensuring your signals are accurate regardless of whether the market is slow or fast.

3. It Measures the "Rubber Band" Tension
Slope only tells you the direction the market is heading. ATR Divergence tells you the tension. Markets act like rubber bands—they can only stretch so far from their mean (the 50 EMA) before they snap back. By tracking the exact moment that ATR-normalized rubber band is stretched to its limit and begins to shrink (the velocity delta), you get a high-probability entry for a mean-reversion trade or a deep pullback.

Exención de responsabilidad

La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.