Skip to content

2.5.0 — accounting v7: the engine's numbers, proved and pinned

Choose a tag to compare

@makedirectory makedirectory released this 08 Nov 10:36
· 5 commits to main since this release
6cd7727

Accounting v7: the engine's numbers, checked against independent calculations and pinned

A numeric review of the engine found defects that put wrong numbers in front of users and into promotion gates. This release fixes them and bumps ACCOUNTING_VERSION to 7, so earlier trials leave the default trials list (it says how many); trials archive retires the era.

Engine

  • Benchmark-relative metrics were wrong. Benchmark returns were paired with the next bar's strategy return, so alpha, beta, R², IR, Treynor and the benchmark-relative promotion prerequisite were off. A book holding its own benchmark read beta ≈ 0; it now reads ≈ 1.
  • Stops and targets that gap through fill at the open. When the open is beyond a level, the open decides which level filled.
  • A look-ahead is gone. A stop or target hit inside a bar no longer frees cash or a slot for an entry at that bar's open.
  • Cost stress means what it says. The configured spread is now applied, and the stress scales it: "3×" is 3×, where it was about 1.6×. Liquidity in cost estimates is trailing-only.
  • Walk-forward aggregate is on trading days, with the deflated-Sharpe inputs in one unit.

Live trading (paper by default)

  • Entries size like the backtest: against capital, or account equity when no capital is set (never margin buying power), minus what the book holds. Sizing moves with realized P&L.
  • A fully invested book declines new entries.
  • See the changelog for the remaining differences between live and the backtest.

Risk, portfolio and analytics

  • Factor model: gains an intercept factor, so a common market move is no longer counted as specific risk.
  • Sortino: uses the standard semideviation.
  • Transfer coefficient: now risk-weighted, so TC × IR* is the predicted IR.
  • Horizon blend weights: now maximise IC.
  • Breadth: deflates by residual correlation and reports unavailable on thin data, never 0.
  • Constant series: reports unavailable, where it used to report a ~1e16 Sharpe.
  • Labels: Monte Carlo is a real annualised Sharpe distribution. "PBO" is relabelled a heuristic, and the bootstrap statistic is labelled a Sharpe.

Why you can trust the numbers above. A new math contract, tests/math/, checks every formula against a calculation written independently of the package. It also pins the end-to-end outputs of 19 seeded scenarios. Every fix was deliberately re-broken to show the suite catches it.

pip install -U quantred. Full notes: changelog.