AlgoHive
Examples

RSI Mean Reversion Strategy

A mean reversion strategy using RSI oversold and overbought levels.

Mean reversion strategies bet that extreme moves will reverse. This strategy buys when RSI indicates oversold conditions and sells at overbought levels.

Visual Overview

RSI Mean Reversion

Buy oversold RSI bounces, exit at overbought

Loading strategy viewer...

The Concept

Buy when RSI drops below 30 (oversold) and starts recovering.

Sell when RSI reaches overbought (>70) or price hits stops/targets.

The idea: prices often bounce after becoming extremely oversold.

Strategy Setup

Data Source

SettingValue
Aliasbtc
TypeExchange
SymbolBTC-USD
Timeframe4h

Analysis Block: indicators

rsi: RSI(btc.close, 14)
oversold: rsi < 30
overbought: rsi > 70
rsi_turning_up: rsi > rsi[1] AND oversold[1]

Analysis Block: signals

entry_signal: indicators.rsi_turning_up
exit_signal: indicators.overbought

What each output does:

  • rsi — 14-period RSI
  • oversold — True when RSI < 30
  • overbought — True when RSI > 70
  • rsi_turning_up — True when RSI starts rising after being oversold
  • exit_signal — True when RSI reaches overbought

Entry Rule

SettingValue
DirectionLong
Marketbtc
Whensignals.entry_signal

Risk Management

Stop Loss:

SettingValue
TypeStop Loss
Level3% (percentage)

Tight stop because we expect quick bounces.

Take Profit (Conditional):

SettingValue
TypeTake Profit
LevelConditional
Whensignals.exit_signal

Exit when RSI hits overbought rather than a fixed price target.

Trailing Stop:

SettingValue
TypeTrailing Stop
Trail %2%

Protect profits as price rises.

Building This Strategy

Follow these steps to recreate this strategy in the Studio:

  1. Add a Data Source — Click "Add Data Source", select Exchange, and configure BTC-USD on 4h timeframe with alias btc
  2. Create Analysis Block — Add an Advanced block named indicators with RSI calculations
  3. Add Entry Rule — Create a Long entry that triggers on indicators.rsi_turning_up
  4. Set Risk Management — Add Stop Loss at 3%, conditional Take Profit on overbought, and 2% trailing stop

Variations

Add Bollinger Band Confirmation

More confident when RSI oversold aligns with lower Bollinger band:

bb: BOLLINGER(btc.close, 20, 2)
at_lower_band: btc.close < bb.lower
double_confirmation: indicators.oversold AND at_lower_band

Volume Filter

Require above-average volume for stronger signals:

volume_spike: btc.volume > SMA(btc.volume, 20) * 1.2
entry: indicators.rsi_turning_up AND volume_spike

Trend Filter

Only take mean reversion trades in an uptrend:

uptrend: btc.close > EMA(btc.close, 200)
entry: indicators.rsi_turning_up AND uptrend

Short Side

Add short entries for overbought conditions:

rsi_turning_down: rsi < rsi[1] AND overbought[1]

Entry when: rsi_turning_down with direction: short

Dynamic RSI Levels

Use parameters to adjust levels:

oversold: rsi < $oversold_level
overbought: rsi > $overbought_level

Best Conditions

Mean reversion works best in:

  • Ranging markets — Clear support/resistance levels
  • Higher timeframes — Less noise
  • After extended moves — Deep oversold readings

Mean reversion struggles in:

  • Strong trends — "Oversold can get more oversold"
  • High volatility — Stops get hit frequently
  • Low liquidity — Harder to execute at expected prices

Backtest Considerations

MetricTypical Range
Win Rate55-65%
Profit Factor1.1-1.5
Avg Win2-4%
Avg Loss2-3%

Mean reversion strategies often have higher win rates but smaller average wins compared to trend-following strategies.

Tips

  1. Don't catch falling knives — Wait for RSI to turn, not just hit 30
  2. Use tight stops — If the bounce doesn't happen quickly, the thesis is wrong
  3. Consider trend context — Mean reversion in a downtrend is fighting momentum
  4. Multiple confirmations — RSI + Bollinger + Volume = stronger signal

On this page