Core (fynance.core)¶
The spine of the library: the PriceSeries value object,
the OHLCV aligned multi-series container, the
typing.Protocol seams the pipeline composes through, and two executable
house-rule checks for them.
|
Thin, numpy-backed financial time-series. |
|
Thin, numpy-backed container of aligned OHLCV series. |
|
Port: load external data into a |
|
A stateful or stateless feature transformation. |
|
A predictive model mapping features to a target/signal. |
|
Map a covariance/return matrix to portfolio weights. |
|
Map a weight book to per-step transaction costs. |
|
Reduce a return series to a scalar performance number. |
Checks¶
check_conforms smoke-runs a protocol’s methods on a candidate
instance with seeded synthetic data; assert_causal probes an
arbitrary callable for lookahead bias by perturbing its input strictly after
a probe index and requiring the output strictly before it to be unchanged.
Both are usable straight from downstream pytest suites.
|
Smoke-run protocol's methods on obj with seeded synthetic data. |
|
Assert func never uses future information (no lookahead bias). |