Indicator · Pine Script v6 · On the chart

Taught to Trade — Volatility Scanner (ATR%)

by obekheet

This indicator scans and ranks a custom watchlist of up to nine symbols alongside a benchmark reference symbol by daily ATR percentage.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code85
Settings12inputs
LicenceMPL-2.0
Last update12 days ago16 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

85 lines of Pine Script v6 from scripts/volatility-scanner-atr.pine, published under MPL-2.0. Keep the author's credit and licence lines when you reuse it.

volatility-scanner-atr.pine
//@version=6
// =============================================================================
// Taught to Trade — Volatility Scanner (ATR%)
// shorttitle: TT VolScan
// -----------------------------------------------------------------------------
// WHAT IT IS
//   Ranks a watchlist by daily volatility — 14-period ATR as a percentage of price —
//   and shows the most volatile names in a table, with Bitcoin as a reference. A "where
//   is the movement" map, updated once per day from daily data.
//
// HOW TO USE
//   Use the preloaded list or type your own symbols. Higher ATR% = more daily range.
//   Read it to decide WHERE to look, then do your own analysis on those names.
//
// WHERE IT FAILS
//   - Volatility is not direction or opportunity — a name can top the list while going
//     nowhere or straight down. It measures range, nothing more.
//   - Daily-based, so it lags intraday shifts. A thin/illiquid symbol can rank high on noise.
//
// Educational tool only — not investment advice. (c) 2026 Taught to Trade.
// =============================================================================
indicator("Taught to Trade — Volatility Scanner (ATR%)", shorttitle = "TT VolScan", overlay = true)

// ----- Inputs (watchlist) ---------------------------------------------------
grp = "Watchlist (leave blank to skip a slot)"
s1  = input.symbol("BINANCE:BTCUSDT", "Reference (BTC)", group = grp)
s2  = input.symbol("BINANCE:ETHUSDT", "Symbol 2",  group = grp)
s3  = input.symbol("BINANCE:SOLUSDT", "Symbol 3",  group = grp)
s4  = input.symbol("BINANCE:BNBUSDT", "Symbol 4",  group = grp)
s5  = input.symbol("BINANCE:XRPUSDT", "Symbol 5",  group = grp)
s6  = input.symbol("BINANCE:DOGEUSDT","Symbol 6",  group = grp)
s7  = input.symbol("BINANCE:ADAUSDT", "Symbol 7",  group = grp)
s8  = input.symbol("BINANCE:AVAXUSDT","Symbol 8",  group = grp)
s9  = input.symbol("BINANCE:LINKUSDT","Symbol 9",  group = grp)
s10 = input.symbol("BINANCE:DOTUSDT", "Symbol 10", group = grp)
atrLen = input.int(14, "ATR length", minval = 1, group = "Settings")
topN   = input.int(5, "Show top N", minval = 1, maxval = 9, group = "Settings")

// ----- ATR% fetch (daily, no lookahead) -------------------------------------
// request.security is called UNCONDITIONALLY for every slot (calling it inside an
// if-branch is unreliable in Pine). Blank/duplicate slots are filtered afterward.
f_atrp(simple string sym) =>
    request.security(sym, "1D", ta.atr(atrLen) / close * 100.0, lookahead = barmerge.lookahead_off)

// Short display name: strip the "EXCHANGE:" prefix if present.
f_short(simple string s) =>
    parts = str.split(s, ":")
    array.size(parts) > 1 ? array.get(parts, 1) : s

v2 = f_atrp(s2), v3 = f_atrp(s3), v4 = f_atrp(s4), v5 = f_atrp(s5), v6 = f_atrp(s6)
v7 = f_atrp(s7), v8 = f_atrp(s8), v9 = f_atrp(s9), v10 = f_atrp(s10)
refVal = f_atrp(s1)
refName = f_short(s1)

// Collect the non-reference slots into arrays, rebuilt each bar
array<string> names = array.new<string>()
array<float>  vals  = array.new<float>()
f_add(simple string sym, float v) =>
    if str.length(sym) > 0 and sym != s1
        array.push(names, f_short(sym))
        array.push(vals, v)

f_add(s2, v2), f_add(s3, v3), f_add(s4, v4), f_add(s5, v5), f_add(s6, v6)
f_add(s7, v7), f_add(s8, v8), f_add(s9, v9), f_add(s10, v10)

// ----- Sort descending by volatility ----------------------------------------
idx = array.sort_indices(vals, order.descending)

// ----- Table (top N + reference) --------------------------------------------
var table t = table.new(position.top_right, 3, topN + 2, border_width = 1)
if barstate.islast
    table.clear(t, 0, 0, 2, topN + 1)
    table.cell(t, 0, 0, "Rank",  text_color = #F5F2EA, bgcolor = #0E1526, text_size = size.small)
    table.cell(t, 1, 0, "Symbol",text_color = #F5F2EA, bgcolor = #0E1526, text_size = size.small)
    table.cell(t, 2, 0, "ATR%",  text_color = #F5F2EA, bgcolor = #0E1526, text_size = size.small)
    n = math.min(topN, array.size(idx))
    for i = 0 to n - 1
        j = array.get(idx, i)
        table.cell(t, 0, i + 1, str.tostring(i + 1),                       text_color = #232838, bgcolor = #F5F2EA, text_size = size.small)
        table.cell(t, 1, i + 1, array.get(names, j),                       text_color = #232838, bgcolor = #F5F2EA, text_size = size.small)
        table.cell(t, 2, i + 1, str.tostring(array.get(vals, j), "#.##"),  text_color = #2F6FED, bgcolor = #F5F2EA, text_size = size.small)
    // reference row
    table.cell(t, 0, n + 1, "ref", text_color = #232838, bgcolor = #E8E4D8, text_size = size.small)
    table.cell(t, 1, n + 1, refName, text_color = #232838, bgcolor = #E8E4D8, text_size = size.small)
    table.cell(t, 2, n + 1, str.tostring(refVal, "#.##"), text_color = #232838, bgcolor = #E8E4D8, text_size = size.small)

Overview

Taught to Trade — Volatility Scanner (ATR%) computes the Average True Range as a percentage of the close using daily timeframe security calls without lookahead bias. The top-ranked volatile symbols and the benchmark reference are displayed in an overlay table on the price chart. Users can configure the symbol slots, the ATR calculation length, and how many top symbols appear. It solely gauges price range rather than trend direction, and daily figures lag intraday volatility changes.

Details

Published by

obekheet on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Screeners & dashboards, Volatility & bands

Markets

Crypto

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

pine-scriptpinescripttechnical-analysistrading-indicatorstradingviewtradingview-indicators

Settings

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

SettingTypeDefaultVariable
Reference (BTC)symbolBINANCE:BTCUSDTs1
Symbol 2symbolBINANCE:ETHUSDTs2
Symbol 3symbolBINANCE:SOLUSDTs3
Symbol 4symbolBINANCE:BNBUSDTs4
Symbol 5symbolBINANCE:XRPUSDTs5
Symbol 6symbolBINANCE:DOGEUSDTs6
Symbol 7symbolBINANCE:ADAUSDTs7
Symbol 8symbolBINANCE:AVAXUSDTs8
Symbol 9symbolBINANCE:LINKUSDTs9
Symbol 10symbolBINANCE:DOTUSDTs10
ATR lengthint14atrLen
Show top Nint5topN
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

This overlay indicator plots a Supertrend from an ATR length and factor, four exponential moving averages, and a selectable VWAP or TWAP taken from a chosen timeframe on the price chart. It also shows MACD and stochastic with adjustable lengths, smoothing, ver

Indicator v5 Oscillators & momentumMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum Setup: Vijay Thakare Option Buying Scalping Setup
330 stars

This multi-symbol indicator evaluates a combined trading condition across up to 40 user-defined symbols. It processes MACD bullish crossovers, RSI thresholds, Bollinger Band boundaries, and DMI/ADX trend filters using security calls. When buy or sell criteria

Indicator v5 Oscillators & momentumVolatility & bands
Updated 2 months ago · None stated GitHub repository of Multi MACD + BB + RSI [Alorse]

Pricing Table

by namuan
318 stars

This indicator calculates theoretical options contract values and in-the-money probabilities using historical realized volatility across multiple standard deviations. It displays these metrics in a table overlay directly on the price chart. Users can adjust th

Indicator v4 Volatility & bandsScreeners & dashboards
Updated 2 months ago · MIT GitHub repository of Pricing Table
218 stars

This indicator maps market structure and supply and demand zones on the price chart. It marks validated and optional unvalidated swing highs and lows using a pivot length and extra confirmation bars. Consolidation and impulse moves are measured against ATR to

Indicator v6 SMC / ICT / price actionSupport & resistance Repaints
Updated 3 months ago · None stated GitHub repository of Market Structure + Supply/Demand
200 stars

Storm Gauge calculates annualized realized volatility and compares it against a historical percentile lookback window to classify market volatility regimes into calm, normal, or storm conditions. Based on a target volatility input, it calculates dynamic positi

Indicator v5 Volatility & bandsScreeners & dashboards
Updated 3 months ago · MIT GitHub repository of Storm Gauge — Vol Regime + Position Size

8zz反指標v2

by hansai-art
121 stars

The 8zz Contrarian Indicator plots reverse sentiment trading signals directly on the price chart based on tracked retail post activity. It generates bullish signals during retail panic and bearish signals during market euphoria. The indicator features adjustab

Indicator v6 Moving averagesOscillators & momentum
Updated 3 months ago · None stated GitHub repository of 8zz反指標v2

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