Indicator · Pine Script v6 · On the chart

Stats Table

by degenview

Displays a statistical summary table pinned to the top right of the price chart.

View on GitHub

GitHub stars3on the repository
Pine versionv6current
Lines of code27
Settings4inputs
LicenceGPL-3.0
Last updatetoday28 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

27 lines of Pine Script v6 from src/script_manager/demos/Stats Table.pine, published under GPL-3.0. Keep the author's credit and licence lines when you reuse it.

Stats Table.pine
//@version=6
// Example script bundled with DegenView. Edit it freely.
// A small table pinned to the corner of the chart. It is rebuilt on the last bar
// only, so history stays cheap.
indicator("Stats Table", overlay = true)

atrLength = input.int(14, "ATR length", minval = 1)
rangeBars = input.int(24, "Range bars", minval = 2)
volumeLength = input.int(20, "Volume average length", minval = 2)
trendLength = input.int(200, "Trend EMA length", minval = 2)

atrPercent = ta.atr(atrLength) / close * 100
rangePercent = (ta.highest(high, rangeBars) - ta.lowest(low, rangeBars)) / close * 100
volumeRatio = volume / ta.sma(volume, volumeLength)
trendUp = close > ta.ema(close, trendLength)

var table stats = table.new(position.top_right, 2, 4, border_width = 1)

if barstate.islast
    table.cell(stats, 0, 0, "ATR", text_color = color.white, bgcolor = color.gray)
    table.cell(stats, 1, 0, str.tostring(atrPercent, "#.00") + "%", text_color = color.white, bgcolor = color.gray)
    table.cell(stats, 0, 1, str.tostring(rangeBars) + "-bar range", text_color = color.white, bgcolor = color.gray)
    table.cell(stats, 1, 1, str.tostring(rangePercent, "#.00") + "%", text_color = color.white, bgcolor = color.gray)
    table.cell(stats, 0, 2, "Volume vs average", text_color = color.white, bgcolor = color.gray)
    table.cell(stats, 1, 2, str.tostring(volumeRatio, "#.00") + "x", text_color = color.white, bgcolor = volumeRatio > 1.5 ? color.orange : color.gray)
    table.cell(stats, 0, 3, "Trend", text_color = color.white, bgcolor = color.gray)
    table.cell(stats, 1, 3, trendUp ? "Up" : "Down", text_color = color.white, bgcolor = trendUp ? color.green : color.red)

Overview

Stats Table calculates key metrics including ATR percentage relative to price, high-low range percentage over a configurable bar count, relative volume compared to its simple moving average, and trend bias based on an exponential moving average. The table renders on the final bar to optimize performance. User settings allow customizing lookback lengths for ATR, range bars, volume SMA, and trend EMA.

Details

Published by

degenview on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Screeners & dashboards, Trend, Volatility & bands, Volume

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

bitcoinchartscryptopinestocktradingtradingview

Settings

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

SettingTypeDefaultVariable
ATR lengthint14atrLength
Range barsint24rangeBars
Volume average lengthint20volumeLength
Trend EMA lengthint200trendLength
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

1 stars

This overlay indicator is a companion dashboard for Bursa Malaysia stocks. It builds a table that shows Minervini trend-template conditions, VCP squeeze tightness, volume surge and contraction, price and average-volume liquidity filters, and an MCDX banker or

Indicator v6 TrendVolatility & bands
Updated 4 months ago · None stated GitHub repository of Minervini VCP Dashboard v8 KLSE

MTF Confluence Trend

by aretephi
1 stars

MTF Confluence Trend plots trend signals when conditions align across timeframes. It detects Supertrend direction flips on the chart timeframe and confirms them against a higher timeframe Supertrend. Optional filters require an ADX strength threshold and a vol

Indicator v6 TrendVolatility & bands
Updated 3 months ago · None stated GitHub repository of MTF Confluence Trend
4 stars

Meridian - Futures Context is an intraday analysis indicator designed for US index futures. It measures volume participation using relative volume, calculates rolling realized volatility, and evaluates trend context through VWAP slope and EMA structures. Displ

Indicator v6 VolumeVolatility & bands
Updated 7 weeks ago · MPL-2.0 GitHub repository of Meridian - Futures Context

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

Indicator v5 Oscillators & momentumTrend
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum Setup - Ankush Bajaj Momentum Investing Setup

Adaptive MA Slope

by capissimo
114 stars

This indicator calculates Kaufman's Adaptive Moving Average (KAMA) on a chosen price source and determines trend direction based on the slope across a configurable lookback window. Signals can be filtered by short-term volatility expansion using ATR comparison

Indicator v4 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Adaptive MA Slope
92 stars

This indicator classifies the market into gamma regime types (negative gamma trend, positive gamma mean-reversion, or transition) by calculating a composite score based on daily ATR ratios, session VWAP crossover frequencies, and opening range displacement. It

Indicator v5 Volatility & bandsTrend
Updated 8 weeks ago · Custom licence GitHub repository of Moon Dev GEX Regime & Trap

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