OPEN-SOURCE SCRIPT

EMA20-EMA50 Separation Impulse

74
**EMA20–EMA50 Separation Impulse Indicator**

This indicator is a **trend phase classifier**, not a signal generator.

It evaluates the **structural quality of a trend** by measuring the separation between the EMA20 and EMA50, **normalized by ATR**. By using volatility-adjusted distance instead of raw price or percentage, it provides a robust and comparable measure across different instruments and timeframes.

### Key characteristics

* **Discrete states**, not a continuous oscillator
* **Independent from price scale** (displayed in a lower panel)
* **Contextual indicator**, not a timing tool
* **Fully backtestable without ambiguity**

### Logic

The indicator computes:

```
|EMA20 − EMA50| / ATR
```

Based on this normalized separation, each bar is classified into one of three market phases:

* **Green (State 1)**
Ordered trend. EMA structure is compact and stable.
The EMA-based pullback setup has a statistical edge.

* **Blue (State 2)**
Extended trend. Separation is increasing.
Edge is reduced. Trades require more selectivity or reduced position size.

* **Red (State 3)**
Overextended trend. EMAs are widely separated.
Pullbacks to EMA20 lose effectiveness. The setup has no edge.

### How to integrate it into an EMA-based system

This indicator should be used strictly as a **context filter**, not as an entry or exit trigger.

Typical integration rules:

* Allow long entries **only when State = 1 (Green)**
* Reduce position size or require stronger confirmation when State = 2 (Blue)
* Disable EMA pullback entries entirely when State = 3 (Red)

Used correctly, the indicator helps distinguish **when an EMA trend-following system is operating in its optimal environment**, and when market conditions degrade its expectancy.

It answers the question:

> *“Is this still a healthy trend for EMA pullback trading?”*

—not *“Should I buy or sell now?”*

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.