Skip to main content

Module data_feed

Module data_feed 

Source
Expand description

Data feed abstraction for backtesting.

A DataFeed produces a time-ordered sequence of MarketEvents that the backtest runner consumes. Two built-in implementations are provided:

  • VecFeed — wraps a pre-loaded Vec<MarketEvent> (useful for tests and any data source you can materialise up-front).
  • Conversion helpers from qs-data-preprocess types (Tick, Bar) so you can query DuckDB, convert the results, and feed them straight in.

Structs§

BarExecutionPrices
Prices a FutureQuote replay executes a bar against, read as midpoints with a symmetric half spread.
EventBatchFeed
Groups a fallible event cursor into complete timestamp batches.
EventMetadata
Deterministic identity and ordering metadata for one market event.
FeedEvent
A market event paired with non-persisted feed metadata.
KWayMergeFeed
Streaming deterministic merge over multiple fallible timestamp batch feeds.
SequencedMarketEvent
A streaming event paired with its physical source-row ordinal.
SeriesRoles
Roles a feed event serves in a multi-series backtest.
TimestampBatch
A contiguous batch of events with the same timestamp.
VecFeed
In-memory data feed backed by metadata-bearing market events.

Enums§

EventBatchFeedError
Errors produced while grouping a fallible event source into timestamp batches.
KWayMergeError
Errors produced while deterministically merging timestamp batch feeds.
MarketEvent
A single market data event consumed by the backtest runner.

Traits§

DataFeed
Sequential source of market events for backtesting.
EventSourceItem
Converts an event source item into an event and optional physical ordinal.
FallibleBatchFeed
Fallible source of complete timestamp batches.

Functions§

bars_to_feed
Convert bars into a primary-series feed.
bars_to_feed_with_metadata
Convert bars into a deterministically ranked feed.
merge_feeds
Merge feeds using input position as series_rank.
ticks_to_feed
Convert ticks into a primary-series feed.
ticks_to_feed_with_metadata
Convert ticks into a deterministically ranked feed.