metatrader5
API Connector to MetaTrader 5 Terminal
Decision gist · record as of 2026-08-14
Yes, if you trade or analyze markets via MetaTrader 5 and want to automate data retrieval or trading logic in Python. The package is actively maintained, carries no security issues, and has a permissive license. The main constraint is that it requires Windows and a running MetaTrader 5 Terminal installation—if you lack either, it will not work.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- MetaTrader 5 Terminal must be installed and running on Windows; the package does not work on macOS or Linux.
- Medium install friction: Windows-only wheels for Python 3.6–3.14.
- Requires MetaTrader 5 Terminal installed and running on the system; the package itself is actively maintained with a recent release.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
last release 2026-08-01 (13 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 184,423 downloads/mo, #10,037 on PyPI
Alternatives
Verify before relying
import metatrader5 as mt5
import numpy as np
mt5.initialize()
rates = mt5.copy_rates_from("EURUSD", mt5.TIMEFRAME_D1, 0, 10)
mt5.shutdown()- Whether the package works with MetaTrader 5 Terminal versions other than the latest.
- Real-world latency and throughput limits for high-frequency data retrieval.
- Broker-specific limitations or compatibility issues beyond the platform itself.
What it is and what it does
MetaTrader 5 for Python is a connector that bridges Python code to the MetaTrader 5 Terminal, a multi-asset trading platform used primarily for Forex and stock market access. It lets you programmatically fetch historical price data (bars and ticks), query instrument metadata, and execute trading operations from Python, automating what would otherwise require manual interaction with the terminal's UI. The package handles platform launch, data synchronization with the broker's server, and data transfer automatically.
The package depends on numpy for data handling and runs on Python 3.6–3.14 on Windows only. It is actively maintained and carries no known security vulnerabilities. Installation requires both the Python package and a working MetaTrader 5 Terminal installation on your system; the package itself is a thin wrapper around the terminal's C API.
Use it for
- Fetch historical OHLC bars and tick data for backtesting trading strategies in Python.
- Automate order placement and position management across multiple instruments via Python scripts.
- Analyze price data from hundreds of instruments using numpy and pandas without manual terminal interaction.
- Build algorithmic trading systems that react to real-time market data streamed from MetaTrader 5.
- Integrate MetaTrader 5 data into a larger Python analytics or machine-learning pipeline.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you trade or analyze markets via MetaTrader 5 and want to automate data retrieval or trading logic in Python.
The package is actively maintained, carries no security issues, and has a permissive license. The main constraint is that it requires Windows and a running MetaTrader 5 Terminal installation—if you lack either, it will not work.
Install
metatrader5 on PyPI
Before you install
Medium install friction: Windows-only wheels for Python 3.6–3.14. Requires MetaTrader 5 Terminal installed and running on the system; the package itself is actively maintained with a recent release.
MetaTrader 5 Terminal must be installed and running on Windows; the package does not work on macOS or Linux.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
import metatrader5 as mt5
import numpy as np
mt5.initialize()
rates = mt5.copy_rates_from("EURUSD", mt5.TIMEFRAME_D1, 0, 10)
mt5.shutdown()
Verify before relying
- Whether the package works with MetaTrader 5 Terminal versions other than the latest.
- Real-world latency and throughput limits for high-frequency data retrieval.
- Broker-specific limitations or compatibility issues beyond the platform itself.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4,>=3.6 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 1 packagenumpy |
| Maintenance | Actively maintained 13 days since the last release |
| First released | |
| Downloads | 184,423 / month, #10,037 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Office/Business :: Financial |
Evidence: metatrader5-5.0.6090-cp310-cp310-win_amd64.whl; metatrader5-5.0.6090-cp311-cp311-win_amd64.whl; metatrader5-5.0.6090-cp312-cp312-win_amd64.whl; metatrader5-5.0.6090-cp313-cp313-win_amd64.whl; metatrader5-5.0.6090-cp314-cp314-win_amd64.whl; metatrader5-5.0.6090-cp36-cp36m-win_amd64.whl; metatrader5-5.0.6090-cp37-cp37m-win_amd64.whl; metatrader5-5.0.6090-cp38-cp38-win_amd64.whl; metatrader5-5.0.6090-cp39-cp39-win_amd64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “metatrader 5 python api”
- metatrader5Connects Python to MetaTrader 5 Terminal to retrieve financial market…
- xdkA Python SDK for interacting with the X API, providing typed client…
- sailthru-clientA Python client library for the Sailthru REST API, enabling remote…
Give your agent the search over MCP, or paste the wish link into any chat.
More Financial packages
statsmodels provides statistical models, inference methods, and descriptive statistics for Python, complementing scipy with regression, time series, discrete choice, survival analysis, and multivariate methods.
Install it if you need publication-quality statistical models, hypothesis tests, or time series analysis beyond what scipy or pandas provide.
Generates country- and subdivision-specific government holiday calendars on demand, supporting 250 country codes with optional language localization and holiday categories.
Fetches financial and market data from Yahoo Finance's public APIs, including ticker information, historical prices, and live streaming data.
However, do not use it for commercial applications or high-volume data collection without confirming compliance with Yahoo's terms of service.
Bokeh is an interactive visualization library that creates browser-based plots, dashboards, and data applications from Python code, with support for large and streaming datasets.
Install it if you need browser-based interactivity.
Parses, validates, and reformats standard numbers and codes across many countries and industries—tax IDs, bank accounts, identity numbers, VAT codes, and financial identifiers.
Install it if you validate or reformat standardized numbers.
Provides elementary financial functions (IRR, NPV, PMT, and others) that were deprecated and removed from NumPy, offering a dedicated replacement for financial calculations.
However, given the aging status (no releases since 2019) and unclear compatibility with modern Python and recent numpy versions, verify that it works with your target…
See also finvizfinance · tradingeconomics · kiteconnect · tradingview-screener · openbb-tradingeconomics · tdxpy · tradingview-ta · ib-insync · simplefix · mootdx