Indicators
A Taji indicator is a TypeScript module your agent writes and the kernel computes once, on your machine, so the window, your agent and an alert read the same values. This page says what that gives you, shows one indicator file part by part, and then says what holds an indicator to its word.
- Optimized for coding agents, not for hand-coding. Taji has no proprietary language. An indicator is TypeScript and heavy computation is Rust: industry-standard languages that give your agent the best tools there are for safety, performance and writing correct code (why TypeScript).
- Computed once, served to every client. One instance per definition, inputs and series computes the rows; the window draws them, your agent reads them and an alert tests them, so no two can disagree (0001).
- Your machine, no daily limits. The kernel runs the script in V8 inside its own process, and your agent writes, checks and rewrites over MCP with no daily count.
- The whole market. A script reads other intervals and symbols, dividends, splits and earnings, the hub's trades, quotes, statistics and imbalance products, and any plugin's product (Inputs). Beside it stand 106 built-in indicators in Rust, compiled into the kernel.
How does an indicator get from your agent to a chart?
Read it from the left, in three steps:
- Write. Your agent sends the source, and optionally a test, to
indicators/writeon your desk. A refused write answers 422 with the line and column, which is your agent's next edit; a passing one is stored as an immutablename@N. - Bind. A version bound to a chart pane, or named in an alert, gets an instance. Every binding and alert with the same definition and inputs on the same series shares it.
- Serve. The instance runs over the held bars, then follows the market. Its rows, keyed by bar open time, are what the window draws, your agent reads and an alert tests.
What does an indicator file look like?
Pulse, from Your first indicator, plots each bar's percent change from the bar before and a 9-bar exponential average of that change:
import { indicator, input, plot, ta } from "@taji/indicators";
export default indicator({
name: "Pulse",
pane: "own",
inputs: { length: input.int(9, { min: 2 }) },
plots: { change: plot.line({ title: "Change %" }), avg: plot.line({ title: "Average" }) },
setup: ({ inputs }) => ({ prev: NaN, avg: ta.ema(inputs.length) }),
next(bar, s) {
const change = (bar.close / s.prev - 1) * 100;
s.prev = bar.close;
return { change, avg: s.avg.next(change) };
},
});

Captured 2026-12-04 on a headless kernel reading a made-up daily series for SPY.
importnames@taji/indicators, the only module a script may import.pane: "own"draws Pulse in a pane under the chart;"price"would draw it over the candles.inputsdeclareslength, a whole number from 2 up, 9 by default. One declaration becomes both the window's settings dialog and your agent's schema.plotsnames two columns,changeandavg; every row the kernel serves has one value for each.setupruns once per instance and returns the state: the previous close, kept by hand, and ata.emahandle, which onlysetupmay create.nextruns once per bar and returns one number per plot. On the first bars.previsNaN, sochangeisNaNand nothing is drawn there.
Your first indicator follows this file through the write's report, the binding and the rows it serves.
Which indicators are built in, and which does your agent write?
Two kinds exist, and they behave the same once bound to a chart.
| Kind | Where it lives | Versions |
|---|---|---|
| Built-in | 106 definitions compiled into the kernel in Rust (substrate/taji-indicators/src/defs.rs): moving averages, momentum, volatility, trend, volume and session indicators | One. Any @N binds it |
| Custom | A TypeScript module your agent writes into a desk; it belongs to that desk | Each passing write is a new, immutable name@N |
Computation you want in Rust goes in a feature plugin, which serves a product an indicator reads and draws. A plugin can register scripts of its own (Your first plugin).
What holds an indicator to its word?
- Checked on every write. The kernel compiles the source, runs it over a fixed fixture and refuses it, with the line and column and nothing stored, unless
determinism,prefixandticks_then_closehold and its test passes (What does a write check?). - Versioned. Each passing write is an immutable
name@N: a bare name follows the latest, and an alert pins the version it was made with (What happens to an older version?). - Shared. Every binding and alert with the same definition, inputs and series reads one instance, so the legend and an alert read the same value and a colour change recomputes nothing (Who shares a computation?).
- Refused. Any import but
@taji/indicators, TypeScript that needs generated code, and state the kernel cannot copy never reach a chart, and a script that reads the clock or a random number throws (what the write refuses, why no clock). - Faults alone. A script that throws, runs past its budget or exceeds its memory clears only its own rows and shows a red
!in the legend, and the lane bounds a script without containing a hostile one (What happens when a script faults?, Security).
See also
- New here? Your first indicator: write, check, bind, read, test and fault one.
- Coming from Pine? Taji indicators and plugins vs Pine Script: the two side by side.
- Writing with an agent? Have your agent write an indicator: one sentence to you, three tool calls to the kernel.
- Need Rust speed? Build a feature plugin: a Rust product that an indicator reads and draws.
- The indicator SDK: TypeScript, the module's shape,
NaN, state, what is refused. - How an indicator executes: the lane, instances, ticks and closes, origin, budgets, faults, versions.
- Inputs: tunable inputs, per-bar sources and anchors, declared data reads.
- Outputs: plots, colour, fills, drawings and tables, the served shape, the look.
- The indicator reference and
taji.d.ts: every field, kind, default and limit, and the types your agent's source must fit. They ship with the skill and never depend on these pages.