--- id: metatrader5 version: "5.0.6090" license: MIT license_treatment: permissive maintenance: active --- # metatrader5 — API Connector to MetaTrader 5 Terminal License: permissive · Maintenance: active · Downloads: 184.4K/mo ## 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 above — verify before relying. Connects Python to MetaTrader 5 Terminal to retrieve financial market data (bars, ticks, instrument details) and execute trading operations via the platform's API. 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 pip install metatrader5 uv add metatrader5 poetry add metatrader5 ## Installing metatrader5 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. 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() MetaTrader 5 Terminal must be installed and running on Windows; the package does not work on macOS or Linux. 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_current - Install friction: medium - Maintenance: active - Downloads: 184.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags metatrader 5 python api, mt5 data connector, forex trading python, financial market data retrieval, trading platform integration, price data analysis, metatrader terminal python, trading-api, financial-data, windows-only [View on SkillFed](https://skillfed.io/packages/metatrader5) · [View on PyPI](https://pypi.org/project/metatrader5/)