OPEN-SOURCE SCRIPT
Telah dikemas kini 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.
Nota Keluaran
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
Nota Keluaran
added stop loss and take profit signals.Nota Keluaran
Table status changes.Nota Keluaran
Merged short and long into one script with a mode selector without changing any trading logic.Nota Keluaran
note changeNota Keluaran
Added Daily Performance Tracker showing profitable trades, loss trades, and TP ladder levels (100% → 1000%).Added new settings/customization
Nota Keluaran
- 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.
Nota Keluaran
- table changesNota Keluaran
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.
Nota Keluaran
Added trailing stop-loss (dashed line).Nota Keluaran
- Updated Daily Performance TableSkrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.