OPEN-SOURCE SCRIPT
Swing Trend: 200 EMA + ATR (Long Only)

🧠 Strategy Concept:
This swing trading strategy is designed specifically for Ethereum (ETH) on timeframes like 4H or Daily, but it is flexible enough to work across other volatile assets or timeframes with some tuning.
The system combines trend confirmation via a 200-period Exponential Moving Average (EMA) with volatility filtering using the Average True Range (ATR). It aims to capture medium-term bullish swings while avoiding weak or sideways markets.
📈 Entry Logic:
A long position is opened only when both of the following conditions are true:
Price is above the 200 EMA
→ This confirms a longer-term uptrend.
Price is also greater than (EMA + ATR × Multiplier)
→ This volatility buffer ensures we only enter after strong directional moves and avoid minor pullbacks or choppy price action.
The ATR multiplier is customizable (default = 1.5).
ATR length defaults to 14 periods.
✅ This double filter helps reduce false positives and ensures that entries happen only in strong bullish momentum.
💡 Exit Logic:
The exit rule is simple:
Close the position when the price crosses below the 200 EMA, indicating a potential trend reversal or weakening trend.
This approach:
Protects gains by exiting early during trend breakdowns.
Avoids unnecessary complexity like static stop-loss or take-profit.
You can manually add SL/TP logic if desired.
⚙️ Strategy Settings:
EMA Length = 200
ATR Length = 14
ATR Multiplier = 1.5
Position Sizing = 10% of equity per trade (adjustable in strategy settings)
📊 Use Case:
Optimized for swing traders who prefer long-only positions in bull markets.
Particularly effective on ETHUSDT, but applicable to BTC, SOL, etc.
Best used during periods of trending market behavior — avoid sideways or range-bound conditions.
🛠️ Customization Tips:
Timeframe: Works best on 4H or 1D charts; avoid low timeframes unless volatility filtering is adjusted.
EMA Length: Increase to 300–400 for more conservative filtering.
ATR Multiplier: Raise to 2–2.5 to reduce frequency of entries and increase selectivity.
Stop-loss / Take-profit: You can add static or trailing SL/TP for tighter risk control if desired.
📌 Strategy Summary:
Feature Setting
Trend Filter 200 EMA
Volatility Gate ATR (×1.5)
Entry Type Long only
Exit Trigger Close < EMA
Style Trend-following Swing Strategy
This swing trading strategy is designed specifically for Ethereum (ETH) on timeframes like 4H or Daily, but it is flexible enough to work across other volatile assets or timeframes with some tuning.
The system combines trend confirmation via a 200-period Exponential Moving Average (EMA) with volatility filtering using the Average True Range (ATR). It aims to capture medium-term bullish swings while avoiding weak or sideways markets.
📈 Entry Logic:
A long position is opened only when both of the following conditions are true:
Price is above the 200 EMA
→ This confirms a longer-term uptrend.
Price is also greater than (EMA + ATR × Multiplier)
→ This volatility buffer ensures we only enter after strong directional moves and avoid minor pullbacks or choppy price action.
The ATR multiplier is customizable (default = 1.5).
ATR length defaults to 14 periods.
✅ This double filter helps reduce false positives and ensures that entries happen only in strong bullish momentum.
💡 Exit Logic:
The exit rule is simple:
Close the position when the price crosses below the 200 EMA, indicating a potential trend reversal or weakening trend.
This approach:
Protects gains by exiting early during trend breakdowns.
Avoids unnecessary complexity like static stop-loss or take-profit.
You can manually add SL/TP logic if desired.
⚙️ Strategy Settings:
EMA Length = 200
ATR Length = 14
ATR Multiplier = 1.5
Position Sizing = 10% of equity per trade (adjustable in strategy settings)
📊 Use Case:
Optimized for swing traders who prefer long-only positions in bull markets.
Particularly effective on ETHUSDT, but applicable to BTC, SOL, etc.
Best used during periods of trending market behavior — avoid sideways or range-bound conditions.
🛠️ Customization Tips:
Timeframe: Works best on 4H or 1D charts; avoid low timeframes unless volatility filtering is adjusted.
EMA Length: Increase to 300–400 for more conservative filtering.
ATR Multiplier: Raise to 2–2.5 to reduce frequency of entries and increase selectivity.
Stop-loss / Take-profit: You can add static or trailing SL/TP for tighter risk control if desired.
📌 Strategy Summary:
Feature Setting
Trend Filter 200 EMA
Volatility Gate ATR (×1.5)
Entry Type Long only
Exit Trigger Close < EMA
Style Trend-following Swing Strategy
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。