OPEN-SOURCE SCRIPT
Cập nhật 5 EMA Strategy

This indicator identifies red candles that form completely above the 5 EMA and evaluates the very next candle for confirmation or possible reversal. It is designed to allow only one active signal at a time to reduce noise. More features and detailed usage instructions will be added in future updates.
Phát hành các Ghi chú
5 EMA Strategy is a clean price action indicator that identifies potential short reversal setups after a red candle forms completely above the 5 EMA.🔍 How It Actually Works (Step by Step)
1️⃣ The Setup Candle (Alert Candle)
A setup forms when:
The candle is red
The entire candle (low included) is above the 5 EMA
This tells you:
Price is extended above short-term average
Sellers showed up
Momentum may be shifting
When this happens:
An AC label appears above the candle
The system locks and waits for the next candle only
2️⃣ The Confirmation Candle (Very Next Candle Only)
The next candle decides everything. There are four possible outcomes:
✅ Outcome 1 – Possible Reversal (PR)
If the next candle closes below the close of the red alert candle, that shows bearish continuation strength.
The AC label turns into PR.
This is your short signal.
The logic here is simple:
Sellers proved they are still in control.
⏳ Outcome 2 – Awaiting Confirmation (AC Continues)
If the next candle closes inside the range of the alert candle and does NOT close above the alert candle’s body high:
The signal stays valid.
You are in “waiting for possible reversal” mode.
This means:
Momentum has not broken the setup yet.
Structure is still intact.
❌ Outcome 3 – Invalidation
If the next candle closes above:
The high of the alert candle
OR
The body high of the alert candle
The AC label is deleted.
Setup is canceled.
We reset to waiting mode.
This prevents chasing weak setups.
🔄 Reset Logic
Once price touches or closes back at the 5 EMA, the system unlocks and allows new setups.
No stacking.
No overlapping signals.
Clean structure only.
📊 The Tiny Status Table
The table shows:
AC = Awaiting Confirmation
PR = Possible Reversal
WAIT = No active setup
Color logic:
Red background → waiting
Orange → setup forming
Green → reversal confirmed
It does not affect the logic.
It just keeps you aware of the system state at all times.
🎯 How To Take Trades Using This
This is designed mainly for short setups.
🧠 Basic Trade Idea
Wait for AC to print.
Watch the next candle.
If it becomes PR:
Enter short at close of confirmation candle
Or enter on small pullback
📉 Stop Loss Ideas
You can place stop:
Above the alert candle high
OR
Above the confirmation candle high
OR
Based on ATR
Conservative traders use alert candle high.
Aggressive traders use tighter stop.
🎯 Take Profit Ideas
You can target:
1:1 or 1:2 risk reward
Previous structure low
5 EMA touch
Trailing stop above lower highs
It works best in:
Trending markets
After overextended moves above 5 EMA
Intraday momentum sessions
⚡ Ideal Market Conditions
This performs best when:
Market is trending
Price pulls away from 5 EMA
Momentum shows exhaustion
You trade lower timeframes like 5m / 15m / 1h
It is not designed for choppy sideways markets.
🧩 Why This Is Different
Most reversal indicators trigger immediately.
This one forces discipline.
It says:
“Wait one more candle. Let the market prove it.”
That extra confirmation removes a lot of false entries.
🔥 Who This Is For
Traders who like EMA based systems
Traders who trade price action
Scalpers looking for structured entries
Swing traders looking for short pullback exhaustion
Phát hành các Ghi chú
added stop loss and take profit signals.Phát hành các Ghi chú
Table status changes.Phát hành các Ghi chú
Merged short and long into one script with a mode selector without changing any trading logic.Phát hành các Ghi chú
note changePhát hành các Ghi chú
Added Daily Performance Tracker showing profitable trades, loss trades, and TP ladder levels (100% → 1000%).Added new settings/customization
Phát hành các Ghi chú
- Added alerts for AC signal creation (PUTS, CALLS, and ANY) using alertcondition() so TradingView can trigger notifications when a new AC setup appears.- Cleaned and optimized the script by removing unnecessary comments, shortening repeated code with reusable helper functions, and improving readability without changing the original logic or functionality.
Phát hành các Ghi chú
- table changesPhát hành các Ghi chú
Change Log:- Bug fix.
- Added a new RATIO column to the daily performance table showing current-day profit/loss ratio for PUTS, CALLS, and TOTAL.
- Added a 30D AVG column for the last 30 trading days’ profit ratio.
Phát hành các Ghi chú
Added trailing stop-loss (dashed line).Phát hành các Ghi chú
- Updated Daily Performance TableMã 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.