CostModel¶
Defined in fynance.core
- class CostModel(*args, **kwargs)[source]
Bases:
ProtocolMap a weight book to per-step transaction costs.
Concrete models live in
fynance.backtest.cost. A model may also expose an optionalcomponents(weights) -> dict[str, NDArray]returning a per-step breakdown whose values sum to__call__(e.g.transactionvsmarket_impact); the engine carries it through to the tearsheet’s cumulative-fees panel when present. It is not part of the required interface — only__call__is.- __call__(weights)[source]
Return per-step costs aligned with the weight series.