
The Mean Reversion RSI(2) Momentum Breakout Trading Strategy with Moving Average Trend Filter is a quantitative trading system that combines short-term oversold indicators with long-term trend confirmation. This strategy primarily utilizes the extremely short-period (2-day) Relative Strength Index (RSI) to identify oversold market conditions, while incorporating a 200-day moving average as a trend filter to ensure trades are only executed within an overall uptrend. The strategy features a clearly defined profit target (the highest price of the previous two trading days) and a fixed holding period limit (5 trading days), without setting a fixed stop-loss, aiming to capture rebound opportunities after short-term price corrections.
The core concept of this strategy is based on the mean reversion characteristic of markets, particularly short-term pullbacks within strong uptrends. The specific implementation includes:
Entry Conditions:
Exit Conditions (meeting either one triggers exit):
No Fixed Stop-Loss Design:
The strategy is implemented in Pine Script language, using ta.rsi and ta.sma functions to calculate technical indicators, strategy.entry and strategy.close to manage trades, and variables to track entry prices and holding time.
After in-depth analysis, this strategy shows the following significant advantages:
Dual Confirmation Mechanism: The combination of RSI oversold signals and trend filters reduces the possibility of false signals
Clear Entry and Exit Rules: Strategy rules are simple and clear, easy to understand and execute, reducing the impact of subjective judgment
Trend Following: By filtering with the 200-day moving average, trades are only executed in long-term uptrends, improving win rates
Flexible Profit Targets: Using the highest price of the previous two trading days as a dynamic target adapts to different market environments
Time-Controlled Risk: The 5-day forced closing mechanism avoids long-term traps and ensures efficient capital turnover
Simple Operation: Few strategy parameters, easy to adjust and optimize, suitable for different traders’ needs
Reduced Monitoring Need: Clear automatic exit conditions reduce psychological pressure and monitoring requirements for traders
Despite the reasonable design, the strategy still has the following potential risks:
No Stop-Loss Risk: The lack of a fixed stop-loss is a double-edged sword that may lead to significant losses under extreme market conditions
Trend Reversal Risk: Even with prices above the 200-day moving average, markets can still experience sudden trend reversals
Parameter Sensitivity: RSI period and threshold settings significantly impact strategy performance
Time Risk: The 5-day fixed holding period may be too short or too long under certain market conditions
Liquidity Risk: In low-liquidity markets, it may be difficult to execute trades at ideal prices
Slippage and Trading Costs: The strategy does not consider slippage and commission costs in actual trading
Based on code analysis, the strategy has several potential optimization directions:
Dynamic RSI Threshold:
Multi-Period Trend Confirmation:
Money Management Optimization:
Adding Stop-Loss Mechanism:
Entry Optimization:
Exit Optimization:
Market Environment Filtering:
The Mean Reversion RSI(2) Momentum Breakout Trading Strategy with Moving Average Trend Filter is a quantitative trading strategy that combines short-term oversold indicators with long-term trend filtering. By identifying short-term pullback opportunities within strong uptrends, this strategy can capture profit opportunities from price rebounds with relatively controlled risk.
The main advantages of the strategy lie in its clear rules, simple operation, and higher win rates provided by the dual confirmation mechanism. At the same time, its fixed holding period and dynamic profit target design provide a good framework for capital management and risk control.
However, the lack of a fixed stop-loss mechanism is the main risk point of this strategy, which requires special attention in practical applications. There is still significant room for optimization through adding dynamic stop-losses, optimizing parameter settings, improving money management, and adding market environment filtering.
Overall, this is a reasonably designed mean reversion strategy, particularly suitable for application in clearly defined uptrending markets, and offers high reference value for traders seeking to capture short-term pullback opportunities.
/*backtest
start: 2024-07-09 00:00:00
end: 2025-07-04 08:00:00
period: 3d
basePeriod: 3d
exchanges: [{"eid":"Futures_Binance","currency":"ETH_USDT"}]
*/
//@version=5
strategy("RSI(2) with MA200 + Target + Close after 5 Days (No Stop Loss)", overlay=true,
default_qty_type=strategy.percent_of_equity, default_qty_value=100,
initial_capital=1000, currency=currency.EUR)
// === PARAMETERS ===
rsi_threshold = 25
rsi_period = 2
valid_days = 5 // Auto-close after 5 useful candles
// === BASE CALCULATIONS ===
rsi = ta.rsi(close, rsi_period)
ma200 = ta.sma(close, 200)
trend_ok = close > ma200
// === ENTRY CONDITION ===
entry_condition = rsi < rsi_threshold and trend_ok
// === TAKE PROFIT LEVEL ===
max_2days = math.max(high[1], high[2])
// === POSITION MANAGEMENT VARIABLES ===
var float entry_price = na
var int bars_since_entry = na
if entry_condition and strategy.opentrades == 0
strategy.entry("RSI(2) Long", strategy.long)
entry_price := close
bars_since_entry := 0
// === TIME COUNTER ===
bars_since_entry := strategy.opentrades > 0 ? (na(bars_since_entry) ? 1 : bars_since_entry + 1) : na
time_expired = bars_since_entry >= valid_days
// === EXIT ON TARGET OR TIME ===
target_hit = high >= max_2days
if strategy.opentrades > 0 and (target_hit or time_expired)
reason = target_hit ? "🎯 Target Hit" : "⏳ Time Expired"
strategy.close("RSI(2) Long", comment=reason)
entry_price := na
bars_since_entry := na
// === VISUALIZATION — SIGNAL & LEVELS ===
plot(entry_condition ? close : na, title="Entry Signal", color=color.green, style=plot.style_circles, linewidth=2)
plot(strategy.opentrades > 0 ? max_2days : na, title="Take Profit Level", color=color.lime, linewidth=1)