{"id":24080,"library":"mt5linux","title":"mt5linux","description":"A Python library that wraps the MetaTrader5 API using a server-client architecture, enabling MetaTrader5 operations (e.g., account info, market data, orders) on Linux systems where the official MetaTrader5 package cannot be installed. Version 1.0.3 is stable but lightly maintained; no major release cadence.","status":"active","version":"1.0.3","language":"python","source_language":"en","source_url":"https://github.com/lucas-campagna/mt5linux","tags":["metatrader5","forex","trading","mt5","linux"],"install":[{"cmd":"pip install mt5linux","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"Optional on client side (server side only), but required if running the mt5linux server where MT5 is installed (Windows).","package":"MetaTrader5","optional":true}],"imports":[{"note":"The library is not a package with submodules; Mt5Linux is the only class.","wrong":"import mt5linux","symbol":"Mt5Linux","correct":"from mt5linux import Mt5Linux"}],"quickstart":{"code":"from mt5linux import Mt5Linux\n\n# Connect to already running mt5linux server (default host/port)\nmt5 = Mt5Linux('localhost', 5050)\n\n# Check connection\nprint('Connected:', mt5.connected)\n\n# Get account info\naccount_info = mt5.account_info()\nprint('Account:', account_info)\n\n# Get symbol tick (adjust symbol and server settings as needed)\n# tick = mt5.get_symbol_tick('EURUSD')","lang":"python","description":"Connect to an existing mt5linux server and fetch account info."},"warnings":[{"fix":"Install and launch the mt5linux server on a Windows machine with MT5. Then connect from your Linux client.","message":"mt5linux is a CLIENT library only. You MUST run the separate mt5linux server application (Windows-only) that has MetaTrader5 installed. The client (on Linux/Mac) simply send requests to that Windows server via TCP sockets.","severity":"gotcha","affected_versions":"all"},{"fix":"Refer to the mt5linux README or source code for available client methods.","message":"Many mt5linux methods mimic MetaTrader5 API but with different naming (e.g., account_info instead of account_info()), and results are dictionaries, not namedtuples. Do not use MetaTrader5 documentation for exact function signatures.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider forking or using alternatives (e.g., MT5 via Wine + pywinauto or the official MetaTrader5 package if on Windows).","message":"The library is not actively maintained. The last commit on GitHub was in 2022. Issues and pull requests may go unanswered.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure the mt5linux server application is running on the Windows machine and that the firewall allows TCP port 5050 (or your custom port).","cause":"The mt5linux server is not running or not reachable at the specified host/port.","error":"ConnectionRefusedError: [Errno 111] Connection refused"},{"fix":"Use the correct import: `from mt5linux import Mt5Linux`.","cause":"Incorrect import: you used `import mt5linux` instead of `from mt5linux import Mt5Linux`.","error":"AttributeError: module 'mt5linux' has no attribute 'Mt5Linux'"},{"fix":"Always check the return for None before accessing keys: `tick = mt5.get_symbol_tick('EURUSD'); if tick is None: ...`","cause":"Some mt5linux methods (e.g., get_symbol_tick) return None on failure. Code assumes dict.","error":"TypeError: 'NoneType' object is not subscriptable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}