A revived MT5 trading robot is rebuilt as a hybrid system: Python handles data pipelines, feature building, model training, and signal generation, while MetaTrader 5 executes trades via the Python API. Multithreading assigns each symbol its own model context to avoid sequential bottlenecks when trading portfolios.
The design adds portfolio-level risk control with a global TOTAL_PORTFOLIO_RISK so position sizing depends on both instrument volatility and existing exposure across symbols.
Core infrastructure focuses on reliability: queued logging with a dedicated printer thread for readable multithreaded diagnostics, and market-data retrieval with retry windows to survive broker outages.
The ML pipeline expands limited history using noise, time shifts, scaling, and price inversion with robust NaN/inf cleaning. Labels range from simple forward moves to ...
👉 Read | Quotes | @mql5dev