feature

Definition meta

Definition meta is how the script identifies itself — name, slug, and kind: "flow" so events can be Collected and studied.

You need a stable slug so studies can bind with flows.declare. For chart-only math without Collect, build a Research Indicator instead.

Signature

meta({
  kind: "flow";
  name?: string;
  shortName?: string;
  slug?: string;
  category?: string;
  params?: Record<string, FlowParamDef>;
  dataSource?: ...;
  runOn?: string[];
  runOnReason?: string;
  window?: { on?: Array<"barClose">; retain?: number; ... };
}): void

Field

Notes

kind: "flow"

Enables events.declare and ctx.emit for Collect / study

slug

Stable id for flows.declare in studies

name / shortName

Display names

dataSource / runOn

Shared — see Price and bar data and Multi-timeframe and runOn

window

Optional bar-close / retain settings

Chart paint via outputs.declare is optional but common alongside emits.

Example

meta({
  name: "London open drive",
  kind: "flow",
  slug: "london-open-drive",
  shortName: "LOD",
  runOn: ["1m", "5m"],
  runOnReason: "Session logic is intraday",
});

Settings

You can use the shared settings DSL (input.*, dialog, layout) or legacy meta.params. Prefer input.* for new scripts — same pattern as indicators. See Settings inputs and dialog.

Common mistakes

  • Omitting slug when studies need a stable flows.declare({ slug })

  • Using deprecated meta.id instead of slug

  • Building chart-only math as a definition — prefer a Research Indicator

Next

  1. Events and snapshots

  2. Multi-file packages and imports