[Strategy and results]

How AXIS turns engine events into trades, stats, chart markers, equity, and exportable Results tabs.

Strategy and results

After Run, the engine returns a structured payload. AXIS AXIS normalizes events, pairs trades, paints markers, and exposes a Results drawer. Strategy math here is a viewer—not a brokerage.

Abstract

Engine RunResult (simplified):

status: success | error
plots[] | series{}
events[]     — entries, exits, orders, custom
drawings[]   — Pine line/label/box objects
meta{}       — ms, overlay, script_name, plot_meta, …
error?

AXIS stores this as store.lastRun (in-memory; not fully rehydrated from localStorage).

Conceptual model

Results drawer tabs

TabOperator value
EventsChronological normalized stream (kind, time, price, id, dir)
StrategyClosed trades table + summary metrics
PlotsSeries inventory (points, last value)
MetricsRuntime, status, engine, source, bars, high-level stats
RawPretty-printed JSON for support / diffs

Strategy metrics

Computed by buildStrategyReport:

StatDefinition (viewer)
totalPnlSum of closed trade PnL (price units)
winRate% wins among closed trades
profitFactorGross profit / gross loss
avgTrade / avgWin / avgLossMeans over closed set
maxDDPeak-to-trough on cumulative trade PnL path
wins / losses / tradesCounts

Pairing rules: entry-like kinds open by id; exit/close kinds match id or sole open trade. Direction flips short PnL. Missing prices drop the event from pairing (with normalization attempting OHLC fill from bars when available).

Chart coupling

  • Trade markers on price pane (eventsToMarkers)
  • Scroll-to-time on trade row click
  • Equity curve series when strategy events warrant (buildEquityCurve)
  • Status bar snippet: closed trade count · net PnL when available

Export

ExportContent
JSONFull lastRun
CSVClosed trades (tradesToCsv)
ClipboardCSV of trades when supported

Filenames: axis-run-<ts>.json, axis-trades-<ts>.csv.

Interface surface

  • Drawer height persisted (resultsPanel.height); open state toggled after runs (openResults default true for interactive runs)
  • Silent live re-runs can skip auto-open
  • Equity / indicator panes created on demand when non-overlay or strategy paths need them

Worked example

  1. Load BTCUSDT daily history.
  2. Run a crossover strategy (see Quick start).
  3. Results → Strategy: inspect win rate.
  4. Click a green trade → chart jumps to entry.
  5. Export CSV for a notebook.

Internals

PathRole
frontend/src/ui/ResultsPanel.tsxDrawer UI
frontend/src/results/strategy.tsTrade pairing + stats
frontend/src/results/events.tsNormalize events, markers, equity
frontend/src/indicators/runner.tsrunAndApply orchestration
frontend/src/chart/series-factory.tsPlot colors / series

Language-level strategy semantics: PYNE runtime.

Invariants

  1. Results are a function of last successful/error payload + current bars—changing bars without re-run can desync prices used for fill.
  2. Viewer PnL is not currency-normalized; treat as relative tape units.
  3. meta.overlay === false routes plots to an indicator pane, not price.
  4. Pine drawings (script) are distinct from user drawing tools (Drawings).

Failure modes

SymptomExplanation
Events but 0 tradesOnly entries, or unpaired ids
Empty plotsSeries all null / name filtered (__ prefix hidden)
Markers missingManager not mounted or events lack times
Huge Raw JSONMany events—export file rather than copy

See also