Skip to main content

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:

  1. Write. Your agent sends the source, and optionally a test, to indicators/write on 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 immutable name@N.
  2. 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.
  3. 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:

pulse.ts
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) };
},
});

Pulse in its own pane under a daily SPY chart, its legend reading Pulse 9 1.01 0.62

Captured 2026-12-04 on a headless kernel reading a made-up daily series for SPY.

  1. import names @taji/indicators, the only module a script may import.
  2. pane: "own" draws Pulse in a pane under the chart; "price" would draw it over the candles.
  3. inputs declares length, a whole number from 2 up, 9 by default. One declaration becomes both the window's settings dialog and your agent's schema.
  4. plots names two columns, change and avg; every row the kernel serves has one value for each.
  5. setup runs once per instance and returns the state: the previous close, kept by hand, and a ta.ema handle, which only setup may create.
  6. next runs once per bar and returns one number per plot. On the first bar s.prev is NaN, so change is NaN and 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.

KindWhere it livesVersions
Built-in106 definitions compiled into the kernel in Rust (substrate/taji-indicators/src/defs.rs): moving averages, momentum, volatility, trend, volume and session indicatorsOne. Any @N binds it
CustomA TypeScript module your agent writes into a desk; it belongs to that deskEach 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, prefix and ticks_then_close hold 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​