NEW SDK for MetaTrader 4 and 5: no terminal needed

MetaTrader,
driven by your code.

MTsocketAPI gives your programs real-time prices, orders and account data from MT4 and MT5, with very low latency. Use it as an Expert Advisor with a REST API, or as a native SDK that connects without a terminal.

Free with demo accounts. No card needed.

curl "http://127.0.0.1:81/v1/quote?symbol=EURUSD"

{
  "MSG": "QUOTE",
  "SYMBOL": "EURUSD",
  "ASK": 1.03941,
  "BID": 1.03937,
  "FLAGS": 1030,
  "TIME": "2025.01.23 09:38:51.740",
  "VOLUME": 0,
  "ERROR_ID": 0,
  "ERROR_DESCRIPTION": "The operation completed successfully"
}
from mtsocketapi import MT5WebClient, Side

client = MT5WebClient("wss://your-broker/terminal")
client.connect()
client.login(111111, "password")

eurusd = next(s for s in client.load_symbols()
              if s.name == "EURUSD")
client.on_tick = lambda t: print(t.bid, t.ask)
client.subscribe([eurusd])

# buy 0.01 lots at market
r = client.open_market_order(eurusd, Side.BUY, 0.01)
print(r.retcode_text, r.price)
  • MT4 and MT5one subscription covers both
  • REST, WebSockets or native SDKpick what fits your stack
  • Windows and LinuxPC, VPS or Docker
  • Runs on your machinesno cloud between you and your broker
Two products, one subscription

Pick how you connect

Every plan includes both, each with its own license. Use the one that fits your project, or both at the same time.

MetaTrader 4 MetaTrader 5

MTsocketAPI EA

An Expert Advisor that runs inside your MetaTrader terminal and exposes a REST API and WebSockets.

  • Any programming language: HTTP and JSON
  • Access to the terminal's indicators
  • Your program on any system, local or remote
  • Works with any MT4 or MT5 broker
MetaTrader 4 MetaTrader 5 NEW

MTsocketAPI SDK

A native library that connects your program directly to the MetaTrader 4 and 5 servers. No terminal to install or keep open.

  • Typed bindings for C#, Python, Java, C++ and Rust
  • Several accounts at once in one program
  • Windows and Linux: servers, VPS, Docker
  • For MT4 and MT5 brokers with web trading

Not sure which one? Compare the EA and the SDK →

What you can build with it

Everything your strategy needs from MetaTrader

The same data and the same orders you have in the terminal, available to your own code.

Real-time prices

Ticks and OHLC candles for your application or your own indicators, pushed as they happen.

EASDK

Orders

Send market, limit and stop orders, change stop loss and take profit, close fully or partially.

EASDK

Trade history

Past deals, orders and positions, ready to filter, analyse or export to CSV.

EASDK

Indicators

Read SMA, ATR, Momentum or any custom indicator loaded in your terminal.

EA

Economic calendar

Upcoming and past events with actual, forecast and previous values.

EASDK

Many accounts at once

Copy trading, hedging or monitoring across accounts and brokers from one program.

SDK
Why MTsocketAPI

Your trading stays on your side

Cloud APIs put a third party between you and your broker. MTsocketAPI runs on your own computers and servers.

Private

Your credentials, your orders and your data never go through our servers or anyone else's.

Fast

Lightweight and local: no extra network hop between your code and MetaTrader.

No MQL needed

Standard technologies and the language you already know, with your usual debugger.

Local or remote

Trade from the same machine or from another one: a Linux server, a VPS, a container.

Start in minutes

Examples in your language

Complete, runnable examples with source code for each product. Copy one and change it.

MetaTrader 4 MetaTrader 5 NEW

SDK native library

A first look

Python
from mtsocketapi import MT5WebClient

client = MT5WebClient("wss://your-broker/terminal")
client.connect()
client.login(111111, "password")
print(client.account_info().balance)
from mtsocketapi import MT4WebClient

client = MT4WebClient("MetaQuotes-Demo")  # server name
client.connect()
client.login(111111, "password")
print(client.account_info().balance)

The download includes a complete MT5 example and MT4 example for each language.

Getting started guide →
Pricing

Free to test. Pay when you go live.

Every plan includes the EA and the SDK. Prices per month, billed annually; monthly billing is also available.

Free

€0demo accounts
  • Unlimited demo accounts
  • 1 lot per order
  • Limited history and calendar
Download

Retail

€19per month
  • 1 live account
  • 1 lot per order
  • Full calendar
See plan

Professional

€49per month
  • 1 live account
  • Unlimited lot size and history
  • Remote connections
See plan

Unlimited

€499per month
  • Unlimited live accounts
  • Everything in Professional
  • Priority support
See plan

Compare all plans in detail →

Test it on a demo account today

Download it, run an example and see it working with your broker before you buy anything.

Trading involves a high risk of loss. MTsocketAPI is a software tool, not investment advice: always test your programs on a demo account first. You are responsible for the orders your software sends. See the Terms of Service.

© 2020-2026 MTsocketAPI. All rights reserved.

Created with Mobirise ‌

Web Site Maker