Ultra-Low Latency High-Frequency Trading Platform 🔥 Ultra-Low Latency Engine < 100μs market data processing< 500μs order placement< 1ms ML inference< 2ms end-to-end execution🧠 Advanced ML Integration LSTM & Transformer models ONNX runtime optimization Real-time prediction pipeline Feature engineering automation Real-time position tracking VaR calculation & monitoring Emergency stop mechanisms Multi-symbol risk controls 🏗️ Production Infrastructure Docker containerization Prometheus/Grafana monitoring PostgreSQL & Redis integration Automated VPS deployment
# 🔥 Automated installation (recommended)
git clone < repository-url> && cd quantx-engine
chmod +x scripts/setup.sh && ./scripts/setup.shWhat this does: Installs dependencies → Sets up Python env → Trains ML models → Builds C++ engine → Runs tests
⚡ Instant Deployment Options Method Setup Time Best For 🐳 Docker docker-compose up -dLocal development ☁️ VPS ./scripts/deploy.shPaper trading 🖥️ Local ./build/quantx_engineTesting & debug
🖥️ Hardware & OS Requirements Component Minimum Recommended OS Ubuntu 20.04+ / macOS 10.15+ Ubuntu 22.04 LTS CPU Multi-core x64 Intel/AMD 8+ cores RAM 8GB 16GB+ Storage 10GB free 50GB SSD Network Stable broadband Low-latency connection
🛠️ Software Dependencies # Core dependencies
- C++17 compiler (GCC 9+, Clang 10+)
- CMake 3.16+
- Python 3.8+
- Docker & Docker Compose (optional)
# Libraries (auto-installed)
- Boost 1.70+
- ONNX Runtime 1.16+
- WebSocket++
- nlohmann/jsonStep 1: System Dependencies 🐧 Ubuntu/Debian sudo apt-get update && sudo apt-get install -y \
build-essential cmake git wget curl pkg-config \
libboost-all-dev libssl-dev nlohmann-json3-dev \
libwebsocketpp-dev python3 python3-pip python3-venv 🍎 macOS brew install cmake boost openssl nlohmann-json websocketpp python3 Step 2: ONNX Runtime Setup # Download and install ONNX Runtime
wget https://github.com/microsoft/onnxruntime/releases/download/v1.16.3/onnxruntime-linux-x64-1.16.3.tgz
tar -xzf onnxruntime-linux-x64-1.16.3.tgz
sudo cp -r onnxruntime-linux-x64-1.16.3/include/* /usr/local/include/
sudo cp -r onnxruntime-linux-x64-1.16.3/lib/* /usr/local/lib/
sudo ldconfigStep 3: Python Environment # Create and activate virtual environment
python3 -m venv venv && source venv/bin/activate
# Install ML dependencies
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
pip install numpy pandas scikit-learn onnx onnxruntime joblib matplotlib seaborn# Train ML modelssource venv/bin/activate && python scripts/export_models_to_onnx.py
# Build C++ engine
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release && make -j$( nproc) # 🎉 Launch the engine
./quantx_engine🔧 Main Config (config/config.json) {
"engine" : {
"initial_capital" : 1000000.0 ,
"paper_trading" : true ,
"log_level" : " INFO"
},
"market_data" : {
"websocket_url" : " wss://api.kite.trade/ws" ,
"api_key" : " your_api_key_here" ,
"symbols" : [" NSE:NIFTY50" , " NSE:BANKNIFTY" , " NSE:RELIANCE" ]
},
"risk_management" : {
"max_position_value" : 100000.0 ,
"max_daily_loss" : 50000.0 ,
"max_drawdown" : 0.15 ,
"leverage_limit" : 2.0
}
} Provider Purpose Setup Link Zerodha Kite NSE/BSE Market Data kite.trade Paper Trading Risk-free Testing No keys required ✅
Component Target Achieved Status Market Data Processing < 100μs ~50μs ✅ Order Placement < 500μs ~200μs ✅ ML Inference < 1ms ~0.3ms ✅ Risk Checks < 50μs ~20μs ✅ End-to-End < 2ms ~1ms 🚀
# Main engine logs
tail -f logs/quantx_engine.log
# Performance metrics
tail -f logs/performance.log
# Trade execution logs
tail -f logs/trades.log# Unit testscd build && ./test_quantx
# Performance benchmarks
./quantx_engine --benchmark
# ML model validation
python scripts/benchmark_models.py
# Paper trading simulation
./quantx_engine --paper-trading --duration=3600quantx-engine/
├── 🔧 src/ # C++ Core Engine
│ ├── core/ # Market data processing
│ ├── ml/ # ONNX ML inference
│ ├── risk/ # Risk management
│ └── trading/ # Order execution
├── 🧠 scripts/ # Python ML pipeline
├── ⚙️ config/ # Configuration files
├── 🧪 tests/ # Unit & integration tests
├── 📊 monitoring/ # Grafana dashboards
└── 🐳 docker-compose.yml # Container orchestration
⚡ Performance Optimization 📋 Compliance Requirements We welcome contributions! Here's how to get started:
🍴 Fork the repository🌿 Create a feature branch✨ Make your changes🧪 Add comprehensive tests✅ Run the test suite: ./build/test_quantx📝 Submit a pull requestLanguage Style Guide Formatter C++ Google C++ Style clang-formatPython PEP 8 blackDocumentation Markdown prettier
🔨 Build Issues # Missing ONNX Runtimeexport CMAKE_PREFIX_PATH=/usr/local:$CMAKE_PREFIX_PATH # Boost libraries not found
sudo apt-get install libboost-all-dev
# WebSocket++ headers missing
sudo apt-get install libwebsocketpp-dev🚨 Runtime Errors # Market data connection failed# → Check API keys in config/config.json# ONNX model not found# → Run: python scripts/export_models_to_onnx.py# Permission denied# → Run: chmod +x scripts/*.sh⚡ Performance Issues # Enable CPU performance modeecho performance | sudo tee /sys/devices/system/cpu/cpu* /cpufreq/scaling_governor
# Increase network buffer sizesecho ' net.core.rmem_max = 134217728' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
📞 Support & Community This project is licensed under the MIT License - see the LICENSE file for details.
🚨 Risk Warning: This software is for educational and research purposes only. Trading financial instruments involves substantial risk of loss and is not suitable for all investors. Past performance is not indicative of future results. The authors and contributors are not responsible for any financial losses incurred through the use of this software.
Special thanks to the open-source community and these amazing projects: