Skip to main content

limen.backtest

Evaluate aligned predictions as trading outcomes through a vectorized snapshot.

Canonical docs

What this package owns

Owns Limen's snapshot backtest and the assumptions it encodes. Does not own signal generation, experiment logging, or portfolio bookkeeping.

Key entry points

Entry pointUse caseNotes
backtest_snapshotVectorized evaluation across roundsfrom limen.backtest import backtest_snapshot
long_flat_strategyDefault execution model, or a template for a new strategyReturns an ExecutionResult; from limen.backtest import long_flat_strategy

The package root re-exports all three entry points (backtest_snapshot, long_flat_strategy, ExecutionResult); module-path imports keep working.

Adjacent modules

  • limen.log uses backtest_snapshot() to summarize experiment permutations.
  • limen.experiment and limen.sfd sit upstream by producing the predictions that backtests consume.

Quick orientation

backtest/
├── backtest_snapshot.py # Vectorized snapshot evaluator (price validation + ledger)
└── long_flat_strategy.py # Default long-only execution model

Things to know

  • The package root currently does not re-export the backtest helpers, so import from the module paths directly.
  • backtest_snapshot() is the standard analysis path for vectorized experiment-sweep evaluation.
  • Snapshot return and cost outputs are basis-point scaled (*_bps columns), matching the basis-point fee and slippage inputs.