[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

PieceRole
runScriptEngine invocation + status/timeouts
runAndApplyChart + lastRun + results open
probeEndpointSettings health check helper
IndicatorPanelList/toggle scripts in store
IndicatorCardPer-script UI chrome

Language semantics: PYNE runtime.

Conceptual model

Interface surface

runScript options

OptionDefaultMeaning
silentfalseQuiet status; live re-run logging
timeoutderivedInteractive: scales with bars (60–180s); silent 45s

runAndApply options

OptionDefaultMeaning
openResults!silentOpen results drawer
indicatorIdoptionalUpdate 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

PathRole
frontend/src/indicators/runner.tsPipeline
frontend/src/indicators/IndicatorPanel.tsxList UI
frontend/src/plugins/active.tsActive engine/source helpers
frontend/src/engines/catalog.tsBuilt-in engines

Invariants

  1. Runner is the only chart-facing calc orchestrator (avoid duplicate apply logic in components).
  2. Errors still setLastRun with status: 'error' when possible.
  3. Clearing overlays happens before re-adding—no unbounded series leak.
  4. AXIS does not interpret Pine; it only maps RunResult.

Failure modes

SymptomLayer
Engine exceptionResults error + status
Success empty plotsScript/meta—not runner
Manager nullChart not mounted; run still sets lastRun
AbortErrorTimeout—reduce bars or optimize script

See also