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
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.