Skip to content

C1b — Monte Carlo and candle-bootstrap resampling: is the equity curve an outlier? #441

Description

@eaitbrahim

PRD §3 C1. Jesse ships this; keel has nothing equivalent.

The question it answers

Right now keel's live open question is: a reconstructed 14.9% win rate against a 14.9% break-even — is that real, or one lucky path? PBO/CSCV cannot answer it (wrong failure mode), and Deflated Sharpe only discounts for the number of trials tried.

Resampling attacks it directly.

What Jesse does

  • monte_carlo_trades — reshuffles the sequence of completed trades. Same trades, different order; if the equity curve's shape depended on lucky ordering, the distribution reveals it.
  • monte_carlo_candles — perturbs the price series itself and re-runs.
  • Candle perturbation pipelines (jesse/candle_pipelines/) — gaussian_noise, gaussian_resampler, moving_block_bootstrap, pluggable onto a strategy.

Moving-block bootstrap is the most valuable of these for keel, because it preserves local autocorrelation while resampling — the right null for a trend-following rule, where naive IID resampling would destroy the very structure turtle_breakout trades.

Fit with keel

  • keel/sim/portfolio_sim.py already walks a shared timeline through the same strategy.engine.evaluate() the live path uses — the resampled series can feed the same entry point.
  • Metrics are hand-rolled pure Decimal (keel/sim/metrics.py), so a distribution over N runs is straightforward.
  • Results should land in the hash-chained trials ledger (keel/research/ledger.py) with provenance, like every other experiment.

Complementarity worth noting

This is frequentist resampling; the Quant Lab note (#432) proposes a Bayesian π_edge = P(p > p_be | D). They answer the same question from different directions and their agreement or disagreement is itself informative. Both should be available before the pooled review.

Scope

  • keel trials monte-carlo --rule <id> --mode {trades,candles} with a seed for reproducibility (determinism is a keel constraint).
  • Report the observed equity curve's percentile within the resampled distribution.
  • Ledger every run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestresearchMeasurement, validation or KB work (Research & validation)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions