Indicator · Pine Script v4 · On the chart

Exhaustion Levels (InSilico)

by theonetrade· code credited to InSilico

Exhaustion Levels (InSilico) detects price exhaustion points and key horizontal support and resistance levels directly on the price chart.

View on GitHub

GitHub stars34on the repository
Pine versionv4older, still runs
Lines of code60
Settings5inputs
LicenceMIT
Last update2 weeks ago8 Nov 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  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

60 lines of Pine Script v4 from assets/indicator/bit-exact/leledc_levels_is_jB2a9GAV.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

leledc_levels_is_jB2a9GAV.pine
//@version=4
//©InSilico
//Extension/Mod for - https://www.tradingview.com/script/2rZDPyaC-Leledc-Exhaustion-Bar/ 
study(title='Exhaustion levels (InSilico)',shorttitle="LeveLeledc (InSilico)",overlay=true)

//Input
exhaustionSwitch= input(true,title="Show exhaustion Bar point (Arrows)")
levelSwitch= input(true,title="Show exhaustion levels (Lines)")
length= input(40,"Exhaustions swing length")
bars= input(10,"Exhaustion bar count")
thicknesSwitch = input(2, title="Line Thickness(Level thickness)")

//Fun Lele
Lelec(bars, len) =>
    bindex = int(na)
    bindex := nz(bindex[1], 0)
    sindex = int(na)
    sindex := nz(sindex[1], 0)
    return = 0
    bindex := close > close[4] ? bindex + 1 : bindex
    sindex := close < close[4] ? sindex + 1 : sindex
    if bindex > bars and close < open and high >= highest(high, len)
        bindex := 0
        return := -1
        return
    else
        if sindex > bars and close > open and low <= lowest(low, len)
            sindex := 0
            return := 1
            return

//Out C
Lelex = Lelec(bars, length)

//Out Bar 
highlel = Lelex == -1 ? high : na 
lowlel =  Lelex == 1 ? low : na

//Out level
resistance = float(na)
support = float(na)
resistance := close < open and Lelex  ? high : resistance[1]
support := close > open and Lelex  ? low : support[1]

//Color 
rescol=color.new(#ff0000, 1)
highcol = change(resistance) == 0 ? rescol: na
supcol=color.new(#138484, 1)
lowcol = change(support) == 0 ? supcol : na

//Plot Bar
plotshape(exhaustionSwitch ? lowlel : na,title="Up", color=color.new(#00ff00,1), location=location.belowbar, style=shape.triangleup, size=size.normal)
plotshape(exhaustionSwitch ? highlel: na,title="Down", color=color.new(#ff0000, 1), location=location.abovebar, style=shape.triangledown, size=size.normal)

//Plot level
plot(levelSwitch ? resistance :na, title="Reistance Level", style=plot.style_line, color=highcol, linewidth=thicknesSwitch)
plot(levelSwitch ? support :na, title="Support Level", style=plot.style_line, color=lowcol, linewidth=thicknesSwitch)

alertcondition(lowlel, "Up")
alertcondition(highlel, "Down")

Overview

Exhaustion Levels (InSilico) tracks consecutive price closes relative to four bars prior, identifying reversal conditions when count thresholds are met alongside new swing highs or swing lows. When triggered, the indicator displays bullish or bearish exhaustion arrows and projects support and resistance lines from the swing extremes. Settings allow customization of the swing lookback length, bar count threshold, and line thickness, as well as toggling arrows and level lines.

Details

Published by

theonetrade on GitHub

Code credit

InSilico, as written in the script's header

Type

Indicator, Pine Script v4

Draws

On the price chart

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.

Topics

algorithmic-tradingbacktestingbitcoinccxtcrypto-tradingllm-agentoffline-backtestingopen-source-tradingpine-scriptpine-to-pythonpinescriptpynecorepythonquantquantitative-financestrategy-backtestingtechnical-analysistrading-indicatorstrading-strategiestradingview

Settings

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

SettingTypeDefaultVariable
Show exhaustion Bar point (Arrows)booltrueexhaustionSwitch
Show exhaustion levels (Lines)booltruelevelSwitch
Exhaustions swing lengthint40length
Exhaustion bar countint10bars
Line Thickness(Level thickness)int2thicknesSwitch
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

257 stars

This indicator plots auto trade signals for E-mini S&P 500 futures on the price chart. It computes an EMA200 filter along with day ETH RTH session levels and percentage-based entry zones. Signals trigger CALL or PUT cases when price crosses defined thresholds

Indicator v6 TrendSupport & resistance
Updated 2 months ago · None stated GitHub repository of Auto Trade Futures ES
55 stars

This Pine Script indicator overlays institutional liquidity levels on the price chart. It identifies order block levels using pivot highs and lows, then draws mean reversion lines from the 20 and 50 period simple moving averages, a volatility range midpoint pr

Indicator v6 Support & resistanceSMC / ICT / price action Repaints
Updated 7 months ago · Apache-2.0 GitHub repository of AAPL Institutional Liquidity Grid
9 stars

This indicator plots an anchored MIDAS support and resistance curve from launch-anchored volume-weighted price on the price chart. It adds two configurable volume-weighted standard-deviation, ATR, or hybrid bands and a topfinder or bottomfinder accelerated exh

Indicator v6 Mean reversionSupport & resistance Repaints
Updated 4 weeks ago · MIT GitHub repository of MIDAS 2.0 [WavesUnchained]

VWAP Trader NXi

by eddiebelaval
7 stars

VWAP Trader NXi calculates a daily session-anchored Volume Weighted Average Price along with two custom standard deviation bands on the main price chart. It plots the core VWAP, Value Area bands, outer extension zones with background shading, and the previous

Indicator v5 VolumeVolatility & bands
Updated 4 months ago · None stated GitHub repository of VWAP Trader NXi
5 stars

Calculates daily classical pivot points from the previous day's high, low, and close to identify intraday reversal setups within a defined trading session. Long signals fire when price comes within a configurable tick proximity to S1 and prints a bullish recla

Indicator v5 Support & resistanceMean reversion
Updated 6 months ago · Custom licence GitHub repository of Path C — Pivot-Point Bounce (Demo)
5 stars

This indicator implements Tom DeMark's TD Sequential methodology on the price chart to detect trend exhaustion and reversal zones. It counts the Setup phase of nine consecutive bars comparing closes to four bars prior, tracks setup perfection, and advances int

Indicator v6 TrendMean reversion
Updated 1 year ago · None stated GitHub repository of TD Sequential - Official DeMark

More Support & resistance scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

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

Compare brokers