Skip to main content

Module runner

Module runner 

Source
Expand description

Batch and replay execution over a full bar history. Batch and replay execution over a full bar history.

Indicator::on_bar processes one bar and returns the latest value; consumers wanting a full, timestamp-aligned output series over a backfill (charting, backtesting, golden-fixture generation) previously had to hand-roll the loop. These helpers standardize it: deterministic (always start from Indicator::reset), timestamp- aligned (one entry per input bar, in order, None during warmup), and reproducible (pure function of the indicator + bar slice, safe to call repeatedly for replay).

Structs§

BatchResult
Result of run_batch_with_applicability: the batch output series plus the applicability verdict for the indicator/series-capabilities pair it was computed for.
TimestampedOutput
One entry of a batch/replay output series: the source bar’s timestamp paired with the indicator’s output for that bar (None while still inside the warmup period).

Functions§

run_batch
Resets indicator, then feeds bars through it in order, collecting one TimestampedOutput per bar. Two calls with the same indicator type and bars slice always produce identical results (deterministic backfill / reproducible replay).
run_batch_checked
Like run_batch, but validates each bar via Indicator::on_checked_bar and stops at the first invalid bar, returning the entries collected so far plus the validation error.
run_batch_with_applicability
Like run_batch, but also attaches an crate::applicability::Applicability verdict for the named indicator against capabilities.