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; ... };
}): voidField | Notes |
|---|---|
| Enables |
| Stable id for |
| Display names |
| Shared — see Price and bar data and Multi-timeframe and runOn |
| 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
slugwhen studies need a stableflows.declare({ slug })Using deprecated
meta.idinstead ofslugBuilding chart-only math as a definition — prefer a Research Indicator
