Skip to content

fix(backtest): correct CN drawdown Sharpe and Calmar metrics - #252

Merged
Pigbibi merged 1 commit into
mainfrom
fix/audit-f2-metrics-20260908
Sep 7, 2026
Merged

fix(backtest): correct CN drawdown Sharpe and Calmar metrics#252
Pigbibi merged 1 commit into
mainfrom
fix/audit-f2-metrics-20260908

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Scope

  • F2 / RA-03 / RA-06: include initial NAV in drawdown, use annualized arithmetic mean for zero-rate Sharpe, and preserve negative CAGR in Calmar.
  • Only three production formula lines and two existing test files; no dependency, lockfile, catalog, promotion authority, data, or historical artifact changes.

Validation

  • Fresh base: 7fb104e.
  • Isolated environment: uv sync --locked --offline --extra test; pinned QPK c812ed70f83d61bdf1816fa5ca112b0f6976c6b6; uv pip check passed.
  • Existing targeted baseline: 9 passed. New regression RED: 5 failures. GREEN: 18 passed, 4 subtests.
  • Hand-calculated oracles: MDD [-10%] -> -10%, [-10%,-10%] -> -19%, [+10%,-20%] -> -20%; arithmetic Sharpe [10%,-10%] -> 0 and [1%,2%,-1%] -> 8.485281374238571. Calmar negative/positive/zero and undefined zero-drawdown cases covered.
  • Full offline suite: 102 passed, 4 subtests, 1 pre-existing checkout-path failure in test_package_root_exports_use_local_source_tree (expects CnEquityStrategies/src without the worktree directory). The test and package init are unchanged from main; not bypassed or modified.
  • Full Ruff, diff, scope, compile, and added-line credential-pattern checks passed.

No provider, real replay, deployment, account operation, or historical evidence recomputation.

Co-Authored-By: Codex <noreply@openai.com>
@Pigbibi
Pigbibi merged commit d904c9c into main Sep 7, 2026
2 checks passed
@Pigbibi
Pigbibi deleted the fix/audit-f2-metrics-20260908 branch September 7, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant