Exchange and symbol format
The exchange ids and the venue-native symbol spellings a wrun indicator uses where the file names a market: a pinned input's symbol and exchange. The vocabulary is the chart's own: an exchange id in uppercase, and the symbol as that venue spells it.
Where the vocabulary is used
A market is the pair exchange + symbol, and in the file the two travel together:
- Pinned inputs.
input("btc", ohlcv.close, { symbol: "BTCUSDT", exchange: "BINANCE_FUTURES" }). The chart passes both as written, in its own ids, and serves a market pin on a secondaryohlcvinput: it fetches that market's candles at the chart's interval (or at a coarser pinnedinterval) and joins them to the chart's bars by timestamp. A lonesymbolor a loneexchangeis refused at the sheet check, because half a pin names a market that does not exist. - Polymarket odds. An
oddsinput names its market by condition id insymbolalone; the exchange is implied, and writing one is refused. - Everything else follows the chart. An unpinned input reads the chart's own market, and the module never sees a market name: the chart supplies it. Trades, funding, open interest, liquidations, order books, and volume profiles always read the chart's own market.
Example: one market on three venues
Three pinned closes of the same asset, spelled the way each venue spells it, and two spreads between them. The first input stays unpinned, so the indicator follows whatever market the chart shows:
input("close", ohlcv.close);
// Every pin names the venue's own spelling of the market, and symbol and exchange always pin together.
input("binance_spot", ohlcv.close, { symbol: "BTCUSDT", exchange: "BINANCE", description: "Binance spot, joined form" });
input("binance_perp", ohlcv.close, { symbol: "BTCUSDT", exchange: "BINANCE_FUTURES", description: "Binance perpetual, joined form" });
input("coinbase", ohlcv.close, { symbol: "BTC-USD", exchange: "COINBASE", description: "Coinbase spot, hyphen form" });
output("basis_pct", line, lower, { unit: "%", description: "Binance perp premium over Binance spot" });
output("coinbase_gap_pct", line, lower, { unit: "%", description: "Coinbase spot over Binance spot" });
function onBar(): void {
const spot = in_binance_spot();
if (isNaN(spot) || spot <= 0.0) return;
out_basis_pct(((in_binance_perp() - spot) / spot) * 100.0);
out_coinbase_gap_pct(((in_coinbase() - spot) / spot) * 100.0);
}The unpinned close is never read by the code; it is the grid every pinned input aligns to. To try it, press New indicator in the editor's Explorer, keep the //@lang=wrun-ts line, replace the starter under it with this file, and press Run: the two spreads draw in their own pane below the chart, at the chart's interval, on a crypto chart (a stock or forex chart's session bars open at other times: Stocks, forex and gold). An alert evaluates the pinned markets too (Alerts).
Exchange reference table
Exchange ids are the chart's own spelling, always uppercase. Symbols are venue-native: each venue's own separator, or none. The format column shows the venue's convention with an example market.
| Exchange | Category | Symbol format | Example |
|---|---|---|---|
BINANCE | SPOT | BTCUSDT | Bitcoin to Tether (spot) |
BINANCE_FUTURES | PERPETUAL | BTCUSDT | BTC/USDT perpetual |
BINANCE_ | dated futures | venue-native | BTC dated contracts |
BITFINEX | SPOT | BTCUST or BTC:USD | Bitcoin to USD (spot) |
BITFINEX_ | PERPETUAL | BTCF0:USTF0 | BTC perpetual |
BITGET | PERPETUAL | BTCUSDT | BTC/USDT perpetual |
BITMEX | PERPETUAL | XBTUSD | Bitcoin to USD |
BITSTAMP | SPOT | BTCUSD | Bitcoin to USD (spot) |
BYBIT | PERPETUAL | BTCUSDT | BTC/USDT perpetual |
BYBIT_SPOT | SPOT | BTCUSDT | Bitcoin to USDT (spot) |
COINBASE | SPOT | BTC-USD | Bitcoin to USD (spot) |
DERIBIT | PERPETUAL | BTC-PERPETUAL, BTC_ | BTC/USD and BTC/USDC perpetuals |
GATE_IO | SPOT | BTC_USDC | Bitcoin to USDC (spot) |
GATE_IO_FUTURES | PERPETUAL | BTC_USDT | BTC/USDT perpetual |
HUOBI | SPOT | venue-native | spot markets |
HUOBI_DM_SWAP, HUOBI_ | PERPETUAL | venue-native | coin- and USDT-margined swaps |
HYPERLIQUID | SPOT | HYPE-USDC | HYPE to USDC (spot) |
HYPERLIQUID_ | PERPETUAL | BTC | BTC perpetual (the bare base asset) |
HYPERLIQUID_ | PERPETUAL | venue-native | HIP-3 perpetuals |
OKEX | SPOT | BTC-USDT | Bitcoin to USDT (spot) |
OKEX_FUTURES | dated futures | BTC-USDT-251226 | BTC future (Dec 26, 2025) |
OKEX_SWAP | PERPETUAL | BTC-USDT-SWAP | BTC/USDT perpetual swap |
UPBIT | SPOT | KRW-USDT | Korean won to USDT |
CME | dated futures | venue-native | listed futures; drafts and community indicators cannot read CME data, and no script may pin a CME Group market (CME, CBOT, NYMEX, COMEX, GLOBEX) as another market's input: the pin is refused by name |
POLYGON | US stocks and ETFs | AAPL/USD, SPY/USD | a stock or ETF pinned as a reference market |
FX_OTC | forex, gold and silver | EUR/USD, XAU/USD, XAG/USD | quote candles, volume 0; served on the chart and in alerts |
LBMA, LME, ICE, PLATTS | retired | none | no longer served: pin gold and silver on FX_OTC (XAU/USD, XAG/USD) |
POLYMARKET | prediction markets | the 66-character condition id | never written in a pin: an odds input's symbol is the condition id, and the exchange is implied |
A venue with both a spot book and a derivatives book has two ids (BINANCE and BINANCE_FUTURES, BYBIT_SPOT and BYBIT, OKEX and OKEX_SWAP, GATE_IO and GATE_IO_FUTURES, HYPERLIQUID and HYPERLIQUID_FUTURES), and the same symbol can exist on both: pin the id of the book you mean.
A misspelled pin is refused
A guessed id is a pin that reads nothing, and the chart does not draw a flat line in its place: it asks for the market as written, and when nothing comes back it refuses the run and names the market it could not load, in a toast and on the overlay's Could not load chip:
Pinned market candle (BINANCE_FUTURES/BTCUSDTT) data is unavailable for 'Venue spreads' (the ohlcv source lane answered empty or was declined), so the indicator cannot compute.Check the spelling against the table: the exchange id in uppercase, and the symbol the way that venue writes it.
Notes
Case sensitivity. Exchange ids are uppercase (BINANCE, never binance), and symbols are matched as the venue spells them. An interval pin takes the vocabulary's words or their short forms, and nothing else: MINUTE, FIVE_MINUTES, FIFTEEN_MINUTES, THIRTY_MINUTES, HOUR, FOUR_HOURS, DAY, WEEK, or 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w, and on the chart only its custom timeframes, TWO_MINUTES to THREE_DAYS or 2m, 3m, 10m, 45m, 2h, 6h, 8h, 12h, 3d (The chart's custom timeframes).
Separators vary. Hyphens (BTC-USD), underscores (BTC_USDT), colons (BTC:USD), or nothing (BTCUSDT), per venue. The same asset is a different string on every venue, so an indicator that pins several venues carries one spelling per pin; there is no normalized symbol in a pin.
Data availability. Not every source exists for every venue and symbol: funding, open interest, and liquidations are perpetual-venue feeds, and the implied volatility and skew tenors are Deribit's. On the chart those sources always read the chart's own market. When that market does not serve one, the volume profile, implied volatility, skew, the options chain, ETF flows, and funding (unless its input declares missing: "nan" or "zero") refuse the run by name, while open interest, liquidations, and trades read their missing fill.
Dated futures and options. Use the format the venue publishes; YYMMDD in an OKX future is the expiry.
Polymarket. An odds input names one outcome market by its condition id (0x plus 64 hex characters), never the market slug or the event, with outcome YES or NO; the exchange is implicit and refused if written. The chart has no market picker, so the condition id in symbol is the only way to name the market (Data sources).
CME. Run is paused while the chart is on a CME market, and drafts and community indicators cannot read CME data; OpenMarket's official wrun indicators can.