This strategy is a trend following system based on MACD and RSI crossover signals, combined with Bollinger Bands for market volatility analysis. The core approach is to capture trend reversal points through the coordination of MACD golden/death crosses and RSI overbought/oversold zones, while using Bollinger Bands to confirm price volatility ranges for more robust trading signals.
The strategy employs a triple technical indicator filtering mechanism:
Entry conditions require MACD golden cross and RSI in lower zone (<50), indicating potential market rebound from oversold areas. Exit conditions require MACD death cross and RSI in higher zone (>50), suggesting weakening upward momentum and possible correction.
The strategy constructs a relatively complete trend following trading system through the combined application of MACD, RSI, and Bollinger Bands. It has solid theoretical foundation and practical feasibility, but still requires parameter optimization and risk control improvements based on specific market characteristics. Through the suggested optimization directions, the strategy has potential for better stability and profitability. The system is suitable for investors seeking medium to long-term trend opportunities, but users need to fully understand its limitations and implement proper risk management.
/*backtest start: 2019-12-23 08:00:00 end: 2024-12-18 08:00:00 period: 1d basePeriod: 1d exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=5 strategy("MACD, RSI, Bollinger Bands Strategy", overlay=true) // Input parameters for MACD fastLength = input.int(12, title="MACD Fast Length") slowLength = input.int(26, title="MACD Slow Length") signalLength = input.int(9, title="MACD Signal Length") // Input parameters for RSI rsiLength = input.int(14, title="RSI Length") // Input parameters for Bollinger Bands bbLength = input.int(20, title="Bollinger Band Length") bbMult = input.float(2.0, title="Bollinger Band Multiplier") // MACD calculation [macdLine, signalLine, _] = ta.macd(close, fastLength, slowLength, signalLength) macdCrossUp = ta.crossover(macdLine, signalLine) macdCrossDown = ta.crossunder(macdLine, signalLine) // RSI calculation rsi = ta.rsi(close, rsiLength) // Bollinger Bands calculation bbBasis = ta.sma(close, bbLength) bbUpper = bbBasis + bbMult * ta.stdev(close, bbLength) bbLower = bbBasis - bbMult * ta.stdev(close, bbLength) // Plot Bollinger Bands plot(bbBasis, color=color.blue, title="Bollinger Band Basis") plot(bbUpper, color=color.green, title="Upper Bollinger Band") plot(bbLower, color=color.red, title="Lower Bollinger Band") // Entry condition: MACD crosses signal line from below and RSI < 50 enterLong = macdCrossUp and rsi < 50 // Exit condition: MACD crosses signal line from above and close touches the Bollinger Band middle line exitLong = macdCrossDown and rsi> 50 // Strategy logic if (enterLong and strategy.position_size == 0) strategy.entry("Buy", strategy.long) if (exitLong and strategy.position_size > 0) strategy.close("Buy")