This strategy combines the moving average indicator EMA and the overbought-oversold indicator RSI to determine trend direction and identify potential trend opportunities. When the fast EMA crosses above the slow EMA, it signals a bullish opportunity. When the fast EMA crosses below the slow EMA, it signals a bearish opportunity. RSI is used to filter out false breaks, only taking positions when it confirms the trend direction indicated by EMA.
The strategy is based on the following principles:
EMA can effectively smooth price data and identify trends. Crossovers between fast and slow EMA reveal trend formation and reversals.
RSI effectively identifies overbought and oversold levels. Combining RSI helps filter false signals from EMA crossovers. Only when EMA and RSI both confirm the trend will we enter a position.
Specifically, the fast EMA period is set to 8 and the slow EMA period is set to 24. A crossover of the fast EMA above the slow EMA generates a bullish signal, while a crossover below generates a bearish signal. The RSI period is set to 7. RSI above 70*(1-RSI threshold) indicates overbought levels and RSI below 30*(1+RSI threshold) indicates oversold levels. Only when both EMA and RSI signal bullish will we go long. Only when both signal bearish will we go short.
By combining the strengths of the EMA and RSI indicators, this strategy can effectively identify trend direction and filter out false signals. The main advantages are:
EMA smooths price and identifies trend while RSI determines overbought/oversold levels to filter false breaks.
Flexible parameter tuning for different assets.
Multiple indicators confirm and reduce false signals, improving win rate.
Simple and clear logic, easy to understand and implement for trend following.
Applicable to different timeframes for day trading or long-term holding.
There are also some risks to note for this strategy:
EMA may lag trend reversals and cause losses.
Improper RSI parameter setting may lead to missed trades.
Index products can whipsaw, triggering stop loss.
Trading costs also impact profits, optimize stop loss carefully.
Fundamentals not considered, risks being gamed by arbitrageurs.
We can mitigate risks by reasonable stop loss, optimizing RSI parameters, considering costs when setting profit targets and stop loss, etc.
The strategy can be enhanced in the following aspects:
Optimize EMA and RSI parameters to better fit different assets.
Add other filters like Bollinger Bands, KDJ to improve signal quality.
Incorporate fundamental factors to avoid arbitrage risks.
Combine with trendlines, supports/resistances for entry.
Optimize take profit and stop loss based on volatility and risk preference.
Backtest over longer timeframe and different assets to ensure robustness.
Overall this is a simple and practical trend following strategy. By combining EMA and RSI, it identifies trend direction effectively and filters out noise. With parameter tuning and integrating other tools, the strategy can be further improved. But no strategy eliminates losses entirely. Manage risks properly when using it for trend following.
/*backtest start: 2023-08-28 00:00:00 end: 2023-09-27 00:00:00 period: 1h basePeriod: 15m exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=2 strategy("MACD + RSI", overlay=true) src = input(close,"Source") //MACD len1 = input(8, title="MACD Fast Length") len2 = input(24, title="MACD Slow Length") ema1 = ema(src,len1) ema2 = ema(src,len2) div = ema1-ema2 long_macd = div>div[1] short_macd = div<div[1] //RSI len = input(7, minval=1, title="RSI Length") rsi_threshold = input(0.2,minval=0,maxval=0.5, title="RSI Threshold") rsi = rsi(src,len) long_rsi = rsi<30*(1+rsi_threshold) short_rsi = rsi>70*(1-rsi_threshold) //POSITIONING if (long_macd) if(long_rsi) strategy.entry("Long", strategy.long) if (short_macd) if(short_rsi) strategy.entry("Short", strategy.short)