reference
Overview
Definitions teach Chartnaut when a setup appears in the market so you can Collect every historical match and later study what usually happens next.
In the product UI the noun is always Definition; in Code the API word is flow. Drawing and shared helpers live under Shared runtime. This section covers events, required emit labels, imports, and multi-file packages.
Covered in Shared runtime
Topic | Page |
|---|---|
| |
| |
Inputs / layout / |
Unique to definitions
Page | Covers |
|---|---|
| |
| |
Required | |
Emit + session + windows | |
|
Minimal flow
meta({ name: "Tick Signal", kind: "flow", slug: "tick-signal" });
events.declare({
id: "tick",
intent: "alert",
payload: { reason: { type: "string", description: "Why this fired" } },
paint: "pin",
});
outputs.declare({ id: "close_line", kind: "line", name: "Close" });
export function onBar(ctx) {
ctx.plot("close_line", ctx.close);
if (ctx.close > ctx.open) {
ctx.emit("tick", { reason: "bullish_bar" }, {
label: "Bull bar",
price: ctx.close,
});
}
}