This strategy is a comprehensive trend-following trading system that integrates the Ichimoku Cloud, Relative Strength Index (RSI), and Moving Average Convergence Divergence (MACD). The strategy uses the cloud to determine overall trend direction, RSI to confirm price momentum, and MACD line crossovers to identify specific trading opportunities, enabling multi-dimensional market analysis and trading decisions.
The core logic is based on the synergy of three technical indicators:
Trading rules are as follows: Long Entry Conditions:
Short Entry Conditions:
Trend reversal risk: Consecutive stops possible at trend turning points. Suggestion: Increase trend confirmation timeframe requirements.
Range-bound market risk: Frequent trades may occur in sideways markets. Suggestion: Add signal filters, such as minimum movement requirements.
Lag risk: Indicators have inherent lag, potentially missing optimal entry points. Suggestion: Incorporate faster indicators or price action analysis.
Parameter sensitivity: Incorrect parameter settings may lead to poor performance. Suggestion: Optimize parameters through backtesting.
This strategy constructs a complete trend-following trading system by combining the Ichimoku Cloud, RSI, and MACD indicators. Its main strengths lie in its multiple confirmation mechanism and clear trading rules, while attention must be paid to risks at trend reversal points and in range-bound markets. Through dynamic parameter adjustment, market environment filtering, and risk management optimization, the strategy’s stability and profitability can be further enhanced.
/*backtest start: 2019-12-23 08:00:00 end: 2024-12-10 08:00:00 period: 1d basePeriod: 1d exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=5 strategy("Ichimoku + RSI + MACD Strategy", overlay=true) // Ichimoku Cloud parameters tenkanPeriod = 9 kijunPeriod = 26 senkouSpanBPeriod = 52 displacement = 26 // RSI parameters rsiLength = 14 rsiOverbought = 70 rsiOversold = 30 // MACD parameters [macdLine, signalLine, _] = ta.macd(close, 12, 26, 9) // Ichimoku calculations tenkanSen = (ta.highest(high, tenkanPeriod) + ta.lowest(low, tenkanPeriod)) / 2 kijunSen = (ta.highest(high, kijunPeriod) + ta.lowest(low, kijunPeriod)) / 2 senkouSpanA = (tenkanSen + kijunSen) / 2 senkouSpanB = (ta.highest(high, senkouSpanBPeriod) + ta.lowest(low, senkouSpanBPeriod)) / 2 chikouSpan = close[displacement] // Plotting Ichimoku Cloud plot(tenkanSen, color=color.red, title="Tenkan-sen") plot(kijunSen, color=color.blue, title="Kijun-sen") plot(senkouSpanA[displacement], color=color.green, title="Senkou Span A") plot(senkouSpanB[displacement], color=color.red, title="Senkou Span B") fill(plot(senkouSpanA[displacement]), plot(senkouSpanB[displacement]), color=color.new(color.green, 90), title="Cloud") // RSI calculation rsi = ta.rsi(close, rsiLength) // Long entry condition longCondition = (close > senkouSpanA) and (close > senkouSpanB) and (rsi > rsiOversold) and (ta.crossover(macdLine, signalLine)) if (longCondition) strategy.entry("Long", strategy.long) // Short entry condition shortCondition = (close < senkouSpanA) and (close < senkouSpanB) and (rsi < rsiOverbought) and (ta.crossunder(macdLine, signalLine)) if (shortCondition) strategy.entry("Short", strategy.short) // Exit conditions if (ta.crossunder(macdLine, signalLine) and strategy.position_size > 0) strategy.close("Long") if (ta.crossover(macdLine, signalLine) and strategy.position_size < 0) strategy.close("Short") // Plot RSI hline(rsiOverbought, "Overbought", color=color.red) hline(rsiOversold, "Oversold", color=color.green) plot(rsi, color=color.blue, title="RSI")