Indicator · Pine Script v6 · On the chart

Top Bottom Reversal

by kasutu

A signal-only indicator that looks for exhaustion after a run of consecutive same-colour candles ending in a doji.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code98
Settings18inputs
LicenceNone stated
Last update2 weeks ago12 Oct 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

A top needs bullish candles with RSI overbought and a new high versus recent bars; a bottom mirrors this. A separate news mode flags unusually large candles followed shortly by a doji, with an optional time window. It draws markers and boxes on the price chart and does not simulate trades.

Details

Published by

kasutu on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Mean reversion, Candlestick patterns, Oscillators & momentum

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Consecutive Candlesint4runLen
Doji Body % of Rangefloat30dojiPct
Use RSIbooltrueuseRsi
RSI Lengthint14rsiLen
Overboughtfloat70rsiHi
Oversoldfloat30rsiLo
Use Price ExtensionbooltrueuseExt
Extension Lookbackint20extLen
Use News CandlesbooltrueuseNews
News Candle Size (x largest prior range)float2.0newsMult
News Lookbackint20newsLen
News Candle Min Body %float50newsBody
Show all 18 settings
SettingTypeDefaultVariable
Doji Within (candles)int3newsWait
Only Inside News Time WindowboolfalseuseNewsTime
News Time Windowsession0830-0900newsSess
Window TimezonestringAmerica/New_YorknewsTz
Mark News CandlesbooltrueshowNews
Show Signal BoxbooltrueshowBox
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.

Similar Pine Scripts

285 stars

Mean Reversion Study is an indicator that identifies trade setups combining exponential moving averages, RSI extremes, and engulfing candlestick patterns. It highlights bullish setups when a bullish engulfing candle forms below the EMA while RSI is oversold, a

Indicator v4 Mean reversionCandlestick patterns
Updated 3 years ago · None stated GitHub repository of Mean Reversion Study

RSI Swing Signal

by Web3Degenerate
2 stars

This indicator plots an RSI oscillator in a separate pane and marks long and short setups when RSI is oversold or overbought and a swing low or swing high fractal forms with a reversing candle. It sizes a stop from the recent extreme plus an ATR multiple, then

Indicator v5 Oscillators & momentumCandlestick patterns
Updated 2 years ago · None stated GitHub repository of RSI Swing Signal

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

Indicator v4 Volatility & bandsOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Bollinger Bands Winner IND [Alorse]

Raschke Patterns

by TradersPost
218 stars

This overlay indicator marks Linda Raschke short-term bar setups on the price chart. It flags Turtle Soup and Turtle Soup plus one false breakouts of a prior extreme, 80-20 bars, inside bars, failed inside-bar breakouts, outside up and down bars, NR4 and NR7 c

Indicator v6 Candlestick patternsBreakout Repaints
Updated 3 months ago · None stated GitHub repository of Raschke Patterns
147 stars

This indicator combines Bollinger Bands, RSI, Stochastic RSI, and volume spike detection to identify mean-reversion conditions during range-bound market regimes. It calculates Bollinger Band width to identify low-volatility states and triggers buy or sell sign

Indicator v5 Oscillators & momentumVolatility & bands
Updated 6 weeks ago · MIT GitHub repository of BTC Dec 2025 — Range + Gamma Flush

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers