OPEN-SOURCE SCRIPT
EMA System

**EMA System V6 (9/21/50/200) — Context, Pullback & Volume**
This indicator turns the classic 9/21/50/200 EMA stack into a simple, rule-based “trend + pullback” framework.
It’s designed to help you trade with **context**, not chase candles.
### Core idea
Price doesn’t “respect” indicators — but moving averages can act like a **map of participation** over time.
Different EMAs represent different horizons, and when they align, trends tend to behave cleaner.
### What it plots
* **EMA 9** (short-term momentum)
* **EMA 21** (pullback / re-entry zone)
* **EMA 50** (trend structure)
* **EMA 200** (macro filter / regime)
### Trend filter (high-probability context)
The script highlights a “trend-friendly” environment when:
* **Price is above EMA 200** → *Long bias / long-only mode*
* **EMA 21 is above EMA 50** → *Trend is considered valid*
* **Price is not below EMA 50** → *Avoid buying in weak structure*
### Pullback & Volume conditions
It then looks for trend continuation opportunities by checking:
* **Price pulls back near EMA 21**
(proximity is configurable by **ATR distance** or **% distance**)
* **Volume dries up during the pullback**
(volume must be below its SMA by a configurable factor)
### Signals
* **SET** = All filters are aligned and the pullback conditions are met (setup is ready)
* **BUY** = A bullish candle confirms the setup near EMA 21
(bullish candle definition is configurable)
### Built-in status panel
A small panel shows the current state:
* Long-only ON/OFF (EMA200)
* Trend valid / not valid (21 vs 50)
* Pullback near/far (EMA21 proximity)
* Volume dries up / not
* Buys OK / No buys (relative to EMA50)
### Notes
* This is an **indicator**, not a complete trading strategy.
* Signals are meant to be used with proper risk management and market structure.
* Works on any asset (crypto, forex, stocks) — best results typically appear in **clean trending markets**.
---
If you want, I can also add a short “one-liner” summary for the first line of the description (more marketing style), or a more technical version for serious quants.
This indicator turns the classic 9/21/50/200 EMA stack into a simple, rule-based “trend + pullback” framework.
It’s designed to help you trade with **context**, not chase candles.
### Core idea
Price doesn’t “respect” indicators — but moving averages can act like a **map of participation** over time.
Different EMAs represent different horizons, and when they align, trends tend to behave cleaner.
### What it plots
* **EMA 9** (short-term momentum)
* **EMA 21** (pullback / re-entry zone)
* **EMA 50** (trend structure)
* **EMA 200** (macro filter / regime)
### Trend filter (high-probability context)
The script highlights a “trend-friendly” environment when:
* **Price is above EMA 200** → *Long bias / long-only mode*
* **EMA 21 is above EMA 50** → *Trend is considered valid*
* **Price is not below EMA 50** → *Avoid buying in weak structure*
### Pullback & Volume conditions
It then looks for trend continuation opportunities by checking:
* **Price pulls back near EMA 21**
(proximity is configurable by **ATR distance** or **% distance**)
* **Volume dries up during the pullback**
(volume must be below its SMA by a configurable factor)
### Signals
* **SET** = All filters are aligned and the pullback conditions are met (setup is ready)
* **BUY** = A bullish candle confirms the setup near EMA 21
(bullish candle definition is configurable)
### Built-in status panel
A small panel shows the current state:
* Long-only ON/OFF (EMA200)
* Trend valid / not valid (21 vs 50)
* Pullback near/far (EMA21 proximity)
* Volume dries up / not
* Buys OK / No buys (relative to EMA50)
### Notes
* This is an **indicator**, not a complete trading strategy.
* Signals are meant to be used with proper risk management and market structure.
* Works on any asset (crypto, forex, stocks) — best results typically appear in **clean trending markets**.
---
If you want, I can also add a short “one-liner” summary for the first line of the description (more marketing style), or a more technical version for serious quants.
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.
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.
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.