quantlab.backtest.live.mirror_new_bars#
- quantlab.backtest.live.mirror_new_bars(source, store, end)[source]#
Bring a store copying some of
source’s variables up toend.The store holds a subset of
source’s variables on(timestamp, symbol), written once fromsource.panel(the example’sprices.zarr, a copy of the index roster store).source’s bars after the store’s last, up toend, are appended (widen_and_append, index coordinates in one chunk). Whensourceholds a symbol the store lacks, appending would give it no history, so the store is instead rewritten fromsourceover its own first bar toend(through a sidecar and two renames, so an interrupted rewrite leaves the old store or the new one): what a fresh copy would be.- Parameters:
- sourceBaseDataset
The dataset copied.
- storestr or os.PathLike
The copy’s Zarr store.
- endstr or datetime-like
The last bar to copy.
- Returns:
- str
"current"(nothing to do),"appended"or"rewritten".
- Raises:
- KeyError
If
sourcelacks a variable of the store.
Examples
>>> mirror_new_bars(index_dataset(), WORK / "prices.zarr", "2026-10-07") 'appended'