Indicator Lab

Write custom indicators in a concise array formula language — price arrays H L O C V, data series like MKTCAP / DATE, overloaded operators and 37 built-in functions, computed by a WASM engine and rendered on TradingView lightweight-charts. Try H+L, MA(C,5) or a preset below.

Loading WASM engine…
Symbol
Interval
Loading WASM indicator engine…
Built-in indicators (click to load)
Formula editorCtrl+Enter to run
Syntax cheat sheet

H L O C V — high / low / open / close / volume arrays (one value per bar of the loaded period)

Data series — extra raw data beyond OHLCV, referenced by name and auto-loaded/aligned to the bars (DATE/TIME are UTC; CoinGecko series are daily and forward-filled on intraday charts):

  • DATEPer-bar date as a YYYYMMDD number (UTC), e.g. 20260823.
  • TIMEPer-bar time as an HHMM number (UTC), e.g. 1430.
  • MKTCAPCoinGecko historical market cap (USD). Daily granularity — on intraday charts it is a day-level step.
  • TVOLCoinGecko aggregate volume across all exchanges (USD, daily) — unlike V, which is the listed exchange only.

NAME:=expr; intermediate variable · NAME:expr; plotted output (can be referenced by later lines)

+ - * / arithmetic · > < >= <= = == <> != comparisons returning 0/1 · & && AND logical and · | || OR logical or

Plot hints: ,overlay on the price pane · ,stick histogram · ,color=#f0b90b

Comments: { } blocks and // lines; bars without enough history stay blank.

Function reference (0)

Williams %R for crypto — live chart, free in your browser

Williams %R answers one question: where is the current close inside the last 14 bars' high–low range? This variant is plotted on a 0–100 scale, where 0 means the close sits at the 14-bar high and 100 means it sits at the 14-bar low — the deeper the reading, the more stretched price is toward that end of the range.

Sustained readings near the extremes flag overbought (near 0) or oversold (near 100) conditions, and the swing back through the middle (50) is often read as a momentum shift. The formula is one visible line — 100×(HHV(H,14)−C)/(HHV(H,14)−LLV(L,14)) — and the WASM engine evaluates it locally on any pair and interval.

How it works

  1. Pick any trading pair and an interval from 15 minutes to 1 day.
  2. The preset formula loads into the editor — every line stays visible and editable.
  3. The WASM engine evaluates it locally over up to 1000 real exchange candles.
  4. Results render instantly as price-pane overlays or sub-panes.

Frequently asked questions

How do I read the 0–100 scale on this Williams %R chart?

Readings near 0 mean the close is at the top of its 14-bar range (strong momentum, potentially overbought); readings near 100 mean it is at the bottom (potential oversold). A cross back through the 50 midline signals the balance of power flipping.

How does Williams %R differ from the stochastic or RSI?

All three locate price within a recent range, but %R uses the raw position with no smoothing — which makes it faster and noisier than KDJ's smoothed K/D lines and differently shaped than RSI's up/down-move ratio. Charting two of them together here makes the difference concrete.

More indicator lab pages

RSI · MACD · KDJ · Bollinger Bands · Moving Averages · Volume · Bias · Rate of Change · MA Cross Signals

Related tools

KDJ in the Indicator Lab · RSI in the Indicator Lab