OPEN-SOURCE SCRIPT
EMA 5 & E 20 Cross [Dr.K.C.Prakash]

📊 Indicator Name:
EMA 5 & E 20 Cross [Dr.K.C.Prakash]
🧠 Concept:
This is a trend-following indicator built on the concept of Exponential Moving Average (EMA) crossovers, specially optimized for 1-minute intraday trading. It is designed to eliminate noise and provide accurate BUY and SELL signals during strong, sustained market trends — not during minor or choppy price moves.
⚙️ How It Works:
🔹 EMAs Used:
EMA 5: A short-term exponential moving average to quickly track price momentum.
EMA 20: A medium-term exponential moving average to act as a smoother trend anchor.
🔹 Signal Logic:
Buy Signal:
Triggered when EMA 5 stays above EMA 20 for a specified number of consecutive candles (default: 3).
This confirms a sustained bullish crossover.
A green label with "BUY" appears below the bar.
Sell Signal:
Triggered when EMA 5 stays below EMA 20 for the same number of consecutive candles.
This confirms a sustained bearish crossover.
A red label with "SELL" appears above the bar.
🧹 Noise Reduction:
Filters out fakeouts or “whipsaws” by requiring that the crossover condition persists for a number of bars (minTrendBars).
Greatly improves signal reliability, especially on 1-minute timeframes, where price action is volatile.
📈 Visual Elements:
Orange Line: EMA 5
Blue Line: EMA 20
Green “BUY” label: Below candle when bullish trend confirms
Red “SELL” label: Above candle when bearish trend confirms
✅ Ideal Use Case:
Intraday trading
1-minute timeframe
Traders who want to catch longer trends and ignore short-term fluctuations
🔧 Customizable Inputs:
Short EMA Length: Default 5 (can be changed)
Long EMA Length: Default 20 (can be changed)
Min Bars to Confirm Trend: Default 3 (defines how long crossover must persist to count as a valid signal)
🛠️ Add-On Ideas (Optional Enhancements):
Would you like to add any of the following?
📢 TradingView alerts (Buy/Sell notifications)
🔁 Re-entry signals in same trend direction
📊 Combine with Volume filter or ATR breakout confirmation
EMA 5 & E 20 Cross [Dr.K.C.Prakash]
🧠 Concept:
This is a trend-following indicator built on the concept of Exponential Moving Average (EMA) crossovers, specially optimized for 1-minute intraday trading. It is designed to eliminate noise and provide accurate BUY and SELL signals during strong, sustained market trends — not during minor or choppy price moves.
⚙️ How It Works:
🔹 EMAs Used:
EMA 5: A short-term exponential moving average to quickly track price momentum.
EMA 20: A medium-term exponential moving average to act as a smoother trend anchor.
🔹 Signal Logic:
Buy Signal:
Triggered when EMA 5 stays above EMA 20 for a specified number of consecutive candles (default: 3).
This confirms a sustained bullish crossover.
A green label with "BUY" appears below the bar.
Sell Signal:
Triggered when EMA 5 stays below EMA 20 for the same number of consecutive candles.
This confirms a sustained bearish crossover.
A red label with "SELL" appears above the bar.
🧹 Noise Reduction:
Filters out fakeouts or “whipsaws” by requiring that the crossover condition persists for a number of bars (minTrendBars).
Greatly improves signal reliability, especially on 1-minute timeframes, where price action is volatile.
📈 Visual Elements:
Orange Line: EMA 5
Blue Line: EMA 20
Green “BUY” label: Below candle when bullish trend confirms
Red “SELL” label: Above candle when bearish trend confirms
✅ Ideal Use Case:
Intraday trading
1-minute timeframe
Traders who want to catch longer trends and ignore short-term fluctuations
🔧 Customizable Inputs:
Short EMA Length: Default 5 (can be changed)
Long EMA Length: Default 20 (can be changed)
Min Bars to Confirm Trend: Default 3 (defines how long crossover must persist to count as a valid signal)
🛠️ Add-On Ideas (Optional Enhancements):
Would you like to add any of the following?
📢 TradingView alerts (Buy/Sell notifications)
🔁 Re-entry signals in same trend direction
📊 Combine with Volume filter or ATR breakout confirmation
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.