BackTest (fynance.backtest)ΒΆ

Vectorized backtesting engine and result. Plotting/reporting lives in fynance.plot (tearsheet).

backtest(data, positions[, cost, capital, ...])

Run a vectorized backtest.

BacktestResult(equity, returns, ...[, ...])

Output of backtest.

ProportionalCost([fee, slippage])

Proportional transaction cost: (fee + slippage) * turnover.

MarketImpactCost([fee, impact, exponent])

Non-linear market-impact cost: linear fee + convex impact term.

HoldingCost([borrow, financing, cash_rate, ...])

Per-bar carry cost on the held book (not turnover).

CompositeCost(models)

Stack several cost models into one.

capacity_curve(weights, X, aums, cost_factory)

Sweep net performance across a book of AUM levels.

breakeven_fee(weights, X[, period, tol])

Proportional fee at which the net Sharpe ratio crosses zero.

set_text_stats(underly[, period, accur, ...])

Set a table as string with different indicators (accuracy, perf, vol and sharpe) for underlying and several strategies.

BacktestNeuralNet([figsize, loss_xlim, ...])