Strategy vault / Mean reversion
Advanced Dual Moving Average Momentum Reversal Strategy RSI and Bollinger Bands Synergy Trading System
This strategy is an advanced technical analysis trading system that combines the Relative Strength Index (RSI) and Bollinger Bands (BB). It seeks high-probability reversal trading opportunities in overbought and…

Overview
This strategy is an advanced technical analysis trading system that combines the Relative Strength Index (RSI) and Bollinger Bands (BB). It seeks high-probability reversal trading opportunities in overbought and oversold market areas by synergistically using these two indicators. The strategy employs a 20-period moving average as the Bollinger Bands basis line, with 2 standard deviations for the upper and lower bands, while using a 14-period RSI for momentum analysis, generating trading signals when RSI breaks through 30/70 key levels and price touches the Bollinger Bands boundaries.
Strategy Principles
The core logic is built on the synergistic effect of two main technical indicators:
- Bollinger Bands use a 20-period simple moving average as the middle band, with upper and lower bands at 2 standard deviations, identifying price volatility range.
- RSI uses a 14-period setting, with 30 as oversold and 70 as overbought levels, determining market momentum status.
- Long conditions require: RSI breaking above 30 and price touching or below the lower Bollinger Band.
- Short conditions require: RSI breaking below 70 and price touching or above the upper Bollinger Band.
- Exit conditions include: RSI breaking opposite extremes or price breaking the Bollinger Band middle line.
Strategy Advantages
- Dual confirmation mechanism: Combining RSI and Bollinger Bands provides more reliable trading signals.
- Strong adaptability: Bollinger Bands automatically adjust bandwidth based on market volatility.
- Comprehensive risk control: Clear entry and exit conditions prevent overtrading.
- Good visualization: Strategy provides clear visual indicators for market state understanding.
- Parameter adjustability: Key parameters can be optimized for different market characteristics.
Strategy Risks
- Choppy market risk: May generate frequent false breakout signals in sideways markets.
- Trend market risk: Reversal signals might lead to premature exits in strong trends.
- Parameter sensitivity: Different market environments may require different parameter settings.
- Slippage risk: Actual execution prices may deviate from signal prices in less liquid markets.
- Systematic risk: May face significant drawdowns during extreme market volatility.
Strategy Optimization Directions
- Add trend filters: Introduce additional trend indicators to avoid counter-trend trades.
- Optimize parameter adaptation: Develop dynamic parameter adjustment mechanisms.
- Enhance risk management: Add dynamic stop-loss and profit target settings.
- Incorporate volume analysis: Integrate volume indicators to improve signal reliability.
- Develop market environment recognition: Build market state classification system for parameter adjustment.
Summary
This strategy builds a complete trading system through the synergy of RSI and Bollinger Bands. It provides clear entry and exit signals while maintaining good risk control mechanisms. Though inherent risks exist, continuous optimization and improvement enable the strategy to maintain stable performance across different market environments. The modular design also provides a solid foundation for future optimization and expansion.
Source Pine Script
/*backtest
start: 2024-10-31 00:00:00
end: 2025-02-18 08:00:00
period: 30m
basePeriod: 30m
exchanges: [{"eid":"Binance","currency":"SOL_USDT"}]
*/
//@version=5
strategy("RSI + Bollinger Bands Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// Bollinger Bands Settings
bbLength = input.int(20, title="BB Length")
bbStdDev = input.float(2.0, title="BB Standard Deviation")
basis = ta.sma(close, bbLength)
dev = bbStdDev * ta.stdev(close, bbLength)
upperBB = basis + dev
lowerBB = basis - dev
// Plot Bollinger Bands
plot(basis, color=color.orange, title="BB Basis")
plot(upperBB, color=color.blue, title="Upper Bollinger Band")
plot(lowerBB, color=color.blue, title="Lower Bollinger Band")
fill(plot(upperBB), plot(lowerBB), color=color.blue, transp=90, title="BB Fill")
// RSI Settings
rsiLength = input.int(14, title="RSI Length")
rsiOverbought = input.int(70, title="RSI Overbought Level")
rsiOversold = input.int(30, title="RSI Oversold Level")
rsi = ta.rsi(close, rsiLength)
// Plot RSI on separate pane
hline(rsiOverbought, "Overbought", color=color.red)
hline(rsiOversold, "Oversold", color=color.green)
plot(rsi, color=color.purple, title="RSI", linewidth=2, display=display.none) // Hidden on main chart
// Long Condition: RSI crosses above oversold and price touches lower BB
longCondition = ta.crossover(rsi, rsiOversold) and close <= lowerBB
if (longCondition)
strategy.entry("Long", strategy.long)
// Short Condition: RSI crosses below overbought and price touches upper BB
shortCondition = ta.crossunder(rsi, rsiOverbought) and close >= upperBB
if (shortCondition)
strategy.entry("Short", strategy.short)
// Exit Long: RSI crosses above overbought or price crosses above basis
exitLong = ta.crossunder(rsi, rsiOverbought) or close >= basis
if (exitLong)
strategy.close("Long")
// Exit Short: RSI crosses below oversold or price crosses below basis
exitShort = ta.crossover(rsi, rsiOversold) or close <= basis
if (exitShort)
strategy.close("Short")
Published by ianzeng123 on the FMZ strategy square · last modified 2025-02-27. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Advanced-Dual-Moving-Average-Momentum-Reversal-Strategy-RSI-and-Bollinger-Bands-Synergy-Trading-System.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- Advanced 15 Minute Chart Trading Signal StrategyPine Script · Mean reversion · 3h
- Advanced Quantitative Trading Strategy Combining RSI Divergence and Moving AveragesPine Script · Mean reversion · 1h
- Bollinger Bands Stochastic RSI Extreme Strategy BBSR Extreme StrategyPine Script · Mean reversion · 1h
- Dual Moving Average RSI Synergy Options Quantitative Trading StrategyPine Script · Mean reversion · 1h
- Gods Bollinger Bands RSI Trading StrategyPine Script · Mean reversion · 1d
- Multi Indicator Reversal Point Capture Trading StrategyPine Script · Mean reversion · 1d