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
142 lines of Pine Script v6 from Peak Reversal.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
Peak Reversal v3 detects momentum extremes when candles cross or trade completely outside the inner or outer channel bands. Users can customize the moving average type (EMA, SMA, RMA, VMA, HMA), band multipliers, signal sources (wick or close), and squeeze percentile parameters. Visual alerts highlight band crosses, free bars, and mean deviations, helping traders spot overextended price moves returning toward the baseline average.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
MA Type
string
EMA
maType
MA Length
int
20
keltnerEMAlength
ATR Length
int
14
atrLength
Inner
float
2
innerBandMultiplier
Outer
float
3
outerBandMultiplier
Show Mean EMA?
bool
true
showMeanEMA
Inner Band?
bool
true
showInnerBand
Outer Band?
bool
false
showOuterBand
Show Only First Signal
bool
true
showOnlyFirstSignal
Band Crosses?
bool
true
showBandCross
Free Bars?
bool
false
showFreeBars
Show Mean Deviations?
bool
true
showDeviations
Show all 21 settings
Setting
Type
Default
Variable
Signal Band
string
Inner
signalBand
Signal Source
string
Wick
signalSource
Max Momentum Bars
int
5
maxMomentumBars
Up
color
color.new(#ee5e48, 0)
upMomentumColor
Down
color
color.new(#25bc3e, 0)
downMomentumColor
Show Squeeze?
bool
true
showSqueeze
Lookback
int
200
squeezeLength
Percentile
float
5.0
squeezeThresh
Squeeze Color
color
color.new(color.gray, 60)
squeezeColorInput
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.
Dynamic Extreme Channels & Reversals tracks evolving price highs and lows to plot adaptive channel bands and a midline directly on the price chart. When no new extremes occur within the specified lookback window, the channel boundaries interpolate toward price
This indicator classifies price action into four distinct market regimes: Trend, Expansion, Compression, or Mean Reversion. It determines states using a simplified Hurst exponent estimate, ADX slope thresholds, and realized volatility measurements. Based on th
This indicator classifies market behavior into momentum, mean-reversion, noise, or mixed regimes. It fuses four statistical predictability sensors—Variance Ratio across multiple horizons, return autocorrelation, Hurst exponent approximation, and fractal effici
This indicator plots an ATR-based Chandelier Exit trailing stop on the price chart. It tracks a long stop under recent highs and a short stop above recent lows, then switches direction when price crosses the opposite stop. Buy and sell labels mark those flips.
The Momentum Setup is a multi-indicator visual tool designed for trend and momentum analysis directly on the price chart. It combines Relative Strength Index (RSI), Money Flow Index (MFI), Commodity Channel Index (CCI), Supertrend, and a 250-bar percentage cha
This indicator plots trade entry and exit signals on the price chart by combining Bollinger Bands with optional filter conditions. It calculates standard Bollinger Bands along with RSI, Aroon, and moving average filters. Reversal signals trigger when price bre