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 indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
298 lines of Pine Script v6 from Indicators/%R Trend Exhaustion .pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
%R Trend Exhaustion [upslidedown] combines a standard fast %R with a slow-period %R to identify extended trends and subsequent exhaustion breaks around overbought and oversold thresholds. Drawn in a separate pane with optional overlay or candle modes, it plots trend start indicators, reversal signals, and optional line crossovers. Key settings adjust the exhaustion threshold, calculation formulas, period lengths, and smoothing types. Live bar signals may shift before bar close.
Dual-period Williams %R calculation
Trend start and exhaustion break detection
Multiple display modes including oscillator and candle
Configurable smoothing algorithms and moving averages
Gradient shading for overbought and oversold zones
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Cold Color
color
#2466A7
bullcol
Hot Color
color
#CA0017
bearcol
Display Mode
string
mode1
mode
Formula
string
formula1
formula
Source
source
close
src
Exhaustion Threshold
int
20
threshold
Smoothing Type
string
ema
smoothType
Average Formula MA
int
3
average_ma
Fill Gradients in OB/OS Zone
bool
true
plot_shading
Highlight Crossovers
bool
false
plot_crosses
Plot Zero Line Crosses
bool
false
plot_zero_crosses
Fast Length
int
21
shortLength
Show all 30 settings
Setting
Type
Default
Variable
Fast Smoothing Length
int
7
shortSmoothingLength
Slow Length
int
112
longLength
Slow Smoothing Length
int
3
longSmoothingLength
Bull trend start ⏹
bool
true
bullStartOn
bullStartTxt
string
%RTE bull trend start ⏹
bullStartTxt
Bear trend start ⏹
bool
true
bearStartOn
bearStartTxt
string
%RTE bear trend start ⏹
bearStartTxt
Bull trend break ▼
bool
true
bullReversalOn
bullReversalTxt
string
%RTE bull trend break ▼
bullReversalTxt
Bear trend break ▲
bool
true
bearReversalOn
bearReversalTxt
string
%RTE bear trend break ▲
bearReversalTxt
Bull cross ⏺
bool
false
bullCrossOn
bullCrossTxt
string
Bullish crossover
bullCrossTxt
Bear cross ⏺
bool
false
bearCrossOn
bearCrossTxt
string
Bearish crossover
bearCrossTxt
Enable Long Deals
bool
true
longDealsEnabled
Enable Short Deals
bool
true
shortDealsEnabled
Strategy Entry
string
strategy1
strategyEntry
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 indicator plots the Schaff Trend Cycle in a separate pane. It subtracts a slow exponential moving average from a fast one, applies a stochastic cycle twice, and smooths each result to form a 0–100 oscillator. Line color follows the slope, or the upper and
This indicator calculates a modified MACD oscillator and signal line alongside a trend EMA filter, plotting the output as a stylized column histogram in a separate pane. Instead of plotting true MACD distance, it quantifies positive and negative histogram mome
This indicator plots the Average Directional Index in a separate pane and colors the line teal or maroon according to whether plus DI is above minus DI. A horizontal key level and a silver background mark periods when ADX exceeds that threshold. With labels en
Standardized Trend Map calculates series momentum relative to active price range across 40 distinct lookback periods ranging from 2 to 80 bars on an exponential moving average source. Each standardized calculation rounds to an integer values of -1, 0, or 1 to
This indicator calculates and displays the Average Directional Index (ADX) as a column histogram in a separate pane. It evaluates market trend strength by calculating directional movement metrics based on specified smoothing and DI length inputs. When the ADX
Multi-Timeframe Analysis Suite calculates trend direction and momentum conditions across five user-selected timeframes using moving averages, RSI, and Stochastic oscillators. It evaluates moving average slope and oscillator levels to compute trend alignment, m