1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.
Source Code
289 lines of Pine Script v5 from pinescript/RSI_MeanReversion_v37.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.
RSI Mean Reversion combines a relative strength index mean reversion model with ATR percentile thresholds to filter trades based on volatility conditions. Trading activities are controlled via configurable UTC time windows and skip hours. Dynamic take profit targets adapt to market volatility levels and specific time bonuses, while stop losses are placed using an ATR multiplier. Trades are forcibly closed after reaching a maximum bar holding period.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
RSI Period
int
10
rsiPeriod
RSI Oversold
int
42
rsiOversold
RSI Overbought
int
58
rsiOverbought
ATR Period
int
14
atrPeriod
ATR Percentile Lookback
int
100
atrLookback
Min ATR Percentile
float
20.0
atrMinPct
Max ATR Percentile
float
80.0
atrMaxPct
SL Multiplier (ATR)
float
1.5
slMult
TP Low Volatility
float
2.4
tpLow
TP Medium Volatility
float
3.0
tpMed
TP High Volatility
float
3.6
tpHigh
TP Time Bonus (12-16 UTC)
float
0.35
tpTimeBonus
Show all 21 settings
Setting
Type
Default
Variable
Trading Start Hour (UTC)
int
7
tradingStartHour
Trading End Hour (UTC)
int
22
tradingEndHour
Skip Hour (UTC)
int
12
skipHour
TP Bonus Start Hour
int
12
tpBonusStart
TP Bonus End Hour
int
16
tpBonusEnd
Max Holding (Bars)
int
46
maxHoldingBars
Show Entry Signals
bool
true
showSignals
Show SL/TP Lines
bool
true
showSLTP
Show Info Panel
bool
true
showInfo
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This strategy overlays the price chart to trade DAX futures during European market hours. It calculates exponential and simple moving averages, RSI, MACD, Bollinger Bands, ATR, and realized volatility to simulate VIX levels. Trades execute when session time fi
This mean-reversion trading strategy targets XAUUSD during the Asian trading session. It generates buy signals when price touches the lower Bollinger Band and RSI is oversold, and sell signals when price reaches the upper band and RSI is overbought. Trades are
This strategy trades Bitcoin mean reversion on the one-minute chart. It enters at Bollinger Band extremes when a short RSI is stretched, then requires ranging ADX on the one- and five-minute charts, a neutral five-minute RSI, and a flat five-minute EMA. Wick s
Alert BB + RSI [Alorse] is a multi-symbol mean-reversion strategy designed for cryptocurrency trading. It evaluates Bollinger Bands and the Relative Strength Index (RSI) across up to 20 user-defined ticker symbols simultaneously. The strategy enters long posit
A multi-timeframe Dollar Cost Averaging (DCA) trading strategy that combines signals from three RSI indicators, three CCI indicators, and Bollinger Bands. It places up to five weighted scale-in safety orders to lower the average entry price. The script offers
This strategy combines Bollinger Bands with a short RSI to fade moves that leave the bands and then return. A long requires the prior bar below the lower band and oversold, then a close back inside the band while RSI is between 30 and 50. Shorts mirror that at