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)
KDJ for crypto — live chart, free in your browser
KDJ is the stochastic family's three-line variant popular on Asian exchanges. The raw stochastic value (RSV) places the current close between the 9-bar high and low on a 0–100 scale; K and D are smoothed versions of it, and J = 3K − 2D exaggerates the gap between them to expose momentum extremes.
Because J is an amplified difference, it routinely travels beyond 100 or below 0 — those stretches mark aggressive short-term overbought/oversold conditions. Load the preset on any pair and interval; every line's formula stays visible and editable in the editor, and the whole computation runs locally over real exchange candles.
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 J line in KDJ mean?
J is 3K − 2D, a leveraged version of the K−D spread. When J spikes above 100 or plunges below 0, the fast and slow lines have stretched far apart, which many traders read as a short-term overbought or oversold extreme.
How is KDJ different from the classic stochastic?
Both start from the same raw stochastic (RSV), but KDJ adds the J line and uses SMA-style smoothing (SMA(X,3,1) here). The result reacts a bit differently to sharp crypto moves — comparing K/D crosses against RSI on the same chart is a quick way to see which suits your pair.
More indicator lab pages
RSI · MACD · Bollinger Bands · Moving Averages · Volume · Bias · Williams %R · Rate of Change · MA Cross Signals
Related tools
KDJ Cross in the Strategy Backtester · RSI in the Indicator Lab