
This strategy is a trend-following trading system based on multiple technical indicators, combining EMA crossovers, momentum indicators, and volume confirmation to identify high-probability trading opportunities. Through appropriate stop-loss and profit targets, the strategy pursues higher reward-to-risk ratios while controlling risks. It is primarily designed for trend trading on larger timeframes and can be applied to multiple markets including cryptocurrencies, forex, and stocks.
The core logic of the strategy is based on the following key elements: 1. Uses 50-day and 200-day exponential moving averages (EMA) for trend direction determination, generating long signals when the short-term EMA crosses above the long-term EMA, and vice versa. 2. Incorporates Relative Strength Index (RSI) for momentum confirmation, with RSI above 50 indicating upward momentum and below 50 indicating downward momentum. 3. Validates trading signals through volume comparison with 1.5 times the 20-day average volume, ensuring trades are only executed during volume expansion. 4. Dynamically sets stop-loss positions based on 14-day Average True Range (ATR), placing stops 1.5 ATR below recent lows. 5. Implements a 3:1 reward-to-risk ratio for profit targeting, setting profit targets at three times the stop-loss distance.
The strategy constructs a robust trend-following system through triple confirmation mechanisms of EMA crossovers, RSI momentum, and volume. The 3:1 reward-to-risk ratio provides good profit potential, while the ATR-based dynamic stop-loss mechanism offers necessary risk protection. Although the strategy may underperform in ranging markets, through the suggested optimization directions, its adaptability and stability can be further enhanced.
/*backtest
start: 2024-02-10 00:00:00
end: 2025-02-08 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("EMA Crossover Strategy", overlay=true)
// Inputs
emaShortLength = input(50, title="Short EMA Length")
emaLongLength = input(200, title="Long EMA Length")
rsiLength = input(14, title="RSI Length")
rsiOverbought = input(70, title="RSI Overbought Level")
rsiOversold = input(30, title="RSI Oversold Level")
// Calculate EMAs
emaShort = ta.ema(close, emaShortLength)
emaLong = ta.ema(close, emaLongLength)
// Calculate RSI
rsi = ta.rsi(close, rsiLength)
// Volume Confirmation
volThreshold = ta.sma(volume, 20) * 1.5
// Calculate ATR
atrValue = ta.atr(14)
// Buy Condition
buyCondition = ta.crossover(emaShort, emaLong) and rsi > 50 and volume > volThreshold
if (buyCondition)
strategy.entry("Long", strategy.long)
// Sell Condition
sellCondition = ta.crossunder(emaShort, emaLong) and rsi < 50 and volume > volThreshold
if (sellCondition)
strategy.close("Long")
// Stop Loss & Take Profit
sl = low - atrValue * 1.5 // Stop loss below recent swing low
tp = close + (close - sl) * 3 // Take profit at 3x risk-reward ratio
strategy.exit("Take Profit", from_entry="Long", limit=tp, stop=sl)
// Plot EMAs
plot(emaShort, title="50 EMA", color=color.blue)
plot(emaLong, title="200 EMA", color=color.red)