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.
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):
- DATE — Per-bar date as a YYYYMMDD number (UTC), e.g. 20260823.
- TIME — Per-bar time as an HHMM number (UTC), e.g. 1430.
- MKTCAP — CoinGecko historical market cap (USD). Daily granularity — on intraday charts it is a day-level step.
- TVOL — CoinGecko 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)
Rate of Change for crypto — live chart, free in your browser
Rate of Change is momentum in its purest form: (C − REF(C,12)) / REF(C,12) × 100, the percentage difference between the current close and the close 12 bars ago. Positive and rising means price is not just up but accelerating; a fall toward zero means the advance is decelerating even while price is still rising.
The zero line is the natural anchor — crossings mark momentum flipping sign, and divergences between new price highs and shrinking ROC peaks are classic trend-exhaustion warnings. Change the 12-bar lookback in the editor, apply it to any pair from 15m to 1D, and the WASM engine recomputes it locally.
How it works
- Pick any trading pair and an interval from 15 minutes to 1 day.
- The preset formula loads into the editor — every line stays visible and editable.
- The WASM engine evaluates it locally over up to 1000 real exchange candles.
- Results render instantly as price-pane overlays or sub-panes.
Frequently asked questions
What does the ROC zero-line cross mean?
Crossing above zero means price is now higher than it was N bars ago (momentum turned positive); crossing below zero means it is lower. In choppy crypto ranges these crosses fire often, so ROC is usually paired with a trend filter such as moving averages.
How is ROC different from RSI?
ROC is the raw percentage change over a lookback window — unbounded and linear. RSI compresses up- and down-move ratios into a fixed 0–100 band. ROC therefore shows the size of a move while RSI shows its one-sidedness; together they describe momentum from two angles.
More indicator lab pages
RSI · MACD · KDJ · Bollinger Bands · Moving Averages · Volume · Bias · Williams %R · MA Cross Signals