ML-3m-trader / STACKS.md
algorembrant's picture
Upload 11 files
c382c53 verified

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

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

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.