[Indicators]
AXIS indicator UI: runAndApply pipeline, active engine binding, overlay routing, and IndicatorPanel.
Indicators
“Indicators” in AXIS terms means scripts applied to the chart, whether indicator() or strategy() in Pine. The module boundary is indicators/runner.ts plus list UI—not the PYNE evaluator.
Abstract
| Piece | Role |
|---|---|
runScript | Engine invocation + status/timeouts |
runAndApply | Chart + lastRun + results open |
probeEndpoint | Settings health check helper |
IndicatorPanel | List/toggle scripts in store |
IndicatorCard | Per-script UI chrome |
Language semantics: PYNE runtime.
Conceptual model
Interface surface
runScript options
| Option | Default | Meaning |
|---|---|---|
silent | false | Quiet status; live re-run logging |
| timeout | derived | Interactive: scales with bars (60–180s); silent 45s |
runAndApply options
| Option | Default | Meaning |
|---|---|---|
openResults | !silent | Open results drawer |
indicatorId | optional | Update existing store indicator |
Overlay routing
overlay = result.meta.overlay !== false
paneId = overlay ? 'price' : 'indicator'
Non-overlay creates indicator pane if missing (addPane + manager createPane).
Series selection
Prefer result.series entries whose keys do not start with _ / __. Fallback: single plots[] array as one line named from script_name.
Colors: plot_meta[k].color or PLOT_PALETTE[i].
Indicator panel
Side list of store.scripts (Indicator: id, name, code, paneId, visible, plots). Visibility toggles affect display intent; re-run still engine-driven.
Active engine binding
// plugins/active.ts pattern
getActiveEngine() // registry lookup by activePlugins.engine
getActiveEngineConfig() // pluginsConfig + store.endpoint merge
Switching engines mid-session does not auto-rerun; operator hits Run.
Live re-run coupling
Streams may set live.needsRerun; multiplex/runner path can call runAndApply with silent: true so the status bar is not spammed. Failures go to logs.
Internals
| Path | Role |
|---|---|
frontend/src/indicators/runner.ts | Pipeline |
frontend/src/indicators/IndicatorPanel.tsx | List UI |
frontend/src/plugins/active.ts | Active engine/source helpers |
frontend/src/engines/catalog.ts | Built-in engines |
Invariants
- Runner is the only chart-facing calc orchestrator (avoid duplicate apply logic in components).
- Errors still
setLastRunwithstatus: 'error'when possible. - Clearing overlays happens before re-adding—no unbounded series leak.
- AXIS does not interpret Pine; it only maps
RunResult.
Failure modes
| Symptom | Layer |
|---|---|
| Engine exception | Results error + status |
| Success empty plots | Script/meta—not runner |
| Manager null | Chart not mounted; run still sets lastRun |
| AbortError | Timeout—reduce bars or optimize script |