OPEN-SOURCE SCRIPT
RSI Regime: Continuation vs Reversal

Indicator Description: RSI Regime (Continuation vs. Reversal)
This indicator uses the standard Relative Strength Index (RSI) to analyze market momentum and categorize it into three "regimes." Its primary goal is to help you determine if an overbought (OB) or oversold (OS) signal is likely to be a continuation of the current trend or a reversal point.
It also identifies "Fast Trend Starts," which are exceptionally fast and powerful moves from one extreme to the other.
Core Features & How to Read It
1. The Three RSI Regimes (Background Color) The script calculates a moving average (SMA) of the RSI to determine the dominant medium-term momentum. This is shown as the background color:
2. Overbought (OB) & Oversold (OS) Signals
When the RSI line crosses into the overbought (e.g., >70) or oversold (e.g., <30) zones, the indicator generates one of two types of signals:
A) Continuation Signals (Small Triangles: ►)
B) Reversal Signals (Small Labels: "OS→>50" / "OB→<50")
These labels appear after an OB/OS signal to confirm that a reversal has actually occurred.
"OS→>50 Reversal" (Aqua Label): Appears if the RSI becomes oversold and then recovers back above the 50 midline within a set number of bars. This confirms the oversold dip was a reversal point.
"OB→<50 Reversal" (Orange Label): Appears if the RSI becomes overbought and then falls back below the 50 midline within a set number of bars. This confirms the overbought peak was a reversal point.
3. "Fast Trend Starts" (Large Labels)
This is a unique feature that identifies the fastest percentile of market moves. It measures how many bars it takes for the RSI to go from one extreme to the other and flags when a move is in the top 5% (default) of all historical moves.
Key User Inputs
This indicator uses the standard Relative Strength Index (RSI) to analyze market momentum and categorize it into three "regimes." Its primary goal is to help you determine if an overbought (OB) or oversold (OS) signal is likely to be a continuation of the current trend or a reversal point.
It also identifies "Fast Trend Starts," which are exceptionally fast and powerful moves from one extreme to the other.
Core Features & How to Read It
1. The Three RSI Regimes (Background Color) The script calculates a moving average (SMA) of the RSI to determine the dominant medium-term momentum. This is shown as the background color:
- Bull Regime (Green Background): The RSI's average is high (e.g., above 55). The market is in a clear uptrend.
- Bear Regime (Red Background): The RSI's average is low (e.g., below 45). The market is in a clear downtrend.
- Range Regime (Orange Background): The RSI's average is in the middle. The market is consolidating or undecided.
2. Overbought (OB) & Oversold (OS) Signals
When the RSI line crosses into the overbought (e.g., >70) or oversold (e.g., <30) zones, the indicator generates one of two types of signals:
A) Continuation Signals (Small Triangles: ►)
- These signals suggest an OB/OS reading is just a "pause" and the main trend will likely continue.
- Orange ► (at the top): Appears when RSI becomes overbought while the market is already in a Bull Regime. This suggests the uptrend is strong, and this OB signal may not lead to a big drop.
- Teal ► (at the bottom): Appears when RSI becomes oversold while the market is already in a Bear Regime. This suggests the downtrend is strong, and this OS signal may not lead to a big bounce.
- (Note: An optional Price EMA filter can be enabled to make these signals more strict.)
B) Reversal Signals (Small Labels: "OS→>50" / "OB→<50")
These labels appear after an OB/OS signal to confirm that a reversal has actually occurred.
"OS→>50 Reversal" (Aqua Label): Appears if the RSI becomes oversold and then recovers back above the 50 midline within a set number of bars. This confirms the oversold dip was a reversal point.
"OB→<50 Reversal" (Orange Label): Appears if the RSI becomes overbought and then falls back below the 50 midline within a set number of bars. This confirms the overbought peak was a reversal point.
3. "Fast Trend Starts" (Large Labels)
This is a unique feature that identifies the fastest percentile of market moves. It measures how many bars it takes for the RSI to go from one extreme to the other and flags when a move is in the top 5% (default) of all historical moves.
- "Long Pullbacks (Fast OS→BullRange)" (Large Green Label): This powerful signal appears when the RSI moves from oversold (<30) all the way up to the bull range (>60) exceptionally fast. It identifies a very strong, fast, and decisive bounce that could signal the start of a new uptrend.
- "Short Pumps (Fast OB→BearRange)" (Large Red Label): This appears when the RSI moves from overbought (>70) all the way down to the bear range (<40) exceptionally fast. It identifies a very sharp, fast rejection or "pump-and-dump" that could signal the start of a new downtrend.
Key User Inputs
- RSI Length (14): The lookback period for the main RSI calculation.
- OB (70) / OS (30): The standard overbought and oversold levels.
- Bull/Bear Range Threshold (60/40): These are the levels used to confirm the "Fast Trend Starts." They are separate from the OB/OS levels.
- RSI Regime SMA Length (21): The lookback period for the moving average that determines the background regime.
- Use Price EMA filter (true): If checked, the small "Continuation" triangles will only appear if the price is also above (for bulls) or below (for bears) its own 50-period EMA.
- Fastest X% duration (5.0): This sets the percentile for the "Fast Trend Start" labels. 5.0 means it only flags moves that are in the fastest 5% of all recorded moves.
Script de código aberto
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Aviso legal
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Script de código aberto
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Aviso legal
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.