Quantitative research engine

Explore strategy ideas.
Measure with care.

A developer-focused backtesting engine that pairs a C++20 core with Python workflows and an optional CUDA build path for quantitative research on historical market data.

Early-stage engineering project · CPU fallback verified on macOS Apple Silicon · GPU validation remains in progress

research_run.py
engine = FastQuantEngine(market_data)
results = engine.run_parameter_sweep(
  fast_window_range=(5, 50),
  slow_window_range=(10, 100),
  slippage_bps=1.5, commission_bps=0.5
)
Illustrative visualizationNo measured run shown
Research software, not a live trading product. The repository documents a working CPU fallback. GPU builds, CPU/GPU equivalence, and performance figures still need hardware validation. Backtest results require independent review.

From market data to comparable experiments.

MochaTrade focuses on the compute layer of strategy research: prepare historical data, explore parameter ranges, and inspect results with execution assumptions made explicit.

Explore parameter ranges

Run fast/slow window sweeps from a Python-facing interface. Invalid fast-at-or-above-slow combinations are excluded.

Model selected costs

Configure latency, bid-ask spread or slippage, and transaction fees or commission when evaluating a strategy.

Inspect research outputs

Review total P&L, Sharpe ratio, maximum drawdown, trade count, and win rate. These are backtest statistics, not a promise of live performance.

Python for iteration.
C++ for the core.

A shared engine interface supports CPU development and a separate CUDA-enabled build path. The project documents NumPy inputs through nanobind and a Structure of Arrays data layout. Input data is copied into unified memory; the Python-to-engine handoff is not zero-copy.

An N+1 execution lock is intended to enforce temporal barriers and help reduce look-ahead bias. CPU and GPU output equivalence remains a validation goal.

C++20
Backtesting core and CPU fallback
CUDA
Optional NVIDIA GPU build path; hardware validation is outstanding
nanobind
Python bindings for the engine interface
SoA + N+1
Separate market-data arrays and temporal execution barriers
Microstructure
Configurable latency, spread/slippage, and fees

Built carefully. Validated in stages.

The project records CPU fallback verification on macOS Apple Silicon. The following engineering work is still open.

Build and exercise the CUDA configuration on supported NVIDIA hardware.
Compare CPU and GPU outputs within documented floating-point tolerances.
Investigate reported drawdown behavior and expand numerical edge-case coverage.
Publish reproducible benchmarks with hardware, workloads, and measurements.
Exploratory · not implemented

Possible Claude/API workflows

If a language-model integration is added, it could help draft a parameter-sweep configuration for review, summarize result tables, or explain configuration and test output. There is no Claude integration today, and any generated research suggestions would need independent validation. The engine does not make live trading or investment decisions.

Backtesting has limitations. Results depend on data quality and assumptions about timing, costs, liquidity, and market impact. This project does not include live order execution, portfolio construction, risk management, or compliance controls.

Read the code. Follow the validation work.

Browse the implementation, build notes, test suite, and GPU validation guides in the public repository.

Open the GitHub repository