OPEN-SOURCE SCRIPT
EMA Cross Strategy only Long

📈 EMA Cross Strategy – Only Long
Simple. Clean. Powerful. Designed for strong uptrends.
This is a long-only trend-following strategy based on the classic crossover of Exponential Moving Averages (EMAs). It’s designed for growth stocks and trending assets where upward momentum dominates.
⚙️ How it works:
Entry: when the Fast EMA crosses above the Slow EMA
Exit: when the Fast EMA crosses below the Slow EMA
No shorts, no reversals – just pure trend riding.
By default, the strategy uses 50/100 EMA, which has performed exceptionally well on stocks like NVIDIA (NVDA). These settings can be easily customized to fit your preferred asset or timeframe.
📊 Backtest Example – NVIDIA (NVDA, 1D timeframe)
Test parameters:
Initial capital: $10,000
Order size: 50% of equity per trade (adjustable in settings)
Results:
Net profit: +$2,037,563.63 USD
Gross profit: $2,127,432.33
Gross loss: $89,868.70
Max equity growth: $2,708,648.75 (+99.63%)
Drawdown: 20.00%
Buy & Hold profit: +$30,636,000 USD (but with far more exposure)
The strategy dramatically outperformed passive holding on a risk-adjusted basis, while keeping drawdowns and trade count under control.
🔧 Customization & Risk Management
In the Strategy Settings, you can adjust:
EMA lengths (default: 50 fast, 100 slow)
Order size as a % of equity (e.g., reduce below 50% to lower drawdown)
Backtest range and asset type (works well on growth stocks and trending commodities)
Try this on assets with strong bullish cycles like NVDA, AAPL, MSFT, or Gold (XAU/USD).
⚠️ Disclaimer
This script is for educational and backtesting purposes only. It is not financial advice. Please do your own research and test carefully before trading live.
Simple. Clean. Powerful. Designed for strong uptrends.
This is a long-only trend-following strategy based on the classic crossover of Exponential Moving Averages (EMAs). It’s designed for growth stocks and trending assets where upward momentum dominates.
⚙️ How it works:
Entry: when the Fast EMA crosses above the Slow EMA
Exit: when the Fast EMA crosses below the Slow EMA
No shorts, no reversals – just pure trend riding.
By default, the strategy uses 50/100 EMA, which has performed exceptionally well on stocks like NVIDIA (NVDA). These settings can be easily customized to fit your preferred asset or timeframe.
📊 Backtest Example – NVIDIA (NVDA, 1D timeframe)
Test parameters:
Initial capital: $10,000
Order size: 50% of equity per trade (adjustable in settings)
Results:
Net profit: +$2,037,563.63 USD
Gross profit: $2,127,432.33
Gross loss: $89,868.70
Max equity growth: $2,708,648.75 (+99.63%)
Drawdown: 20.00%
Buy & Hold profit: +$30,636,000 USD (but with far more exposure)
The strategy dramatically outperformed passive holding on a risk-adjusted basis, while keeping drawdowns and trade count under control.
🔧 Customization & Risk Management
In the Strategy Settings, you can adjust:
EMA lengths (default: 50 fast, 100 slow)
Order size as a % of equity (e.g., reduce below 50% to lower drawdown)
Backtest range and asset type (works well on growth stocks and trending commodities)
Try this on assets with strong bullish cycles like NVDA, AAPL, MSFT, or Gold (XAU/USD).
⚠️ Disclaimer
This script is for educational and backtesting purposes only. It is not financial advice. Please do your own research and test carefully before trading live.
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.