An Indicator is one TypeScript file that compiles in your browser, publishes as a versioned package under your name, and runs on your own machine unchanged, where every output is a metric id that alerts, screens, series and backtests read. kScript (legacy) is a script the platform holds and its chart engine interprets. This page is the side-by-side, then each claim with the place in the product that proves it.
The two engines side by side
kScript (legacy) stays exactly where it is: published kScript scripts keep charting on the pinned v3 engine, and nothing existing breaks. An Indicator is a different artifact, and this is what changes when you write one:
kScript (legacy) v3 Indicator
----------------------------------- ----------------------------------------
a script the platform holds a TypeScript file you hold
interpreted on the chart's engine compiled in your browser with the same
compiler the CLI uses, same bytes
runs on the chart and hosted alerts runs on the chart, on YOUR machine, and
(candles only, today) on hosted alerts
plots read in the chart legend outputs are metric ids: alerts, screens,
series, backtests
shared as a script listing published as a versioned package
(@scope/name), installed anywhere
var / timeseries / persist locals, module-level state, ring buffers
type Zone { } with methods class Zone { } with typed fields
drawings created and deleted shapes declared once per bar, or handles
you create, move and delete by id
htf() / request() bucket folds on the chart; interval and
market pins on your machine
10 weighted source slots as many inputs as the file declares,
celled classes included
70+ TA builtins 52 stateful classes in src/sdk/ta.ts,
one per builtin, bit-exact to the engine
strategy() on the platform strategy() in the file: the engine's own
broker, and om backtest replays itWhat you gain
| It runs on your machine | The daemon evaluates installed Indicator packages in a local worker pool, and om metric series reads any output on any market the platform serves, with symbol, exchange and interval pins honored (Quick start, The CLI). |
| Alerts read it | A watch condition names the output by metric id, as a level (gt, lt, ...) or an edge (crosses_above, crosses_below), and an edge can sit between two outputs of one package. The watch pins the exact version and module hash it was armed on (Alerts). |
| Screens, series and backtests read it | om metric screen ranks a universe on an output, om metric get and om metric series return its values, and om backtest replays a package; a package that declares strategy(...) places its own orders through the engine's broker (Strategies overview). Screens and backtests refuse celled packages by name. |
| Charts mount the whole package | One add by metric id mounts every renderable output of a published package as one overlay (om chart indicator add --type wrun/@scope/name/output); a draft draws through om chart indicator preview without publishing. |
| Deterministic | The daemon's worker rows are bit-identical to the reference host, and a live session equals a full run (Repainting, Execution model). |
| TypeScript with real tooling | The kit pins AssemblyScript 0.27.37, generated src/gen accessors attach your code to declared names, and a type error names its line and column before anything runs (Type system). |
| One command to build | om indicator build derives the sheet from your declarations, regenerates the accessors, runs bun install once and compiles; the editor's Run loads the same compiler version, so both hosts emit the same bytes (The editor). |
| Publish once, install anywhere | om publish --dry-run prints the files, size and sha256 without uploading; the release lands on the OpenMarket platform as a script beside your grants and versions, with the one source entry the manifest names; a published version is permanent, and om install @scope/name puts it on any machine (Publishing). |
| Sandboxed | 4 MiB of module memory, no growth after init(), 8 MiB of text per run, no filesystem, network or clock, and a 30 s wall clock after which the worker is killed and replaced. The frozen first contract admits seven host imports plus env.abort; the later contracts add the cell, text, drawing, strategy and frame channels by name and nothing else (Limits). |
| Drawings | Boxes and segments declared once and evaluated per bar, text and label renderers, mutable handles for lines, boxes, labels and polylines (500 per kind, 1,500 in all, 256 points per polyline), draw.card, and frame snapshots for level profiles, panels and widgets (8 frames of 96 KiB each) (Drawing objects, Drawing primitives). |
| The TA library | 52 stateful classes in src/sdk/ta.ts, one per kScript builtin, each checked bar for bar against the engine (TA library). |
| Nine templates | sma-codefirst, sma-box, sma, vp-buy-share-codefirst, polymarket-odds, conviction-score, event-asset-divergence, escalation-risk and hud-terminal, behind the editor's New indicator and om indicator templates. |
| Proven ports | The parity program ported 177 eligible registry kScript indicators and proved 167 bit-exact against the engine over frozen holdout windows, 219 frozen families in all (Release notes, v0.173.0). |
| Four contracts, the first frozen forever | A sheet names abi_version wrun-1 (frozen), wrun-2 (cells, text, declared drawings), wrun-3 (handles, strategies, the last-bar flag) or wrun-4 (frames and series inputs); a module written under any of them keeps computing bit-identically (Script definition). |
What stays honest
- Hosted alerts armed from the chart. Where a site has Indicator alerts switched on (the chart says "Indicator alerts are not enabled yet" while it is off), an alert armed from the chart on a published Indicator runs on the hosted engine and reads the chart's own candles only; a package that needs another source, a pinned market or interval, or a celled class is refused there. The watch on your machine is the supported path (Alerts).
- The chart reads its own market and interval for every input.
symbol,exchangeandintervalpins are honored on your machine. - Screens and backtests refuse celled packages (
wrun_celled_metric_unsupported); alerts,om metric get/om metric seriesand chart previews read them. Tape is live-only: a one-shot read or a backtest refuseswrun_tape_unavailable. - A kScript stays a kScript until you port it. The construct table and a worked RSI port are on From kScript; the original keeps charting by reference.
Where to start
- First steps: the editor, the template, a line on the chart.
- The editor, Author with an agent, The CLI: the three ways to write one.
- Quick start: the same file from a terminal, built, installed and read as a metric.