Back to browse
GitHub Repository

MetaTrader 5 in a real Windows VM (Docker + QEMU/KVM) with a REST API for programmatic trading AND server-side technical analysis. One POST = OHLC bars enriched with RSI/MACD/Bollinger/ADX/VWAP/Ichimoku/Order Blocks/FVGs/divergences. Multi-broker, multi-account. No Wine bullshit, no janky workarounds.

18 starsPython

MetaTrader 5 in Windows via Docker and QEMU/KVM with a REST API

by metadescription·Feb 20, 2026·1 point·0 comments

AI Analysis

●●●BangerWizardrySolve My ProblemZero to One

MT5 over REST API via Docker+QEMU—skip Wine, skip VPS, ship it.

Strengths
  • Solves a genuine pain point: MT5 + its Python API locked to Windows, no good Linux alternative
  • Elegant constraint—runs 4 terminals on 512MB RAM + swap proves the architecture is lean and practical
  • Ships with .skills/ file for AI coding agents, bridging MT5 to LLM-driven trading automation
Weaknesses
  • Requires KVM-enabled Linux host and ~20GB disk—not portable to Mac or Windows easily
  • Maintenance risk: depends on tiny11, MT5 updates, and broker API stability—one breaking change breaks everything
Target Audience

Algorithmic traders, quant developers, fintech engineers working on Linux who need MT5 access

Similar To

OANDA v20 Python API · Interactive Brokers TWS · Alpaca API (though different brokers)

Post Description

MetaTrader 5 only runs on Windows. The official Python library only works on Windows. If you want programmatic access to market data and order management from a Linux box, your options are Wine (broken), VPS (expensive and annoying), or write MQL5 (a C++ knockoff from 2005 that makes you want to cry). I wanted to hit an HTTP endpoint from any machine, in any language, and get JSON back. So I built a Docker container that runs a real Windows 11 VM via QEMU/KVM, boots MT5 in portable mode, and wraps it with a Flask REST API. Multiple brokers and accounts simultaneously, each terminal on its own port. The VM runs on 512MB real RAM + swap. Sounds cursed, works fine - tiny11 + aggressive debloat idles at ~1.4GB total. I'm running 4 terminals on 2 vCPUs without issues. The repo ships with a .skills/ file for AI coding agents (OpenClaw etc.) so you can point an LLM at it and tell it to "buy 0.01 EURUSD with a 2 ATR stop" and it figures the rest out. Also includes a Python TA example with 20+ indicators + Smart Money Concepts (order blocks, FVGs, BOS/CHoCH).

Similar Projects