Skip to content

Align trades Monte Carlo Calmar ratio with CAGR - #613

Open
Jaco-Ren wants to merge 1 commit into
jesse-ai:masterfrom
Jaco-Ren:agent/fix-monte-carlo-calmar
Open

Jaco-Ren wants to merge 1 commit into
jesse-ai:masterfrom
Jaco-Ren:agent/fix-monte-carlo-calmar

Conversation

@Jaco-Ren

Copy link
Copy Markdown

Fixes #606

Summary

  • Annualize each Monte Carlo equity curve's return over its timestamp span before calculating the Calmar ratio.
  • Preserve a zero Calmar ratio for non-positive time spans or curves without drawdown.
  • Add focused regression coverage for the corrected formula and boundary cases.

Root cause and impact

The trades-based Monte Carlo scenarios used cumulative total return divided by maximum drawdown, while the original column used CAGR divided by maximum drawdown. On multi-year backtests, this put adjacent values on different scales, inflated scenario Calmar ratios, and made the resulting p-value misleading.

For example, a curve growing from 100 to 121 over two years with a 10% maximum drawdown now produces a 10% annualized return and a Calmar ratio of 1, rather than using the 21% cumulative return and reporting 2.1.

Coordination with #608

This change is intentionally separate from #608, which addresses #607 by changing how shuffled trade equity paths are reconstructed. This PR only calculates metrics from an already reconstructed curve and does not change trade ordering, compounding, drawdown, volatility, or Sharpe calculations.

Both changes touch monte_carlo_trades.py, so a small rebase may be required if #608 merges first, but the fixes are logically independent.

Tests

  • Focused regression tests: 3 passed using an isolated test harness.
  • Independent formula validation covered two-year and one-year gains, a multi-year loss, zero duration, and no drawdown.
  • Python syntax and Git diff checks passed.

The full Jesse suite was not run locally because the complete Jesse/Ray dependency environment is unavailable. Repository CI will run the supported platform and Python matrix.

@Jaco-Ren
Jaco-Ren marked this pull request as ready for review August 12, 2026 16:17
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.

Monte Carlo (trades): calmar_ratio uses total return while the 'original' column uses CAGR, making the two incomparable

1 participant