Indicator · Pine Script v6 · Own pane

I_extremes

by GammaExpansion

I_extremes plots a collection of built-in extreme, pivot, ranking and statistical series in a separate pane.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code40
Settings0inputs
LicenceMIT
Last update7 days ago23 Oct 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

40 lines of Pine Script v6 from packages/golden/fixtures/indicator/v6/I_extremes/source.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

source.pine
//@version=6
indicator("I_extremes")
cond = close > open
sma20 = ta.sma(close, 20)
plot(bar_index, "bar_index")
plot(ta.highest(20), "highest20")
plot(ta.lowest(20), "lowest20")
plot(ta.highest(close, 20), "highest20_close")
plot(ta.lowest(close, 20), "lowest20_close")
plot(ta.highest(close, 1), "highest1")
plot(ta.highestbars(20), "highestbars20")
plot(ta.lowestbars(20), "lowestbars20")
plot(ta.highestbars(close, 20), "highestbars20_close")
plot(ta.pivothigh(5, 5), "pivothigh55")
plot(ta.pivotlow(5, 5), "pivotlow55")
plot(ta.pivothigh(close, 3, 2), "pivothigh_close32")
plot(ta.valuewhen(cond, close, 0), "valuewhen0")
plot(ta.valuewhen(cond, close, 1), "valuewhen1")
plot(ta.valuewhen(cond, close, 5), "valuewhen5")
plot(ta.valuewhen(cond, bar_index, 0), "valuewhen_barindex")
plot(ta.barssince(cond), "barssince")
plot(ta.barssince(not cond), "barssince_not")
plot(ta.barssince(ta.crossover(close, sma20)), "barssince_cross")
plot(ta.crossover(close, sma20) ? 1 : 0, "crossover")
plot(ta.crossunder(close, sma20) ? 1 : 0, "crossunder")
plot(ta.cross(close, sma20) ? 1 : 0, "cross")
plot(ta.crossover(close, 200) ? 1 : 0, "crossover_const")
plot(ta.rising(close, 3) ? 1 : 0, "rising3")
plot(ta.falling(close, 3) ? 1 : 0, "falling3")
plot(ta.percentrank(close, 20), "percentrank20")
plot(ta.percentile_linear_interpolation(close, 20, 50), "pct_linear_50")
plot(ta.percentile_nearest_rank(close, 20, 50), "pct_nearest_50")
plot(ta.percentile_nearest_rank(close, 20, 90), "pct_nearest_90")
plot(ta.median(close, 20), "median20")
plot(ta.mode(math.round(close), 20), "mode20_rounded")
plot(ta.range(close, 20), "range20")
plot(ta.max(close), "max_alltime")
plot(ta.min(close), "min_alltime")
plot(ta.cum(volume), "cum_volume")
plot(ta.correlation(close, volume, 20), "correlation20")

Overview

I_extremes draws 20-bar highest and lowest values, pivot highs and lows, value-when and bars-since results, and flags for close crossing a 20-period simple moving average. It also plots percent rank, percentiles, median, mode, range, all-time maximum and minimum, cumulative volume and a 20-bar close-volume correlation. There are no inputs and no trade signals.

Details

Published by

GammaExpansion on GitHub

Draws

Separate pane below the 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.

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

BTC Multiples

by readysetcryptocodes
43 stars

BTC Multiples calculates and displays Bitcoin macro valuation metrics in a separate pane, including the Mayer Multiple, Stock-to-Flow Multiple, Difficulty Multiple, and Puell Multiple. Each valuation multiple features configurable overvalued and undervalued th

Indicator v4 Moving averagesSupport & resistance
Updated 2 years ago · None stated GitHub repository of BTC Multiples

MACD Breakout

by jerryinyang
5 stars

MACD Breakout builds a higher-timeframe MACD from preset fast and slow lengths using SMA or EMA, and marks support and resistance zones from histogram sensitivity. Optional filters require zero-line agreement, higher-timeframe direction, and linear-regression

Indicator v4 Oscillators & momentumMoving averages
Updated 2 years ago · None stated GitHub repository of MACD Breakout

Noob's Indicators

by InNoobWeTrust
4 stars

This Pine Script indicator plots multiple exponential moving averages in a separate pane for technical analysis. It calculates Elliott wave EMAs using Fibonacci wave counts of 34 and 89, plus 200-session and golden ratio lines. Additional Pythagorean cloud lev

Indicator v5 Moving averagesSupport & resistance
Updated 2 days ago · None stated GitHub repository of Noob's Indicators

Cipher B

by diehardyearone
3 stars

Cipher B is a multi-indicator plotting WaveTrend oscillator lines and signals alongside Stochastic RSI, MFI area with color bars, and buy sell marks. It draws all elements in a separate pane. WaveTrend calculates using SMMA and EMA on source like ohlc4 with ad

Indicator v6 Oscillators & momentumMoving averages
Updated 1 year ago · None stated GitHub repository of Cipher B
3 stars

This indicator demonstrates debugging visualization patterns for Pine Script. It plots value tracking with mean, min, and max reference lines, condition markers using shapes and arrows, historical comparisons with standard deviation bands, multi-series overlay

Indicator v5 Moving averagesVolatility & bands
Updated 7 months ago · None stated GitHub repository of Debugging Visualization Patterns

This indicator renders Ichimoku cloud components consisting of conversion line, base line, leading span A and leading span B. It tracks Tenkan-Kijun crosses and assigns a numeric score to each based on whether the cross occurs below, inside or above the Kumo c

Indicator v5 Moving averagesSupport & resistance
Updated 5 months ago · None stated GitHub repository of Ichimoku Cloud Weight Original

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