TICKERALL!
← All posts
August 23, 20265 min read

The MetaTrader5 Python Package vs a Hosted API

An honest comparison of the official MetaTrader5 Python package and a hosted MetaTrader API — OS support, concurrency, streaming, and deployment.

MetaTrader 5PythonComparison

If you write Python against MetaTrader 5, you have two broad options. You can use the official MetaTrader5 package from MetaQuotes, which drives a locally-installed MT5 terminal on your machine. Or you can call a hosted MetaTrader API — a service that holds the broker connection for you and exposes it over HTTP and WebSocket.

Both are valid. Which one fits depends less on features and more on where and how you run your code. This post lays out the trade-offs plainly, so you can pick with your eyes open. The official package has real strengths, and we'll say so.

The core difference

The official MetaTrader5 package is a thin Python wrapper over a real MT5 terminal running on the same machine. Your code talks to the terminal over local IPC; the terminal talks to the broker. That's a great model when the terminal is a natural part of your setup — a Windows desktop, one account, a bot you're watching.

A hosted API inverts that. The broker session lives on the server side, and your code — anywhere, any language — makes ordinary network calls. There's no terminal to install, keep logged in, or restart.

MetaTrader5 package (Windows) Your code Local MT5 terminal Hosted API (anywhere) Your code (any OS) Hosted API → broker no terminal
Same broker, two topologies: a terminal on your machine, or a session held server-side.

Here's the whole picture side by side. Read each cell as a fact, not a verdict — several of these will land differently depending on your constraints.

MetaTrader5 package Hosted API
OS support Windows only. On Linux/macOS you need Wine or a Windows VM. Anywhere Python (or any language) runs — Linux, macOS, containers, a Raspberry Pi, serverless.
Concurrency / thread-safety Single-threaded IPC to one terminal; not thread-safe — parallel calls can corrupt each other. Stateless HTTP + WebSocket; safe to call concurrently.
Live data Polled: call symbol_info_tick(symbol) in a loop, per symbol. Pushed over a WebSocket: subscribe once, receive updates.
Multi-account One terminal instance per account. One API key drives many accounts.
Deployment Install, run, and babysit a terminal per account (auto-login, keep it open, handle crashes). Your code is a plain process; no terminal to run.
Cost Free, official from MetaQuotes. Paid, hosted service; free tier is demo-only, live needs a plan.
Where it runs best Windows desktop, single account, local development. Servers, containers, multi-account, non-Windows, or anything already networked.

Live data: poll vs push

With the official package you pull prices. You call symbol_info_tick() for each symbol you care about, on a loop, and diff the results yourself to notice a change. It's simple and it works, but you own the loop, the polling interval, and the per-symbol fan-out.

A hosted API flips that around: you subscribe once and prices are pushed to you over a WebSocket as they change. No loop, no polling cadence to tune, and one connection covers many symbols. If your strategy reacts to ticks, push tends to be less code and less latency. We walk through the streaming side in Stream live MT5 tick data over a WebSocket in Python.

Neither is "correct" in the abstract — polling is perfectly fine for a slow-moving strategy checking a handful of symbols every few seconds.

Deployment & concurrency

This is where the two models diverge most in practice.

The official package needs a real terminal process, logged in and kept open, for each account. On Windows that's straightforward. Off Windows it means Wine or a VM, which is doable but adds moving parts — see Running MetaTrader 5 from Python on Linux for the honest version of that path. And because the IPC layer isn't thread-safe, fanning work out across threads or scaling to several accounts means one terminal per account and careful serialization of your calls.

A hosted API removes the terminal from your side entirely. Your code is just a process making network calls, so it drops into a container, a cron job, or a serverless function without special handling. Concurrency is the service's problem, and one key can address multiple accounts.

Here's the shape of it with the hosted client:

from tickerall import Tickerall

client = Tickerall(api_key="cf_live_...")
session = client.sessions.start(
    broker="mt5",
    server="Exness-MT5Trial7",
    account=12345678,
    password="...",
)
bars = client.candles.get(session.account_id, symbol="BTCUSDm", count=200, timeframe="M15")

No terminal, no OS constraint, and the same call works from a laptop or a Lambda.

Which to use

There's no universal winner. Match the tool to your setup.

Use the official MetaTrader5 package if…

  • You're on Windows already, or happy to keep a Windows box around.
  • You run a single account (or a small, fixed number) and don't need heavy concurrency.
  • You want everything on your own machine with no third party anywhere in the path.
  • You're doing local development, prototyping, or a desktop bot you personally supervise.
  • Free and official from MetaQuotes is the deciding factor.

Use a hosted API if…

  • You run on Linux, macOS, containers, or serverless and don't want Wine/VM overhead.
  • You need to drive several accounts, or call from many workers concurrently.
  • You'd rather subscribe to pushed ticks than run polling loops.
  • You want deployment to be "ship a normal process," with no terminal to babysit.
  • You're comfortable depending on a paid service and trusting it with a broker session (and note the free tier is demo-only; live trading needs a plan).

Wrapping up

If you're on Windows with one account, the official package is the simplest thing that works, and it's free — that's a genuinely good position to be in. If your code needs to run somewhere other than Windows, address many accounts, or avoid babysitting terminals, a hosted API removes exactly those frictions in exchange for a dependency and a bill.

Most teams know which side of that line they're on. Pick for your constraints, not for a feature list. If the hosted path fits, the full API is documented at tickerall.com/docs.

Was this useful?

Comments

Leave a comment

Comments are public.
The MetaTrader5 Python Package vs a Hosted API · Ticker All!