Client RESTful API for MT4 Servers

Created with Sketch.

Client RESTful API for MT4 Servers

Table of Contents

Full functional trial version for 14 days. More details and full version available at:

Connect to MT4 Server

To establish connection with MT4 Server use Connect endpoint. It requires broker host, port, mt4 account number and password.

file

https://mt4.mtapi.io/Connect?user=500476959&password=ehj4bod&host=mt4-demo.roboforex.com&port=443

It returns token that you need to use as 'id' parameter in further requests to server.

Account details

If you need Balance, Equity, Currency, FreeMargin etc. please use AccountSummary endpoint.

file

https://mt4.mtapi.io/AccountSummary?id=demo-token-mt4

Trading

To send different types of orders use OrderSend endpoint.

Order history

Use OrderHistory endpoint to get list of closed orders.

https://mt4.mtapi.io/OrderHistory?id=demo-token-mt4&from=1970-01-01T00%3A00%3A00&to=2022-09-01T00%3A00%3A00

Opened orders

To get list of active market and pending orders use OpenedOrders endpoint.

https://mt4.mtapi.io/OpenedOrders?id=demo-token-mt4

It returns array of orders.

Quote history

To get OHLC price history please use QuoteHistory endpoint.

https://mt4.mtapi.io/QuoteHistory?id=demo-token-mt4&symbol=EURUSD&timeframe=D1&from=2022-06-01T00%3A00%3A00&count=30

It returns array of bars.

Trading instruments

To get list of trading instruments please use Symbols endpoint.

https://mt4.mtapi.io/Symbols?id=demo-token-mt4

To get details of certain symbol use SymbolParams endpoint.

https://mt4.mtapi.io/SymbolParams?id=demo-token-mt4&symbol=EURUSD

Realtime quotes with websockets

Simple Web Socket test client for chrome browser: https://chrome.google.com/webstore/detail/websocket-test-client/fgponpodhbmadfljofbimhhlengambbn

  • Call /Subscribe method
  • Quotes should start to flow in websocket test client

Leave a Reply

Your email address will not be published. Required fields are marked *