OptionalcategoryRegistry key, e.g. 'macd'.
Display name, e.g. 'MACD'.
'onchart' overlays the price pane; 'pane' gets its own pane.
OptionalattachOptional per-instance lifecycle, for indicators whose data is not derived from the chart's bars (open interest, CVD, an external feed). Called once when the instance is created; return a teardown function.
Fetch into ctx.store, then call ctx.requestRecompute() — calc runs
again and reads what you stored.
Full recompute over every bar. Must return arrays the same length as
bars (use null for warmup gaps — the line renderer breaks across them
and autoscale skips them).
Tier-1 indicators are pure functions of (bars, settings) and ignore
store. Tier-2 indicators — the ones with their own data — read the
external series their attach lifecycle put in store.
OptionalcalcOptional incremental path, called instead of calc when only the tail
changed (a live tick). Return values for indices [fromIndex, bars.length)
— the runtime splices them onto the previous result — or null to fall
back to a full calc.
Without it every tick costs a full recompute. That is a few hundred microseconds for one indicator over 50k bars, but it is O(n) per tick per indicator, so implement this for anything meant to run in a busy live pane.
OptionallevelsOptional horizontal reference levels drawn in the indicator's pane.
OptionalrangeOptional fixed price range for the indicator's own pane (RSI 0..100). Applied only when the indicator creates its pane — two indicators sharing a pane would otherwise fight over it.
Grouping for a picker UI ('Trend', 'Momentum', 'Volume', 'Volatility').