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)
MA Cross Signals for crypto — live chart, free in your browser
This preset turns the most-watched event in technical analysis — a fast moving average crossing a slow one — into explicit chart marks. A green bar marks the bar where MA(C,5) crossed above MA(C,20); a red bar marks the cross down. No squinting at two overlaid lines required.
The signals are computed with the engine's CROSS function at bar close, the same primitive the Strategy Backtester uses for its entry and exit rules — so what you see marked here is exactly what a 5/20 crossover strategy would trade. Change the two periods in the editor to highlight any other fast/slow combination.
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 a 5/20 moving-average cross mean?
MA5 crossing above MA20 means the short-term average price overtook the medium-term one — momentum shifting up. The cross down signals the reverse. Because it is a trend-following signal it arrives after the turn, trading reliability for confirmation.
Can I backtest these crossover signals?
Yes — the identical CROSS(MA(C,5),MA(C,20)) rule is the "MA Cross 5/20" preset in the Strategy Backtester, which simulates it with fees and slippage on real candles, and the Multi-Coin Scanner can score it walk-forward across every coin.
More indicator lab pages
RSI · MACD · KDJ · Bollinger Bands · Moving Averages · Volume · Bias · Williams %R · Rate of Change
Related tools
MA Cross 5/20 in the Strategy Backtester · Moving Averages in the Indicator Lab