- Docker: Delete 23 deprecated Dockerfiles, fix CI/CD to use Dockerfile.foxhunt-build - Config: Remove 36 .env files, keep 4 essential, delete config/environments/ - Docs: Archive 614 Wave D files to docs/archive/wave_d/, 95% reduction in root - Scripts: Delete 56 deprecated scripts, keep 58 production-critical (49% reduction) - Python: Organize 37 scripts into scripts/python/ subdirectories, delete ml/python/ - Build: Remove 1GB artifacts, delete old venvs, clean Python cache from git - Migrations: Delete deprecated directory (4,432 lines), remove duplicate database/migrations/ - Infrastructure: Delete deployment/ (61 files), docs/scripts/ (8 files) Total impact: ~2,500 files cleaned, 750MB+ space freed, zero production impact All deleted scripts backed up to archives. runpod/ and tests/runpod/ preserved. data_acquisition_service retained per user request.
Backtesting Service
Overview
The backtesting_service offers an independent and isolated environment for rigorously testing and validating trading strategies against historical market data. It provides a robust platform for simulating trading performance, analyzing strategy efficacy, and generating comprehensive performance reports before live deployment.
Features
- Independent Backtesting Service: Operates autonomously, allowing for parallel and isolated strategy evaluations.
- gRPC API for Backtest Execution: Exposes a clear API for submitting and managing backtesting jobs.
- Strategy Testing and Validation: Enables comprehensive testing of various trading strategies under different market conditions.
- Performance Reporting: Generates detailed reports including metrics like P&L, Sharpe ratio, drawdown, and win rate.
- Data Replay Engine: Accurately replays historical market data, simulating real-world order book dynamics and trade execution.
- Results Persistence: Stores backtesting results and reports for historical analysis and comparison.
gRPC API
The backtesting_service exposes a gRPC API for initiating and retrieving backtest results. Key endpoints include:
RunBacktest- Submit backtest configuration and strategyGetBacktestResults- Retrieve results for completed backtestsListAvailableStrategies- List registered strategiesGetBacktestReport- Get detailed performance report
Running the service
To run the backtesting_service binary:
cargo run --bin backtesting_service
Data Requirements
The service requires historical market data in Parquet format:
- Data should be stored in the configured data directory
- Supports tick data, order book snapshots, and OHLCV candles
- Data must include instrument, timestamp, and price/quantity fields
Testing
To run the tests for the backtesting_service crate:
cargo test --package backtesting_service
Documentation
Comprehensive API documentation is available at docs.rs/backtesting_service.