bagelquant-bt measures research outputs. It does not build signals and it does not retrieve market data.

The expected workflow is:

daily data -> long-form factor or weights DataFrame -> bagelquant-bt result

The package is Polars-first. Prices and signal values must be long-form polars.DataFrame objects keyed by time and asset_id.

Main Entry Points

from bagelquant_bt import BacktestConfig, run_backtest

result = run_backtest(
    weights,
    prices,
    kind="weights",
    config=BacktestConfig(initial_capital=1_000_000),
)

Use kind="weights" when the first argument is portfolio weights.

Use kind="factor" when the first argument is factor scores.

Docs