BacktestResult

Defined in fynance.backtest

class BacktestResult(equity, returns, gross_returns, positions, costs, index=None)[source]

Bases: object

Output of backtest.

Attributes:
equitynumpy.ndarray

Equity curve.

returnsnumpy.ndarray

Net strategy returns (after costs).

gross_returnsnumpy.ndarray

Strategy returns before costs.

positionsnumpy.ndarray

Position/weight book used.

costsnumpy.ndarray

Per-step transaction costs.

indexnumpy.ndarray, optional

Temporal index carried from the input.

summary(period=252)[source]

Standard performance summary.

Delegates the risk-adjusted ratios and drawdown to fynance.metrics.summary (computed on the equity curve) and adds the hit-rate and total transaction cost from the strategy’s own data.

to_numpy()[source]

Return the equity curve as a numpy array.

to_price_series()[source]

Return the equity curve as a PriceSeries.