Research-focused Rust backtester and parameter optimizer for indicator-driven trading strategies on high-frequency trade data.
- Loads trade data from HDF5 (time, price, volume, buy_coeff).
- Runs an indicator -> signal -> broker simulation pipeline.
- Reports strategy metrics and aggregate return.
- Supports grid search and evolutionary optimization for parameters.
- Install the Rust 2021 toolchain.
- Ensure HDF5 development libraries are available (macOS:
brew install hdf5). If the build cannot find HDF5, setHDF5_DIR. - Update the data path in
src/main.rsto point to your HDF5 files (glob patterns are supported). - Run:
cargo run --releaseEach HDF5 file must include 1-D datasets with matching lengths:
time(i64)price(f64)volume(f64)buy_coeff(f64)
The loader accepts glob patterns and concatenates all matching files.
src/main.rs: entry point and wiring for data, indicator, and strategy.src/data_loader.rs: HDF5 loading and concatenation.src/strategy_base.rs: core execution loop and risk controls.src/indicator_*.rs: indicator implementations.src/grid_search.rs,src/adaptive_grid_search.rs: parameter search helpers.src/evolutionary_optimizer.rs: evolutionary search.
- Trend extraction via decycling filter (
src/indicator_decycler.rs). - Order-flow imbalance signal (
src/indicator_disbalance.rs). - Bar-based breakout/edge detectors (
src/indicator_edge*.rs). - Short-horizon HFT-style signal (
src/indicator_hft.rs). - Liquidity stress/mean-reversion with clip management (
src/indicator_liquidityecho.rs). - Regime/mode detection using Bayesian change-point logic (
src/indicator_mode*.rs). - Jump/impact detection on price moves (
src/indicator_price_jump.rs). - Reinforcement-learning style exhaustion detector (
src/indicator_rl.rs). - Drift/cusum-style walk detectors (
src/indicator_walk*.rs).
This code is for research and experimentation only and is not financial advice.
MIT. See LICENSE.