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)

Moving Averages for crypto — live chart, free in your browser

Moving averages are the simplest trend filter: each MA(C,N) line is the average close of the last N bars, redrawn as the window slides forward. Short periods hug price and flip often; long periods move slowly and define the broader trend. This preset overlays four of them — 5, 10, 20 and 60 bars — on the price chart.

The classic readings are alignment and crossover: when the fast MAs stack above the slow ones the trend is up, and a cross of the 5-bar through the 20-bar is one of the most-watched short-term shift signals in crypto. Every period is editable in the formula editor, and the WASM engine recomputes the lines in your browser.

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

Which moving average periods should I use for crypto?

There is no universally best set. 5/10/20/60 covers short-term trading through swing horizons; day traders watch 5/20 crosses, position traders often prefer 50/100/200. Because the periods are just function arguments here (MA(C,N)), you can type any numbers and compare instantly.

What is a golden cross or death cross?

A golden cross is a fast moving average crossing above a slow one (classically the 50 above the 200) — read as confirmation of an uptrend; a death cross is the same cross downward. You can highlight every such event automatically with the MA Cross Signals preset or backtest the rule in the Strategy Backtester.

More indicator lab pages

RSI · MACD · KDJ · Bollinger Bands · Volume · Bias · Williams %R · Rate of Change · MA Cross Signals

Related tools

MA Cross 5/20 in the Strategy Backtester · MA Cross Signals in the Indicator Lab · Bollinger Bands in the Indicator Lab