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)
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.