This strategy looks for mean-reversion entries when RSI crosses back through the oversold or overbought levels, or recovers from more extreme RSI readings.
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
78 lines of Pine Script v5 from 3_RSI_Extremes/3_RSI_Extremes.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
Optional divergence confirmation can require a price and RSI mismatch before entry. It opens one long or short only when flat, then sets an ATR-based stop and a take-profit scaled by the risk-to-reward ratio. The 200-period SMA trend filter is calculated but is not applied to the entry conditions. Orders and exits are drawn on the price chart.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
RSI Length
int
14
rsiLength
Overbought Level
float
75
rsiOverbought
Oversold Level
float
25
rsiOversold
Extreme Overbought
float
85
rsiExtremeOB
Extreme Oversold
float
15
rsiExtremeOS
Use RSI Divergence Confirmation
bool
true
useDivergence
Trend Filter MA Length
int
200
maLength
Use Trend Filter (MA)
bool
true
useTrendFilter
ATR Length
int
14
atrLength
ATR Multiplier for SL
float
2.0
atrMult
Risk:Reward Ratio
float
2.0
rrRatio
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.
The Stock and NQ Futures Convergence Strategy identifies trading opportunities by comparing the Relative Strength Index of the active chart stock against NQ futures. It enters a long position when NQ RSI rises above the upper threshold while the stock RSI stay
This strategy evaluates market conditions using a combination of WaveTrend, RSI, Stochastic RSI, and a custom Money Flow Index calculation inspired by VuManChu. It enters long positions when multiple oscillators hit oversold thresholds and generate an upward c
This strategy calculates the Z-score divergence of return spreads between two forex assets such as EURUSD and GBPUSD. It enters long positions when the Z-score falls below the entry threshold with confirmed uptrend from EMA, RSI and MACD filters plus sufficien
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
Mean Reversion Strategy is an overlay strategy that identifies pullbacks using a long-term EMA, RSI, and candlestick patterns. It generates long signals when a bullish engulfing candle forms below the EMA while RSI is oversold, and short signals when a bearish
This strategy draws on the price chart and combines Stochastic RSI, the Money Flow Index, and an exponential moving average to open long or short trades. Longs use the lower oscillator thresholds and shorts use the upper ones, with direction limited to longs,