QuantForge
QuantForge is a CLI-first, deterministic trading research toolkit written in Rust. It focuses on market data ingestion, strict normalization, reproducible backtesting, and a strategy SDK for building TradingView/PineScript-like workflows in pure Rust.
This initial release is intentionally small and opinionated:
- Binance Spot OHLCV download over public REST endpoints
- SQLite candle storage with idempotent upserts
- validation for gaps, duplicates, ordering, and OHLC sanity
- deterministic event-driven backtesting
- built-in SMA crossover example strategy
There is no UI. The CLI is the product.
Why a single crate?
This repository is intentionally structured as a single Cargo package for the first public release so versioning, publishing, installation, and contributor onboarding stay simple.
Internal boundaries still exist as Rust modules:
model- normalized market types and validationexchange- exchange client trait and Binance implementationstorage- candle store trait and SQLite implementationsdk- strategy trait, context, indicators, example strategiesbacktest- deterministic bar-by-bar engine
Determinism contract
Backtests in QuantForge follow these rules:
- timestamps are stored as UTC epoch milliseconds
- prices and volumes use decimal arithmetic, not floating-point math
- strategies observe a bar at close and submit intent
- the engine executes that intent at the next bar open
- data validation is explicit, not best-effort
Install
If the quantforge package name is available on crates.io:
If you are working from source:
Quickstart
Download candles into SQLite:
Validate the stored series:
Run the built-in SMA crossover backtest:
Local development
Run the full quality gate before opening a PR:
Docker
Build the CLI image:
Run the CLI inside Docker:
Roadmap
- incremental download and resume support
- additional exchanges such as Bybit
- more indicators and a richer strategy SDK
- alternative storage backends such as Parquet or Postgres
- research-oriented parameter sweeps and snapshot reports
License
Licensed under MIT license.