Skip to main content

py_stream_coinapi_deltas

Function py_stream_coinapi_deltas 

Source
pub fn py_stream_coinapi_deltas(
    filepath: PathBuf,
    instrument_id: InstrumentId,
    date: Option<Date>,
    chunk_size: usize,
    price_precision: Option<u8>,
    size_precision: Option<u8>,
    limit: Option<usize>,
) -> PyResult<CoinApiDeltaStreamIterator>
Expand description

Streams order book deltas from a CoinAPI T-LIMITBOOK_FULL flat file in chunks.

A chunk ends only at the end of an event, so it can exceed chunk_size, unless a limit ends it partway through one. Dates rows as load_coinapi_deltas does, infers each precision not given from the leading rows, and raises for a later value that would need rounding.

ยงErrors

Returns an error if chunk_size is outside [1, 1_000_000], no date is known, or the file cannot be opened. Python receives a ValueError.