Package-level declarations
Types
Makes the local tick store complete for a backtest before it runs: fetch missing days (via the store's configured fetcher), validate session-hour coverage against the trading calendar, repair any incomplete day once (delete + refetch), then fail loud on a remaining hole unless allowed.
Which replayed symbols fill triggered stops and limits at their own level rather than at the triggering tick: exactly the symbols whose ticks are synthesized from bars, where the only intrabar prints are the bar's extremes (see com.qkt.broker.PaperBroker). A symbol replayed from real ticks fills at the tick, as live does. A continuous futures stream (VENUE:ROOT@front) synthesized from bars covers the contracts it trades (VENUE:ROOT_240927), whose fills the venue sees by contract.
Cross-strategy ("book") analytics for a portfolio backtest — the relationships the per-strategy reports cannot show on their own. Null on a single-strategy run.
Online cross-strategy return statistics for a book of strategies sharing one account.
An auditable book-risk action. Empty until the limit/de-risk/allocation phases populate it.
Accumulates the book-risk measurement series for a portfolio run. Subscribes to the same sample cadence as EquityCurveCollector; on each sample it pulls a com.qkt.risk.book.BookSnapshot from the source, decimates the exposure/equity series, tracks peak gross/net exposure, and folds the book return (Δ equity / starting balance) into an online variance for annualized book volatility.
The book-risk dataset for a portfolio run: a decimated time series of exposure + equity, summary stats, and the event log. Null on single-strategy runs (no book). This is the "exact data we need" to see how the book behaved — surfaced in --json (summary) and the --report bundle (full csv).
One book-risk reading over time: exposure + equity at a sample instant.
Selects which simulated broker backs a Backtest run.
Lag-1 autocorrelation of per-bar close-to-close returns for one symbol, bucketed by the conditions under which the return occurred.
Pearson correlation of two strategies' per-sample return series over the run.
Online worst-intraday-drawdown accumulator. For each UTC day it tracks the day-open equity and the running intraday minimum; that day's drawdown is (open − min) / open. maxDailyDrawdown is the largest such value across all days. Constant memory — no per-day or full-curve retention.
Account equity over one UTC trading day: first, highest, lowest and last sample (#1277).
Folds full-resolution equity samples into one DailyEquity row per UTC day, so a consumer never has to rebuild a calendar from the thinned chart curve. Days are keyed the same way as pnl_components.csv (UTC midnight). Memory is one row per day seen, about 1,500 for six years.
A bounded, even-coverage view of an equity curve for charting.
Bounded, even-coverage view of any time-ordered series for charting — the generic form of DecimatedCurve. Keeps at most cap samples by retaining every stride-th one and halving + doubling the stride whenever the kept set would exceed cap. The first sample is always kept and snapshot always ends at the most recent sample, so endpoints survive thinning.
Equity-curve performance metrics computed online, one sample at a time.
Position snapshot captured around a single fill.
Wraps a portfolio child strategy in backtest so its behaviour matches a live com.qkt.cli.daemon.portfolio.PortfolioSupervisor:
Thrown when, after fetching, the data still has holes and the caller did not allow incompleteness.
A named sub-window of one run, [fromMs, toMs), whose metrics are computed from the same full-resolution equity samples and closing fills as the run's global report (#1276) — e.g. an out-of-sample tail. A window covering the whole run reproduces global.
Equity return of one calendar month: month-end close over the previous month-end close, minus one.
A symbol the backtest needs data for. bareSymbol has no NAME: prefix (e.g. XAUUSD).
Ordered causal evidence retained from the shared engine pipeline during replay.
Market inputs actually attempted, accepted, and emitted by one replay.
Computes ConditionalAutocorr online from the closed-bar stream, one bar at a time.
Runaway-breaker thresholds and trip evidence attached to a replay result.
The run's option structures, one row each in the order they first appeared, from their books' events.
One window's finished report. report carries the same fields as the run's global (PerformanceReport); its totalPnL is the equity change between the window's first and last samples (equityStart to equityEnd) and its trade statistics count the closing fills stamped inside the window.
The online metrics of one MetricsWindow, fed only the samples inside it.
Functions
Month-over-month equity returns from a daily series. The first month is measured from the first day's open, every later month from the previous month's last close, so compounding every return gives exactly finalClose / firstOpen - 1 (the run's total return). Empty when daily is empty.
What the run's evidence.execution records about this execution model.