| # STACKS.md | |
| ## Description | |
| ML-3m-trader is a high-performance, multi-language trading framework designed for the XAUUSDc 3rd minute timeframe. It bridges the data processing and machine learning capabilities of Python with the safety and speed of Rust for execution components. The system integrates directly with MetaTrader 5 for real-time market data and historical auditing. | |
| ## System Overview | |
| ```mermaid | |
| graph TD | |
| A[MetaTrader 5] -->|OHLCV Data| B(Data Fetcher) | |
| B --> C(Feature Engineering) | |
| C --> D(Labeling Engine) | |
| D --> E(ML Pipeline) | |
| E --> F{Backtesting} | |
| F -->|Performance| G(Metrics Report) | |
| F -->|Execution| H[Live Trading Interface] | |
| subgraph "Hybrid Processing" | |
| C | |
| D | |
| E | |
| end | |
| ``` | |
| ## Project Structure | |
| ```text | |
| ML-3m-trader/ | |
| βββ python_version/ | |
| β βββ backtester.py | |
| β βββ config.py | |
| β βββ data_fetcher.py | |
| β βββ diag_mt5.py | |
| β βββ features.py | |
| β βββ GUIDE.md | |
| β βββ labeler.py | |
| β βββ main.py | |
| β βββ metrics.py | |
| β βββ model.py | |
| β βββ README.md | |
| βββ rust_ml_trader/ | |
| β βββ data/ | |
| β β βββ raw_xauusdc_m3.csv | |
| β βββ models/ | |
| β β βββ rf_model.bin | |
| β βββ results/ | |
| β β βββ report.txt | |
| β β βββ trades.csv | |
| β βββ src/ | |
| β β βββ backtester.rs | |
| β β βββ config.rs | |
| β β βββ data_fetcher.rs | |
| β β βββ features.rs | |
| β β βββ labeler.rs | |
| β β βββ main.rs | |
| β β βββ metrics.rs | |
| β β βββ model.rs | |
| β β βββ types.rs | |
| β βββ .gitignore | |
| β βββ Cargo.lock | |
| β βββ Cargo.toml | |
| β βββ GUIDE.md | |
| β βββ LICENSE | |
| β βββ README.md | |
| βββ SUM3API (local)/ | |
| β βββ MQL5/ | |
| β β βββ Experts/ | |
| β β β βββ ZmqPublisher.mq5 | |
| β β βββ Include/ | |
| β β β βββ Zmq/ | |
| β β β βββ Zmq.mqh | |
| β β βββ Libraries/ | |
| β β βββ libsodium.dll | |
| β β βββ libzmq.dll | |
| β βββ Rustmt5-chart/ | |
| β β βββ src/ | |
| β β β βββ main.rs | |
| β β βββ Cargo.lock | |
| β β βββ Cargo.toml | |
| β βββ .gitignore | |
| βββ .gitignore | |
| βββ feature_process.png | |
| βββ LICENSE | |
| βββ metrics.png | |
| βββ README.md | |
| βββ requirements.txt | |
| βββ sractch.md | |
| ``` | |
| ## Techstack | |
| Audit of **ML-3m-trader** project files: | |
| | File Type | Count | Lines | Syntax Hits | Size (KB) | | |
| | :--- | :--- | :--- | :--- | :--- | | |
| | Rust (.rs) | 10 | 2283 | 570 | 76.1 | | |
| | Python (.py) | 9 | 1459 | 438 | 46.9 | | |
| | Markdown (.md) | 7 | 5610 | 37 | 369.2 | | |
| | (no extension) | 5 | 95 | 0 | 2.5 | | |
| | CSV (.csv) | 5 | 31000 | 0 | 7,164.4 | | |
| | Plain Text (.txt) | 3 | 4872 | 0 | 341.7 | | |
| | DLL Library (.dll) | 2 | 3351 | 267 | 736.0 | | |
| | Lock File (.lock) | 2 | 5901 | 2780 | 145.7 | | |
| | PNG Image (.png) | 2 | 817 | 141 | 103.0 | | |
| | TOML (.toml) | 2 | 40 | 35 | 0.8 | | |
| | Binary File (.bin) | 1 | 1844 | 132 | 453.8 | | |
| | MQL Header (.mqh) | 1 | 145 | 22 | 3.9 | | |
| | MQL5 Source (.mq5) | 1 | 451 | 119 | 18.1 | | |
| | **Total** | **50** | **57868** | **4541** | **9,462.0** | | |
| ## Dependencies | |
| ### Python Dependencies | |
| - **MetaTrader5**: Terminal communication and data acquisition. | |
| - **lightgbm**: Gradient boosting framework for machine learning. | |
| - **pandas**: Data manipulation and analysis. | |
| - **numpy**: Scientific computing and vectorized operations. | |
| - **scikit-learn**: Machine learning utilities and preprocessing. | |
| - **joblib**: Model persistence and parallel processing. | |
| ### Rust Dependencies | |
| - **zeromq**: Asynchronous messaging for MQL5 integration. | |
| - **tokio**: Asynchronous runtime for high-performance networking. | |
| - **chrono**: Date and time handling. | |
| - **serde / serde_json**: Serialization and deserialization. | |
| - **csv**: High-performance CSV parsing and writing. | |
| - **clap**: Command-line argument parsing. | |
| - **bincode**: Binary serialization for model weights. | |
| - **ndarray**: N-dimensional arrays for vectorized math. | |
| - **rand**: Random number generation for execution modeling. | |
| ## Applications | |
| - High-frequency algorithmic trading of Gold (XAUUSDc). | |
| - Quantitative backtesting and performance auditing. | |
| - Machine learning model development and deployment in financial markets. | |