quantdata.volume_curves.minutes#
Fetch minute bars from Massive (Polygon) API for a given ticker and date.
Key behaviors: - Uses adjusted minute aggregates (1/minute) from Polygon/Massive. - Computes overnight returns based on two-day data. - Converts timestamps to America/New_York and normalizes datetime to microseconds. - Filters strictly to regular-session minutes:
Full day: 09:30 <= t < 16:00 => minute_idx in [0, 389] (390 minutes)
Half day: 09:30 <= t < 13:00 => minute_idx in [0, 209] (210 minutes)
Includes sanity checks (warnings) for missing minutes, duplicates, or unexpected counts.
- quantdata.volume_curves.minutes.fetch_minute_bars(ticker, dt, is_half_day=None, *, prev_dt=None, prev_is_half_day=None, client=None, verbose=<cdxcore.verbose.Context object>)[source]#
Fetch adjusted minute bars for a given ticker and date from Massive (Polygon) API. Note this function returns the adjusted bars; for this reason it also returns the last minute bar of the previous day (for computing adjusted overnight returns).
- Returns a Polars DataFrame with columns:
datetime: pl.Datetime[ms, America/New_York]
minute_idx: pl.Int16 (dt minutes: 0..389/209; prev close row: -1)
open: pl.Float32
close: pl.Float32
n: pl.Int32
volume: pl.Int64
vwap: pl.Float32