OPEN-SOURCE SCRIPT
ES EMA Pullback System

Filter 1 — Trend Direction
This is determined by the EMA stack.
Bullish
EMA9 > EMA21 > EMA50
Bearish
EMA9 < EMA21 < EMA50
Illustration:
UPTREND
price
↑
│ ●
│ ●
│ ●
│
EMA9
EMA21
EMA50
Filter 2 — Pullback to the Moving Average
You want price to return to the EMA area.
Trend move
↑
│
│
│
│
│
↓ pullback
Example:
price
│
│ ●
│ ●
│ ●
│ ●
│●
└────────────
EMA9
This is where new traders panic and exit.
Professionals enter here.
Filter 3 — Momentum Candle
We need proof that the trend is resuming.
Example bearish signal candle:
│
│ ▲ pullback
│ ▲
│▲
│
│ ▼ big red candle
│ ▼
This candle shows sellers are back in control.
5️⃣ Bearish Trade Example
Step-by-step:
Step 1 — Confirm downtrend
EMA9
EMA21
EMA50
All sloping down.
Step 2 — Wait for pullback
Price retraces toward the EMA zone.
downtrend
↓
↓
↑ pullback
↑
Step 3 — Momentum candle
A bearish candle appears.
pullback
↑
↑
▼ SELL candle
Step 4 — Enter trade
ENTRY = close of signal candle
Step 5 — Stop and target
Your system uses ATR risk management.
Example:
Entry: 5000
Stop: 5008
Target: 4984
That gives 1:2 reward/risk.
Illustration:
stop
│
│
entry ─────┼────────
│
│
target
6️⃣ Bullish Trade Example
The rules are the mirror image.
Step 1 — Confirm uptrend
EMA9 above EMA21
EMA21 above EMA50
Step 2 — Wait for pullback
trend up
↑
↑
↓ pullback
Step 3 — Bullish momentum candle
pullback
↓
↓
▲ strong green candle
Step 4 — Enter
buy at close of signal candle
Step 5 — Stop and target
target = 2x stop distance
7️⃣ When NOT to Trade
Your strategy fails in chop.
Example:
price
│ ▲
│ ▼
│ ▲
│ ▼
│ ▲
This sideways action causes:
false signals
stop outs
drawdown
Warning signs:
🚫 EMAs tangled together
🚫 No clear direction
🚫 Small candles
Illustration:
EMA9
EMA21
EMA50
all tangled
Avoid trading then.
8️⃣ Ideal Trading Session
ES moves most during:
9:30 – 11:30 AM
1:30 – 4:00 PM
Worst time:
11:30 – 1:30 (lunch chop)
9️⃣ Trade Management
Your system is designed for:
Win rate ≈ 35-40%
Reward ≈ 2x risk
That means:
Many small losses
Few big winners
Example sequence:
Loss
Loss
Win
Loss
Win
Win
Still profitable.
🔑 The Core Idea
Your strategy exploits one simple behavior:
Trends
pause
then continue
You enter during the pause.
What a Perfect Setup Looks Like
trend
↓
↓
pullback
↑
↑
momentum candle
▼
ENTRY
This is determined by the EMA stack.
Bullish
EMA9 > EMA21 > EMA50
Bearish
EMA9 < EMA21 < EMA50
Illustration:
UPTREND
price
↑
│ ●
│ ●
│ ●
│
EMA9
EMA21
EMA50
Filter 2 — Pullback to the Moving Average
You want price to return to the EMA area.
Trend move
↑
│
│
│
│
│
↓ pullback
Example:
price
│
│ ●
│ ●
│ ●
│ ●
│●
└────────────
EMA9
This is where new traders panic and exit.
Professionals enter here.
Filter 3 — Momentum Candle
We need proof that the trend is resuming.
Example bearish signal candle:
│
│ ▲ pullback
│ ▲
│▲
│
│ ▼ big red candle
│ ▼
This candle shows sellers are back in control.
5️⃣ Bearish Trade Example
Step-by-step:
Step 1 — Confirm downtrend
EMA9
EMA21
EMA50
All sloping down.
Step 2 — Wait for pullback
Price retraces toward the EMA zone.
downtrend
↓
↓
↑ pullback
↑
Step 3 — Momentum candle
A bearish candle appears.
pullback
↑
↑
▼ SELL candle
Step 4 — Enter trade
ENTRY = close of signal candle
Step 5 — Stop and target
Your system uses ATR risk management.
Example:
Entry: 5000
Stop: 5008
Target: 4984
That gives 1:2 reward/risk.
Illustration:
stop
│
│
entry ─────┼────────
│
│
target
6️⃣ Bullish Trade Example
The rules are the mirror image.
Step 1 — Confirm uptrend
EMA9 above EMA21
EMA21 above EMA50
Step 2 — Wait for pullback
trend up
↑
↑
↓ pullback
Step 3 — Bullish momentum candle
pullback
↓
↓
▲ strong green candle
Step 4 — Enter
buy at close of signal candle
Step 5 — Stop and target
target = 2x stop distance
7️⃣ When NOT to Trade
Your strategy fails in chop.
Example:
price
│ ▲
│ ▼
│ ▲
│ ▼
│ ▲
This sideways action causes:
false signals
stop outs
drawdown
Warning signs:
🚫 EMAs tangled together
🚫 No clear direction
🚫 Small candles
Illustration:
EMA9
EMA21
EMA50
all tangled
Avoid trading then.
8️⃣ Ideal Trading Session
ES moves most during:
9:30 – 11:30 AM
1:30 – 4:00 PM
Worst time:
11:30 – 1:30 (lunch chop)
9️⃣ Trade Management
Your system is designed for:
Win rate ≈ 35-40%
Reward ≈ 2x risk
That means:
Many small losses
Few big winners
Example sequence:
Loss
Loss
Win
Loss
Win
Win
Still profitable.
🔑 The Core Idea
Your strategy exploits one simple behavior:
Trends
pause
then continue
You enter during the pause.
What a Perfect Setup Looks Like
trend
↓
↓
pullback
↑
↑
momentum candle
▼
ENTRY
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.