Backtesting engine + strategy harness for crypto perpetuals. Python control layer with a Rust fast path for hot loops (signal computation, walk-forward, sweep).
- Honest costs first. Every backtest runs with realistic fees, slippage, and funding cost overlaid. A strategy that only looks good with zero costs isn't a strategy.
- Walk-forward > in-sample Sharpe. In-sample results are for parameter selection only. All headline numbers are walk-forward.
- Mirror-matched benchmark. Strategies are compared against a buy-and-hold on the same universe over the same period — not against BTC alone.
- Full pool sweeps. Sweeps run over the whole tradable universe by default, not one class at a time (survivorship-safe).
- Portfolio realism. Concurrent-margin gate, MM% cap, funding accrual, and turnover throttling are enforced at the harness level so per-strategy code stays simple.
harness/— event loop, portfolio, fills, funding accrual.strategies/— pure signal functions.engine_rs/— Rust extension (PyO3) for fast signal + walk-forward paths.config/sweeps/— sweep grids (universe x params x time).scripts/— sweep launcher, leaderboard, replay tools.runs.db— SQLite index of all past runs.
- Python 3.10+
- Rust toolchain (for the extension; falls back to Python if absent)
- Parquet OHLC data in
ohlc_*/per asset class
pip install -e .
maturin develop --release
python -m harness.run --config config/sweeps/my_grid.yaml
- Not a live trading system. Live execution lives in venue-specific bot repos.
- Not a strategy library. Strategies here are prototypes; production strategies live in strategies_backup and the venue bots.