Skip to content

Latest commit

 

History

History
56 lines (46 loc) · 2.09 KB

File metadata and controls

56 lines (46 loc) · 2.09 KB

Optimizer

Research-focused Rust backtester and parameter optimizer for indicator-driven trading strategies on high-frequency trade data.

What it does

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

Quick start

  1. Install the Rust 2021 toolchain.
  2. Ensure HDF5 development libraries are available (macOS: brew install hdf5). If the build cannot find HDF5, set HDF5_DIR.
  3. Update the data path in src/main.rs to point to your HDF5 files (glob patterns are supported).
  4. Run:
cargo run --release

Data format

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

Project layout

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

Indicators present

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

Disclaimer

This code is for research and experimentation only and is not financial advice.

License

MIT. See LICENSE.