PROTECTED SOURCE SCRIPT
Best EMA Cross Strategy with TP/SL

Best EMA Cross Strategy with TP/SL
🧠 Core Concept:
This strategy combines three exponential moving averages (EMAs) to detect trend shifts and places trades with automatic take profit (TP) and stop loss (SL) levels based on percentage risk management.
📊 Indicators Used:
EMA 20 (Green): Short-term trend (for context only)
EMA 50 (Red): Medium-term trend
EMA 200 (Yellow): Long-term trend baseline
✅ Entry Logic:
🔼 Buy Entry (Long Position):
Triggered when:
EMA 50 crosses above EMA 200 (Golden Cross)
EMA 200 is sloping upward (shows long-term trend confirmation)
This suggests a strong bullish reversal or trend continuation.
🔽 Sell Entry (Short Position):
Triggered when:
EMA 50 crosses below EMA 200 (Death Cross)
EMA 200 is sloping downward (confirms long-term bearish trend)
This signals a potential market downturn or continuation of a bearish trend.
📏 Risk Management Logic:
Stop Loss (SL): Set as a fixed % away from entry price (default: 1%)
Take Profit (TP): Set using a Risk-Reward ratio (default: 2:1)
For example:
If SL = 1%, and RR = 2 → TP = 2%
These are set using strategy.exit() for accurate backtesting.
⚙️ Adjustable Parameters in Settings Panel:
Parameter Default Purpose
EMA 20 Length 20 Used for visual trend support
EMA Fast Length 50 Used in crossover (faster-moving average)
EMA Slow Length 200 Used in crossover (slower-moving average)
Stop Loss % 1.0 Distance from entry for SL
Risk-Reward Ratio 2.0 Multiplier for TP target
🔔 Alerts Included:
You’ll be notified when:
Golden Cross (buy opportunity)
Death Cross (sell opportunity)
Set alerts in TradingView from the Alerts panel.
✅ Best Timeframes:
1H, 4H, or Daily
Avoid using on extremely low timeframes (like 1m or 5m) without modification
📈 Strategy Use Tips:
Combine with support/resistance zones for higher probability entries
Use EMA 20 as a trailing dynamic SR level
Backtest on multiple assets and timeframes with adjusted SL/RR
Look for volume confirmation manually if needed
All backtested and very profitable
🧠 Core Concept:
This strategy combines three exponential moving averages (EMAs) to detect trend shifts and places trades with automatic take profit (TP) and stop loss (SL) levels based on percentage risk management.
📊 Indicators Used:
EMA 20 (Green): Short-term trend (for context only)
EMA 50 (Red): Medium-term trend
EMA 200 (Yellow): Long-term trend baseline
✅ Entry Logic:
🔼 Buy Entry (Long Position):
Triggered when:
EMA 50 crosses above EMA 200 (Golden Cross)
EMA 200 is sloping upward (shows long-term trend confirmation)
This suggests a strong bullish reversal or trend continuation.
🔽 Sell Entry (Short Position):
Triggered when:
EMA 50 crosses below EMA 200 (Death Cross)
EMA 200 is sloping downward (confirms long-term bearish trend)
This signals a potential market downturn or continuation of a bearish trend.
📏 Risk Management Logic:
Stop Loss (SL): Set as a fixed % away from entry price (default: 1%)
Take Profit (TP): Set using a Risk-Reward ratio (default: 2:1)
For example:
If SL = 1%, and RR = 2 → TP = 2%
These are set using strategy.exit() for accurate backtesting.
⚙️ Adjustable Parameters in Settings Panel:
Parameter Default Purpose
EMA 20 Length 20 Used for visual trend support
EMA Fast Length 50 Used in crossover (faster-moving average)
EMA Slow Length 200 Used in crossover (slower-moving average)
Stop Loss % 1.0 Distance from entry for SL
Risk-Reward Ratio 2.0 Multiplier for TP target
🔔 Alerts Included:
You’ll be notified when:
Golden Cross (buy opportunity)
Death Cross (sell opportunity)
Set alerts in TradingView from the Alerts panel.
✅ Best Timeframes:
1H, 4H, or Daily
Avoid using on extremely low timeframes (like 1m or 5m) without modification
📈 Strategy Use Tips:
Combine with support/resistance zones for higher probability entries
Use EMA 20 as a trailing dynamic SR level
Backtest on multiple assets and timeframes with adjusted SL/RR
Look for volume confirmation manually if needed
All backtested and very profitable
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
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 protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
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.