Skip to content

takinanton/hl-backtest-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hl-backtest-engine

Backtesting engine + strategy harness for crypto perpetuals. Python control layer with a Rust fast path for hot loops (signal computation, walk-forward, sweep).

Design principles

  • 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.

Layout

  • 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.

Requirements

  • Python 3.10+
  • Rust toolchain (for the extension; falls back to Python if absent)
  • Parquet OHLC data in ohlc_*/ per asset class

Run

pip install -e .
maturin develop --release
python -m harness.run --config config/sweeps/my_grid.yaml

Non-goals

  • 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.

About

Backtesting engine + strategy harness for crypto perpetuals (Python + Rust)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors