
This strategy combines Bollinger Bands and RSI indicators to identify potential market reversals through a dual confirmation approach. It enters long positions when price crosses below the lower Bollinger Band while RSI confirms oversold conditions, and enters short positions when price crosses above the upper Bollinger Band while RSI confirms overbought conditions. The strategy implements both fixed and trailing stop mechanisms for risk management, aiming to capture high-probability reversal trading opportunities while protecting capital.
The strategy operates on the principle of mean reversion with momentum confirmation. Bollinger Bands help identify price extremes relative to recent volatility, while RSI confirms whether the market is actually overbought or oversold. The core principles include:
In code implementation, the strategy uses a 30-day period SMA to calculate the Bollinger Band centerline with a standard deviation multiplier of 2.0, while employing a 14-day period RSI as momentum confirmation. Short signals are triggered when price crosses above the upper band and RSI is above 70; long signals are triggered when price crosses below the lower band and RSI is below 30. Each trade applies both a fixed 40-point stop loss and a 40-point trailing stop to ensure risk control.
The Bollinger-RSI Dual Confirmation Mean Reversion Strategy with Trailing Stop Protection represents a thoughtful approach to trading market reversals. By combining the volatility-based signals from Bollinger Bands with momentum confirmation from RSI, the strategy aims to capture high-probability reversal points while filtering out false signals. The built-in risk management through fixed and trailing stops adds an important protective layer. While the strategy has clear strengths in identifying potential reversal points with dual confirmation, it could benefit from further optimization, particularly in adapting to different market conditions and implementing more sophisticated position sizing and exit mechanisms. Overall, this is a solid foundation for a mean reversion trading approach that balances signal quality with risk management.
/*backtest
start: 2024-08-11 00:00:00
end: 2025-08-09 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"ETH_USDT"}]
*/
//@version=5
strategy("BB & RSI Trailing Stop Strategy", overlay=true, initial_capital=10000)
// --- Inputs for Bollinger Bands, RSI, and Trade Management ---
bb_length = input.int(30, title="BB Length", minval=1)
bb_mult = input.float(2.0, title="BB StdDev", minval=0.001, maxval=50)
rsi_length = input.int(14, title="RSI Length", minval=1)
rsi_overbought = input.int(70, title="RSI Overbought Level", minval=1)
rsi_oversold = input.int(30, title="RSI Oversold Level", minval=1)
// We only need an input for the fixed stop loss now.
fixed_stop_points = input.int(40, title="Fixed Stop Loss Points", minval=1)
// --- Define Trailing Stop Value ---
// The trailing stop is hardcoded to 40 points as requested.
trailing_stop_points = 40
// --- Calculate Indicators ---
// Bollinger Bands
basis = ta.sma(close, bb_length)
dev = bb_mult * ta.stdev(close, bb_length)
upper = basis + dev
lower = basis - dev
// RSI
rsi_value = ta.rsi(close, rsi_length)
// --- Plot the Indicators on the chart ---
plot(basis, "Basis", color=color.new(color.gray, 0))
plot(upper, "Upper", color=color.new(color.red, 0))
plot(lower, "Lower", color=color.new(color.green, 0))
// --- Define Entry Conditions ---
// Short entry when price crosses upper band AND RSI is overbought
short_condition = ta.crossover(close, upper) and (rsi_value > rsi_overbought)
// Long entry when price crosses under lower band AND RSI is oversold
long_condition = ta.crossunder(close, lower) and (rsi_value < rsi_oversold)
// --- Execute Trades and Manage Exits ---
if (strategy.position_size == 0)
// Logic for SHORT trades
if (short_condition)
strategy.entry("BB/RSI Short", strategy.short)
// Logic for LONG trades
if (long_condition)
strategy.entry("BB/RSI Long", strategy.long)
// Apply the fixed stop loss and trailing stop to any open position
strategy.exit(id="Exit Order",
loss=fixed_stop_points,
trail_points=trailing_stop_points,
trail_offset=0)