MCPcopy Create free account
hub / github.com/Open-Quant/openquant / build_volume_bars

Function build_volume_bars

python/openquant/bars.py:107–110  ·  view source on GitHub ↗
(df: pl.DataFrame, *, volume_per_bar: float = 100_000.0)

Source from the content-addressed store, hash-verified

105 return _rows_to_frame("", [])
106 return pl.concat(out_frames, how="vertical").sort(["symbol", "ts"])
107
108
109def build_time_bars(df: pl.DataFrame, *, interval: str = "1d") -> pl.DataFrame:
110 """Resample an OHLCV frame into time bars per symbol (AFML section 2.3.1.1).
111
112 The input goes through `openquant.data.clean_ohlcv` first (column aliases resolved, rows
113 with nulls dropped, duplicate `(symbol, ts)` keys removed) and is then processed one

Callers

nothing calls this directly

Calls 1

_build_by_symbolFunction · 0.85

Tested by

no test coverage detected