OPEN-SOURCE SCRIPT
🔁 EMA 3/21 Crossover Strategy — Exit on Opposite Signal

EMA 3/21 Crossover Strategy — Exit on Opposite Signal
This strategy enters trades based on a crossover between two exponential moving averages:
Buy Entry: When the 3-period EMA crosses above the 21-period EMA
Sell Entry: When the 3-period EMA crosses below the 21-period EMA
Exit Rule: Positions are exited only when an opposite signal occurs (i.e., a new crossover in the other direction)
Key Features:
Designed for trend-following setups
Uses ATR-based SL/TP lines for visual reference only (trades do not auto-close at SL/TP)
Suitable for manual or automated trading logic with high trade clarity
Can be applied on any timeframe and any liquid instrument (Forex, crypto, indices, etc.)
Recommended Use:
Combine with volume or session filters for improved signal quality
Ideal for traders seeking clear entry/exit rules with minimal noise
Best on trending instruments and medium timeframes (USDJPY; Daily)
This strategy enters trades based on a crossover between two exponential moving averages:
Buy Entry: When the 3-period EMA crosses above the 21-period EMA
Sell Entry: When the 3-period EMA crosses below the 21-period EMA
Exit Rule: Positions are exited only when an opposite signal occurs (i.e., a new crossover in the other direction)
Key Features:
Designed for trend-following setups
Uses ATR-based SL/TP lines for visual reference only (trades do not auto-close at SL/TP)
Suitable for manual or automated trading logic with high trade clarity
Can be applied on any timeframe and any liquid instrument (Forex, crypto, indices, etc.)
Recommended Use:
Combine with volume or session filters for improved signal quality
Ideal for traders seeking clear entry/exit rules with minimal noise
Best on trending instruments and medium timeframes (USDJPY; Daily)
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.