Limitations

View as MarkdownOpen the editor

What a wrun indicator does not do in the chart, and where to find the numbers. An indicator is a sandboxed, declared computation over market data; a few things are deliberately out of scope, and knowing them up front saves you from designing around a feature that is not there.

Not supported today

Numbers only in outputs

Every output is a 64-bit float, and NaN is the one "nothing here" value. Text reaches the chart only through string slots and renderers (the second runtime contract, which Run derives for you when you declare one). Decisions are numbers too: 1 or 0 in a data-only output, turned into a look by a declaration (shape_where, color_by, a box's when).

Settings are typed, text included

A setting is param.<kind>(...): a whole number, a number, a toggle, a menu, a color, a time or a price picked on the chart, a range, a multi-select, a list, a price field, a timeframe, a market, a session or words, each drawn by the overlay's settings dialog as its own control and laid out in pages and sections (The settings dialog). A param.text or param.text_area takes plain words within its max_bytes (Setting kinds). A sheet holds at most 128 settings after a range (2), a session (3), a list (max + 1) and a unit menu (1 more) expand. A source, timeframe or symbol pick is applied by the chart when the Indicator runs in the browser; an Indicator that runs on OpenMarket's servers keeps the declared default for those three, and an alert refuses to arm while one is off its default. Changing a setting runs the module again over the loaded bars without recompiling.

Pins are served with restrictions

An unpinned input follows the chart's own market and interval. The chart checks every pin before it fetches anything and refuses the ones it cannot serve by name:

  • a market pin (symbol and exchange together) only on a secondary ohlcv or trades input, or on an intrabar input or a stream (candles, oi_candles, volume_profile_candles); every other source and every other celled input follows the chart's own market, except odds, which names its Polymarket market by condition id;
  • an interval pin only coarser than the chart and a whole multiple of it, on a secondary ohlcv input, an odds input, or funding and oi;
  • no market or interval pin on the first input: it follows the chart (an odds input may come first and still names its market);
  • a forming view up to WEEK, and never a view without an interval pin.

Pins on stocks and ETFs (POLYGON), forex, gold and silver (FX_OTC) are served like crypto pins, on any chart. An index pin reads NaN with a warning row, and a CME Group pin or a 3d pin on a stock, forex or gold market is refused by name. Multi-timeframe and Multi-source have the rules in full.

No market picker

The chart has no picker for a market chosen per use: an odds input declared with binding is refused ("the chart has no market picker yet; pin the market's condition id (0x…) in the input's symbol"). Pin the Polymarket market by its condition id instead.

Tape history is large prints only

tape history comes from the large-print lane: prints of $10,000 or more on markets quoted in USD or a dollar stablecoin, and the contracts floor on CME Group futures (10 ES, 5 NQ, 20 CL, 10 GC). A min_value or min_size floor below the lane's reads history at the lane's floor, a market quoted outside dollars has no large-print history and no dollar value for a min_value floor, history reaches back 30 days at most, and a one-second chart or a calendar interval refuses the input (Data sources). Side-split volume per bar is the trades source with side: "BUY" or "SELL", and the split by trade size is trade_volume_by_size.

No other indicator's output on the chart

The editor has no declaration for another indicator's output, and the chart serves none; a package whose wrun/metadata.json declares one as a metric input reads it on your OpenMarket runner only. A published feed is a source of its own: input(name, series.value, { ref: "@scope/name" }) reads it (Feeds as inputs).

Some feeds are the chart's alone

The option summaries beyond implied volatility and skew (volatility_index, options_oi, options_volume), long_short_ratio, the ETF feeds, ethena_positions, bitfinex_funding, treasury_balance and economic are served when the indicator runs in the browser, like etf_flow. An alert on an indicator that reads one is refused.

The options chain is the live row's only

options_chain fills the newest row with the current chain (a 30-second snapshot, polled live) and leaves every history row an empty block, so a gamma map over past chains has no form on it; the option_strikes source carries every bar's own strike snapshot instead, on crypto, CME and US stock charts (Option strikes). venue picks the chain: auto (the chart's own options venue, the CME chain of a CME future or the OPRA chain of a US stock or ETF, each at your own tier, else the coin's Deribit chain), or one venue's (deribit, cme, binance, okx, bybit, bullish, derive), refused by name on a chart that venue cannot serve; no venue word reads OPRA.

The order book is the chart's

book cells come from the book the chart loads for its own market, up to 500 price levels a side, so a full book is up to 1,000 tuples; size max_cells for that. The declaration requires block_size, but the chart does not read it or max_depth, so neither changes what it fetches (Order flow).

Drawings have fixed budgets

Boxes and segments are declared once and evaluated on every bar, 16 of each. Drawing handles (line, box, label, and polyline) are objects the module creates, moves, and deletes across bars, capped at 1,000 live handles per kind, 1,500 live handles in all, 100,000 points per polyline and 524,288 points across the live polylines, and 4,096 draw calls per row; there is no table handle (a table is render.table). One run draws at most 2,000 drawings on the chart; past that the chart draws the newest 2,000, says "Drawings capped" on the indicator's legend row, and its card says how many were drawn (Drawing objects).

No history array

onBar() sees one bar, which is also why an indicator cannot look ahead by accident (Execution model). There is no [] operator on a series, and History from ./sdk/stats keeps the window for you: push() the value once per bar and ago(n) reads it n bars back (Stats, history and lists).

No persistence across runs

Module state lives for one run over the loaded bars. Nothing survives a reload, a new Run, or a pan that loads older bars (the chart runs the module again over the wider window); anything you need is recomputed from the loaded history. A draft's overlay lasts for the session and is not saved with the layout: Run it from the editor again to bring it back.

No cross-indicator communication

Each overlay runs its own module. Two wrun indicators on the same chart share no state, and one cannot read another's outputs; combine the logic into one file.

No orders from the file

The module has no filesystem, no network, no clock, and no order capability. A strategy's orders fill only in the Strategy Tester's simulated broker, against the chart's own candles; nothing reaches an exchange (Strategies overview).

One file per indicator

Helpers, classes, and constants live in the one editor tab beside onBar(). The kit and the accessors generated from your declarations are the only names there are, so there are no library imports, and a //@file= line is refused (Publishing):

text
One file per indicator for now. Move the code from <file> into this tab and remove the //@file line.

History is what the chart loaded

The module sees exactly the candles the chart has loaded, and every source is fetched over that window; there is no separate warm-up fetch, so a long lookback needs the chart to load more bars. The exceptions reach back by their own bars: an interval pin, and the streams (candles, oi_candles, volume_profile_candles), whose first bar carries as many closed candles as bars asks (Multi-timeframe). An indicator runs at any chart interval from 1s to 1Y, but on a 1s chart the sources not served at 1s are declined, prediction-market odds need a one-minute chart or coarser, and intrabar cells come from bars no finer than 1m, so they need a chart of 2m or coarser.

Alerts read pins within 600 bars

An alert needs a published version and runs in OpenMarket's cloud on the chart's market and interval with the overlay's settings, over at most 600 bars of that interval. It serves another market's candles on a secondary ohlcv input and a coarser pin that is a whole multiple of the chart's interval, read once its candle has closed; 600 chart bars hold 600 / (leg / chart) candles of a pin, so a higher-timeframe average longer than that arms but stays empty, and belongs on a coarser chart. It refuses a pin on the first input, a finer pin, a custom timeframe, a source alerts cannot evaluate yet (the feeds above and the oi_candles and volume_profile_candles streams among them), and a source, timeframe or symbol setting off its default. An indicator that builds a higher timeframe from the chart's own bars must declare warmup(), or its alert can arm and stay empty. A data-only output is not offered as a condition target (Alerts).

CME data stays on the chart

On a CME market an indicator runs in your browser once you are signed in and have accepted the CME market data terms. It reads CME data at your own tier: real time on a real-time CME account, else delayed 10 minutes. Its results show on that chart only: the legend, the hover values and the editor console. A console copy leaves out the values it printed, an agent's chart read withholds them, a CSV export refuses them, and a chart that carries CME data cannot be shared as a clip. A Protected indicator does not run there (Cloud is not offered), a strategy does not backtest there, and only price alerts are available.

The CME option chain is read on a CME futures chart only

On a CME futures chart (ES1!, NQ1!, CL1!, GC1!, 6E1!, ...) an indicator that runs in your browser reads the chart's CME option chain as it reads the chart's candles, on the same terms. That holds for your drafts, the indicators you publish to run in the browser and the ones you add from the community. It reads options_chain with venue: "auto" or "cme", options_flow and the chain sources below (option_strikes, option_surface, option_daily, option_stats_10m, option_prints, option_contract_state, option_contract_flow, ...). underlying reads another CME root's chain there, such as the ES chain on an NQ chart. An indicator on any other chart (a stock, a coin, an index) reads no CME chain. A CME root named by underlying there is refused by name: "Indicators you write or add from the community read a CME option chain on a CME futures chart only."

US options data is served at your own tier

On a US stock or ETF chart every indicator reads the stock's listed options (OPRA): options_chain with venue: "auto" and the other chain sources when the indicator runs in the browser, and options_chain on OpenMarket's servers too (Run on Cloud, a Protected package), each at the viewer's own tier: real time on a real-time US options account, else delayed 15 minutes, and the legend says so ("OPRA data delayed 15 minutes"). The delayed chain is the newest snapshot 15 minutes behind the live bar, and a live-bar read repeats it until the next one lands. On a US option contract chart a draft or a community indicator runs in the browser at your own tier; a Cloud (Protected) indicator does not run there yet. US options data stays on the chart: an agent's chart read withholds it and a CSV export refuses it. Alerts on a US option contract are coming for real-time US options accounts, on the contract's own candles; until the alert server serves them, an alert on US options is refused.

The chain sources read one chain and one book

option_strikes, option_contract_state, option_surface, option_daily, option_stats_10m, option_prints, option_contract_flow and option_prints_v2 are served when the indicator runs in the browser, on crypto, CME and US stock charts: each input reads the chain its venue word picks and one book of it (book), the inputs of one indicator read one chain across all eight, and a CME or US stock chart's chain follows the chain's rules above. An alert and a Protected indicator on OpenMarket's servers refuse each by name (wrun_option_surface_unsupported, wrun_option_daily_unsupported, wrun_option_prints_v2_unsupported, ...). The surface keeps five-minute samples for 30 days and a daily sample after that (Data sources). Sizes are in the chain's own size (the coin on a crypto chain, contracts on US listed options and CME), and the statistics' premium is served on US listed options only until crypto and CME prints are.

The flow and print sources

options_flow, option_prints, option_prints_v2 and option_contract_flow read the options of the chart's underlying on crypto, CME and US stock charts (and an option contract chart), the CME and US listed options under their rules above; options_flow reads its scopes per market, and a scope the market does not serve reads the input's fill. A crypto or CME print carries the taker's side and no quote, so its mid, none and outside-the-quote values read 0. An alert and a Protected indicator on OpenMarket's servers refuse each by name. The market.earnings_* facts are declared in the kit ahead of the chart lane that will fill them. A cell is never NaN: a value the data does not carry reads 0 with its present bit clear, and bit 14 marks a bar cut short by max_cells or older than the kept history. option_prints history reaches 3 days for every print and 90 days for the large ones, and multi-report earnings history is not served (Data sources).

Where it runs is fixed at the first publish

A name first published as Compiled or Open source runs in each reader's browser, and one first published as Protected runs on OpenMarket's servers; a later version cannot switch sides. The Publish dialog has no price, and paid indicators cannot be added from the chart yet (Publishing).

What AssemblyScript and the sandbox leave out

The file is AssemblyScript: TypeScript syntax over fixed-width numbers, compiled in your browser. The editor's compile hints link here when you reach for something it does not have:

a closure over a local variable

keep the value at module scope, or pass it as a parameter

a union type

one concrete type (f64, i32, string), or a nullable class

any

the concrete type: f64, i32, string, or a class

a bare object literal

a class with those fields, built with new

the spread operator

a counting loop, or Array.slice()

destructuring

read the fields or indexes one at a time (const a = pair[0])

optional chaining (?.) or nullish coalescing (??)

test for null with if or a ternary

for...of

a counting for loop over the indexes

the in operator

Map.has(), or read the field directly

a regular expression

the string methods: includes, startsWith, indexOf, split

try / catch

test the condition before the call; a throw ends the run

async / await

nothing: an indicator runs synchronously, one bar at a time

console.log(...)

the debug log: string("debug", { max_bytes: 256 }) and str_debug(text) in onBar() (Debugging)

Date.now() or new Date()

bar.time(), the bar's open time in epoch seconds

Math.random()

a variation derived from the bar data: a run is reproducible bar for bar

performance.now()

nothing: the sandbox has no clock

Named refusals

Each gap above is refused by name, never worked around silently, and the message names the way out: Common errors lists every refusal with its cause and fix.

Sandbox limits

Every wrun indicator runs under fixed ceilings (declaration caps, text and frame budgets, memory, and a deadline per run) so one module cannot exhaust the chart; every number is in the Limits reference. The caps quoted on this page come from one table in the kit, which says where each one is enforced. The table itself enforces nothing: the sandbox, the chart and OpenMarket's servers each check their own.

Build and runtime errors

For the messages you meet while writing an indicator (a coordinate passed as a string instead of a handle, a param option that does not exist, a missing cast, a sheet field out of range, an onBar() written with the wrong signature, a run that drew nothing), see Common errors. Each one is listed by its exact text with a cause and a fix.