Protocol Documentation

Table of Contents

mt5.proto

Top

AccountAnswer

FieldTypeLabelDescription
Login uint64

Password string

Investor string

AccountRec

Account details

FieldTypeLabelDescription
Login uint64

Type string

UserName string

TradeFlags int32

Country string

City string

State string

ZipCode string

UserAddress string

Phone string

Email string

Balance double

Credit double

Blocked double

Leverage int32

AccountReply

FieldTypeLabelDescription
result AccountRec

error Error

AccountRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

AccountSummary

Account summary trading information

FieldTypeLabelDescription
Balance double

Balance

Credit double

Credit

Profit double

Profit

Equity double

Equity

Margin double

Used margin

FreeMargin double

Free margin

MarginLevel double

Margin percent

Leverage double

Leverage

Currency string

Currency

Method AccMethod

Netting or hedging.

Type string

Demo or real

IsInvestor bool

Investor mode (without trading)

AccountSummaryReply

FieldTypeLabelDescription
result AccountSummary

error Error

AccountSummaryRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

Bar

OHLC

FieldTypeLabelDescription
Time google.protobuf.Timestamp

OpenPrice double

HighPrice double

LowPrice double

ClosePrice double

TickVolume uint64

Spread int32

Volume uint64

BarsForSymbol

FieldTypeLabelDescription
Symbol string

Bars Bar repeated

Exception string

ChangePasswordReply

FieldTypeLabelDescription
result string

error Error

ChangePasswordRequest

[Example]

{

"id": "demo-token-mt5",

"password": "",

"isInvestor": "False"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

password string optional

Password.

isInvestor bool optional

True - if need to change investor password, False - if master password

CheckConnectReply

FieldTypeLabelDescription
result string

error Error

CheckConnectRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

ClientStatus

Client ID with connection status

FieldTypeLabelDescription
Id string

Token

Connected bool

Connection status

User uint64

User

Host string

Host

Port int32

Port

ConnectTime google.protobuf.Timestamp

Connect time

ClusterDetailsRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

Company

FieldTypeLabelDescription
CompanyName string

Results Result repeated

ConnectProxyReply

FieldTypeLabelDescription
result string

error Error

ConnectProxyRequest

[Example]

{

"user": "21455",

"password": "1nJeS+Ae",

"host": "95.217.147.61",

"port": "443",

"proxyUser": "ProxyUser123",

"proxyPassword": "qwerty123",

"proxyHost": "65.108.126.217",

"proxyPort": "1080",

"proxyType": "Socks5"

}

FieldTypeLabelDescription
user uint64

Account number. [Required]

password string

Password. [Required]

host string

Host - ip adddress or dns name. [Required]

port int32

Port. [Required]

proxyUser string

Proxy user [Required]

proxyPassword string

Proxy password [Required]

proxyHost string

Proxy server ip adddress [Required]

proxyPort int32

Proxy port [Required]

proxyType ProxyTypes

Proxy type. Put 'Socks5' for default parameters [Required]

id string optional

Token returned by 'Connect' method

ConnectReply

FieldTypeLabelDescription
result string

error Error

ConnectRequest

[Example]

{

"user": "21455",

"password": "1nJeS+Ae",

"host": "95.217.147.61",

"port": "443"

}

FieldTypeLabelDescription
user uint64

Account number. [Required]

password string

Password. [Required]

host string

Host - ip adddress or dns name. [Required]

port int32

Port. [Required]

id string optional

Token returned by 'Connect' method

DealInternal

Internal details for the deal

FieldTypeLabelDescription
OpenTimeAsDateTime google.protobuf.Timestamp

Open time

Lots double

Lots

TicketNumber int64

Deal ticket

Id string

Text id

Login uint64

Account login

HistoryTime int64

History time (as FileTime format)

OrderTicket int64

Order ticket

OpenTime int64

Open time

Symbol string

Symbol currency

Type DealType

Deal type

Direction Direction

Deal direction

OpenPrice double

Open price

Price double

Price

StopLoss double

Stop loss

TakeProfit double

Take profit

Volume uint64

Volume

Profit double

Profit (money digits)

ProfitRate double

Profit rate

VolumeRate double

Volume rate

Commission double

Commission (money digits)

Fee double

Swap double

Swap

ExpertId int64

Expert id

PositionTicket int64

Position ticket

Comment string

Text comment

ContractSize double

Lots

Digits int32

Significant digits

MoneyDigits int32

Money significant digits

FreeProfit double

Free profit

TrailRounder double

Trail rounder

OpenTimeMs int64

Open time (ms)

PlacedType PlacedType

Placed type

DisconnectReply

FieldTypeLabelDescription
result string

error Error

DisconnectRequest

[Example]

{

"id": ""

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

Error

FieldTypeLabelDescription
code ErrorCode

message string

stackTrace string

EventsReply

FieldTypeLabelDescription
result string

error Error

EventsRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

GetClientsReply

FieldTypeLabelDescription
result ClientStatus repeated

error Error

GetClientsRequest

GetDemoReply

FieldTypeLabelDescription
result AccountAnswer

error Error

GetDemoRequest

[Example]

{

"host": "",

"port": ""

}

FieldTypeLabelDescription
host string

Host - ip adddress or dns name. [Required]

port int32

Port. [Required]

GetQuoteManyReply

FieldTypeLabelDescription
result Quote repeated

error Error

GetQuoteManyRequest

[Example]

{

"id": "demo-token-mt5",

"msNotOlder": "0"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbols string repeated

Symbols [Required]

msNotOlder int32 optional

If last quote arrived less than msOlderMs milliseconds ago function returns last quote, overwise - wait for new quote. If zero - always returns last quote.

GetQuoteReply

FieldTypeLabelDescription
result Quote

error Error

GetQuoteRequest

[Example]

{

"id": "demo-token-mt5",

"symbol": "EURUSD",

"msNotOlder": "0"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string

Symbol [Required]

msNotOlder int32 optional

If last quote arrived less than msOlderMs milliseconds ago function returns last quote, overwise - wait for new quote. If zero - always returns last quote.

GetTickValueManyReply

FieldTypeLabelDescription
result double repeated

error Error

GetTickValueManyRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string repeated

Symbol

HealthReply

FieldTypeLabelDescription
result string

error Error

HealthRequest

IsQuoteSessionManyReply

FieldTypeLabelDescription
result SessionState repeated

error Error

IsQuoteSessionManyRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbols string repeated

Symbols

IsQuoteSessionReply

FieldTypeLabelDescription
result bool

error Error

IsQuoteSessionRequest

[Example]

{

"id": "demo-token-mt5",

"symbol": "EURUSD"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string

Symbol [Required]

IsTradeSessionManyReply

FieldTypeLabelDescription
result SessionState repeated

error Error

IsTradeSessionManyRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbols string repeated

Symbols

IsTradeSessionReply

FieldTypeLabelDescription
result bool

error Error

IsTradeSessionRequest

[Example]

{

"id": "demo-token-mt5",

"symbol": "EURUSD"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string

Symbol [Required]

MailMessage

FieldTypeLabelDescription
Id int64

Time google.protobuf.Timestamp

From string

To string

Subject string

Body string

MailsReply

FieldTypeLabelDescription
result MailMessage repeated

error Error

MailsRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

MarketWatch

FieldTypeLabelDescription
Symbol string

High double

Low double

OpenPrice double

ClosePrice double

DailyChange double

Bid double

Ask double

Spread int32

Volume uint64

MarketWatchManyReply

FieldTypeLabelDescription
result MarketWatch repeated

error Error

MarketWatchManyRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbols string repeated

Symbols [Required]

MemorySnapshotReply

FieldTypeLabelDescription
result string

error Error

MemorySnapshotRequest

OnMailReply

FieldTypeLabelDescription
result MailMessage

error Error

OnMailRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

OnMarketWatchReply

FieldTypeLabelDescription
result MarketWatch

error Error

OnMarketWatchRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

OnOpenedOrdersTicketsReply

FieldTypeLabelDescription
result MailMessage

error Error

OnOpenedOrdersTicketsRequest

[Example]

{

"id": "demo-token-mt5",

"interval": "1000"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

interval int32 optional

Minimum interval between events in milliseconds

OnOrderProfitReply

FieldTypeLabelDescription
result ProfitUpdate

error Error

OnOrderProfitRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

OnOrderUpdateReply

FieldTypeLabelDescription
result OrderUpdateSummary

error Error

OnOrderUpdateRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

OnQuoteReply

FieldTypeLabelDescription
result Quote

error Error

OnQuoteRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

OnTickHistoryReply

FieldTypeLabelDescription
result TickHistoryEventArgs

error Error

OnTickHistoryRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

OnTickValueReply

FieldTypeLabelDescription
result SymbolTickValue

error Error

OnTickValueRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

OpenedOrderReply

FieldTypeLabelDescription
result Order

error Error

OpenedOrderRequest

[Example]

{

"id": "",

"ticket": ""

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

ticket int64 optional

Ticket number

OpenedOrdersReply

FieldTypeLabelDescription
result Order repeated

error Error

OpenedOrdersRequest

[Example]

{

"id": "",

"sort": "OpenTime",

"ascending": "True"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

sort OrderSort optional

Sort by open time or close time

ascending bool optional

Ascending sort

OpenedOrdersTicketsReply

FieldTypeLabelDescription
result int64 repeated

error Error

OpenedOrdersTicketsRequest

[Example]

{

"id": "demo-token-mt4"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

Order

Pending, market or history order

FieldTypeLabelDescription
CloseVolume uint64

Volume uint64

ExpirationType ExpirationType

ExpirationTime google.protobuf.Timestamp

FillPolicy FillPolicy

OpenTimestampUTC int64

CloseTimestampUTC int64

Ticket int64

Profit double

Swap double

Commission double

Fee double

ClosePrice double

CloseTime google.protobuf.Timestamp

CloseLots double

CloseComment string

OpenPrice double

OpenTime google.protobuf.Timestamp

Lots double

ContractSize double

ExpertId int64

PlacedType PlacedType

OrderType OrderType

DealType DealType

Symbol string

Comment string

State OrderState

StopLoss double

TakeProfit double

RequestId int32

Digits int32

ProfitRate double

StopLimitPrice double

DealInternalIn DealInternal

DealInternalOut DealInternal

OrderInternal OrderInternal

OrderCloseReply

FieldTypeLabelDescription
result Order

error Error

OrderCloseRequest

[Example]

{

"id": "demo-token-mt5",

"ticket": "0",

"lots": "0",

"price": "0",

"slippage": "0"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

ticket int64

Ticket number [Required]

lots double optional

Lots

price double optional

Price

slippage uint64 optional

Slippage. Optional.

OrderHistoryPaginationReply

FieldTypeLabelDescription
result PaginationReply

error Error

OrderHistoryPaginationRequest

[Example]

{

"id": "demo-token-mt5",

"from": "2022-01-01T00:00:00",

"to": "2022-09-01T00:00:00",

"ordersPerPage": "10",

"pageNumber": "0",

"requestAgain": "False",

"sort": "OpenTime",

"ascending": "True",

"ignoreDepositWithdraw": "False"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

from string

'From date' in format: yyyy-MM-ddTHH:mm:ss [Required]

to string

'To date' in format: yyyy-MM-ddTHH:mm:ss [Required]

ordersPerPage int32

Orders per page [Required]

pageNumber int32

Page number [Required]

requestAgain bool optional

If need to force refresh orders from mt5 server

sort OrderSort optional

Sort by open time or close time

ascending bool optional

Ascending sort

tickets int64 repeated

List of tickets that need to return. If not specified - returns all tickets.

ignoreDepositWithdraw bool optional

Do not return deposit and withdraw operations

OrderHistoryReply

FieldTypeLabelDescription
result Order repeated

error Error

OrderHistoryRequest

[Example]

{

"id": "demo-token-mt5",

"from": "2022-01-01T00:00:00",

"to": "2022-09-01T00:00:00",

"sort": "OpenTime",

"ascending": "True"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

from string

'From date' in format: yyyy-MM-ddTHH:mm:ss [Required]

to string

'To date' in format: yyyy-MM-ddTHH:mm:ss [Required]

sort OrderSort optional

Sort by open time or close time

ascending bool optional

Ascending sort

filter string optional

Fields that need to return

OrderInternal

Internal information for the order(pending)

FieldTypeLabelDescription
Ticket int64

Ticket number

ExecutionTimeAsDateTime google.protobuf.Timestamp

Lots double

Lots

RequestLots double

Request lots

OpenTimeMsAsDateTime google.protobuf.Timestamp

TicketNumber int64

Ticket number

Id string

Text id

Login uint64

Account login

Symbol string

Symbol currency

HistoryTime int64

History time (as FileTime format)

OpenTime int64

Open time

ExpirationTime int64

Expiration time

ExecutionTime int64

Execution time

Type OrderType

Order type

FillPolicy FillPolicy

Fill policy

ExpirationType ExpirationType

Expiration type

PlacedType PlacedType

Placed type

OpenPrice double

Open price

StopLimitPrice double

StopLimit price

Price double

Price

StopLoss double

Stop loss

TakeProfit double

Take profit

Volume uint64

Cover volume

RequestVolume uint64

Request volume

State OrderState

Order state

ExpertId int64

Expert id

DealTicket int64

Associative deal ticket

Comment string

Comment text

ContractSize double

Lots

Digits int32

Significant digits

BaseDigits int32

Symbols base significant digits

ProfitRate double

Profit rate

OpenTimeMs int64

Open time (ms)

OrderModifyReply

FieldTypeLabelDescription
result Order

error Error

OrderModifyRequest

[Example]

{

"id": "demo-token-mt5",

"ticket": "0",

"stoploss": "0",

"takeprofit": "0",

"price": "0",

"expirationType": "Specified"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

ticket int64

Ticket number [Required]

stoploss double

StopLoss. Optional. [Required]

takeprofit double

TakeProfit. Optional. [Required]

price double optional

Price

expiration google.protobuf.Timestamp optional

Expiration time in yyyy-MM-ddTHH:mm:ss format

expirationType ExpirationType optional

Expiration type

OrderSendReply

FieldTypeLabelDescription
result Order

error Error

OrderSendRequest

[Example]

{

"id": "demo-token-mt5",

"symbol": "EURUSD",

"operation": "Buy",

"volume": "0,1",

"price": "0",

"slippage": "0",

"stoploss": "0",

"takeprofit": "0",

"expertID": "0",

"stopLimitPrice": "0",

"expirationType": "Specified",

"placedType": "Manually"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string

Symbol [Required]

operation OrderType

Buy, Sell, BuyLimit, SellLimit, BuyStop, SellStop [Required]

volume double

Lots [Required]

price double optional

Price

slippage uint64 optional

Slippage. Optional.

stoploss double optional

StopLoss. Optional.

takeprofit double optional

TakeProfit. Optional.

comment string optional

Comment. Optional.

expertID int64 optional

Custom user field. You can specify any value up to your needs. In MT4 this parameter called 'magic number.'

stopLimitPrice double optional

For the StopLimit order. Optional.

expiration google.protobuf.Timestamp optional

Expiration time in yyyy-MM-ddTHH:mm:ss format

expirationType ExpirationType optional

Expiration type

placedType PlacedType optional

Who placed the order

OrderUpdate

Details of order update

FieldTypeLabelDescription
Trans TransactionInfo

OrderInternal OrderInternal

Deal DealInternal

OppositeDeal DealInternal

Order Order

Type UpdateType

CloseByTicket int32

OrderUpdateSummary

Order update event details

FieldTypeLabelDescription
Update OrderUpdate

Order and update action

Balance double

Balance

Equity double

Equity

Margin double

Used margin

FreeMargin double

Free margin

Profit double

Account profit

MarginLevel double

Margin level

User uint64

Account number

OpenedOrders Order repeated

Opened orders

PaginationReply

OrderHistoryPagination

FieldTypeLabelDescription
PagesCount int32

Total pages count

PageNumber int32

Current page

Orders Order repeated

Orders

PendingOrderHistoryReply

FieldTypeLabelDescription
result OrderInternal repeated

error Error

PendingOrderHistoryRequest

[Example]

{

"id": "demo-token-mt5",

"from": "2023-09-01T00:00:00",

"to": "2023-10-01T00:00:00",

"ascending": "True"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

from string

'From date' in format: yyyy-MM-ddTHH:mm:ss [Required]

to string

'To date' in format: yyyy-MM-ddTHH:mm:ss [Required]

ascending bool optional

Ascending sort

PingHostManyReply

FieldTypeLabelDescription
result int32 repeated

error Error

PingHostManyRequest

[Example]

{

"host": "",

"port": ""

}

FieldTypeLabelDescription
host string repeated

Host - ip adddress or dns name. [Required]

port int32 repeated

Port. [Required]

PingHostReply

FieldTypeLabelDescription
result int32

error Error

PingHostRequest

[Example]

{

"host": "",

"port": "443"

}

FieldTypeLabelDescription
host string

Host - ip adddress or dns name. [Required]

port int32 optional

Port.

PingReply

FieldTypeLabelDescription
result string

error Error

PingRequest

PriceHistoryExManyReply

FieldTypeLabelDescription
result BarsForSymbol repeated

error Error

PriceHistoryExManyRequest

[Example]

{

"id": "demo-token-mt5",

"to": "2022-03-01T00:00:00",

"numBars": "10",

"timeFrame": "240"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string repeated

Symbol [Required]

from string

'To date' in format: yyyy-MM-ddTHH:mm:ss [Required]

numBars int32

timeFrame int32

PriceHistoryExReply

FieldTypeLabelDescription
result Bar repeated

error Error

PriceHistoryExRequest

[Example]

{

"id": "demo-token-mt5",

"symbol": "EURUSD",

"to": "2022-03-01T00:00:00",

"numBars": "10",

"timeFrame": "240"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string

Symbol [Required]

from string

'To date' in format: yyyy-MM-ddTHH:mm:ss [Required]

numBars int32

timeFrame int32

PriceHistoryHighLowReply

FieldTypeLabelDescription
result Bar

error Error

PriceHistoryHighLowRequest

[Example]

{

"id": "demo-token-mt5",

"symbol": "EURUSD",

"from": "2022-11-01T00:00:00",

"to": "2022-11-02T00:00:00",

"timeFrame": "60"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string

Symbol [Required]

from string

'From date' in format: yyyy-MM-ddTHH:mm:ss [Required]

to string

'To date' in format: yyyy-MM-ddTHH:mm:ss [Required]

timeFrame int32

PriceHistoryManyReply

FieldTypeLabelDescription
result BarsForSymbol repeated

error Error

PriceHistoryManyRequest

[Example]

{

"id": "demo-token-mt5",

"from": "2024-01-01T00:00:00",

"to": "2024-03-01T00:00:00",

"timeFrame": "240"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string repeated

Symbol [Required]

from string

'From date' in format: yyyy-MM-ddTHH:mm:ss [Required]

to string

'To date' in format: yyyy-MM-ddTHH:mm:ss [Required]

timeFrame int32

PriceHistoryMonthManyReply

FieldTypeLabelDescription
result QuoteHistoryEventArgs repeated

error Error

PriceHistoryMonthManyRequest

[Example]

{

"id": "demo-token-mt5",

"year": "2022",

"month": "6",

"day": "1",

"timeFrame": "240"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbols string repeated

Symbols [Required]

year int32

month int32

day int32

timeFrame int32

PriceHistoryMonthReply

FieldTypeLabelDescription
result Bar repeated

error Error

PriceHistoryMonthRequest

[Example]

{

"id": "demo-token-mt5",

"symbol": "EURUSD",

"year": "2022",

"month": "6",

"day": "1",

"timeFrame": "240"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string

Symbol [Required]

year int32

month int32

day int32

timeFrame int32

PriceHistoryReply

FieldTypeLabelDescription
result Bar repeated

error Error

PriceHistoryRequest

[Example]

{

"id": "demo-token-mt5",

"symbol": "EURUSD",

"from": "2022-01-01T00:00:00",

"to": "2022-03-01T00:00:00",

"timeFrame": "240"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string

Symbol [Required]

from string

'From date' in format: yyyy-MM-ddTHH:mm:ss [Required]

to string

'To date' in format: yyyy-MM-ddTHH:mm:ss [Required]

timeFrame int32

PriceHistoryTodayManyReply

FieldTypeLabelDescription
result QuoteHistoryEventArgs repeated

error Error

PriceHistoryTodayManyRequest

[Example]

{

"id": "demo-token-mt5",

"timeFrame": "240"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbols string repeated

Symbols [Required]

timeFrame int32

PriceHistoryTodayReply

FieldTypeLabelDescription
result Bar repeated

error Error

PriceHistoryTodayRequest

[Example]

{

"id": "demo-token-mt5",

"symbol": "EURUSD",

"timeFrame": "240"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string

Symbol [Required]

timeFrame int32

ProfitUpdate

Profit update message

FieldTypeLabelDescription
Balance double

Balace

Equity double

Equity

Margin double

User margin

FreeMargin double

Free margin

Profit double

Account profit

Orders Order repeated

Opened orders

MarginLevel double

Maring level

User uint64

Account number

Quote

New quote event arguments.

FieldTypeLabelDescription
Symbol string

Trading instrument.

Bid double

Bid.

Ask double

Ask.

Time google.protobuf.Timestamp

Server time.

Last double

Last deal price.

Volume uint64

Volume

QuoteHistoryEventArgs

Quote history event args.

FieldTypeLabelDescription
Symbol string

Instrument.

Bars Bar repeated

History bars.

RequiredMarginReply

FieldTypeLabelDescription
result double

error Error

RequiredMarginRequest

[Example]

{

"id": "demo-token-mt5",

"symbol": "EURUSD",

"lots": "1",

"type": "DealBuy",

"price": "0"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string

Symbol [Required]

lots double

Lots [Required]

type DealType optional

Buy or Sell

price double optional

Price

Result

FieldTypeLabelDescription
Name string

Access string repeated

SearchReply

FieldTypeLabelDescription
result Company repeated

error Error

SearchRequest

[Example]

{

"company": ""

}

FieldTypeLabelDescription
company string

Company name [Required]

ServerRec

Server details from servers.dat

FieldTypeLabelDescription
ServerName string

CompanyName string

DST int32

TimeZone int32

ServerTimezoneReply

FieldTypeLabelDescription
result int32

error Error

ServerTimezoneRequest

[Example]

{

"id": ""

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

Session

Trade or quote session details

FieldTypeLabelDescription
StartTime int32

Start time (in minites)

EndTime int32

End time (in minutes)

SessionState

True or false for current symbol for now

FieldTypeLabelDescription
Symbol string

Symbol

Active bool

Active or not

SessionsForDay

List of sessions for one day

FieldTypeLabelDescription
Sessions Session repeated

List of sessions

SubscribeManyReply

FieldTypeLabelDescription
result string

error Error

SubscribeManyRequest

[Example]

{

"id": "demo-token-mt5",

"interval": "0"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbols string repeated

Symbols [Required]

interval int32 optional

Minimum interval between events in milliseconds

SubscribeMarketWatchReply

FieldTypeLabelDescription
result string

error Error

SubscribeMarketWatchRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

SubscribeOpenedOrdersTicketsReply

FieldTypeLabelDescription
result string

error Error

SubscribeOpenedOrdersTicketsRequest

[Example]

{

"id": "demo-token-mt5",

"interval": "1000"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

interval int32 optional

Minimum interval between events in milliseconds

SubscribeOrderProfitReply

FieldTypeLabelDescription
result Order repeated

error Error

SubscribeOrderProfitRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

SubscribeOrderUpdateReply

FieldTypeLabelDescription
result Order repeated

error Error

SubscribeOrderUpdateRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

SubscribeReply

FieldTypeLabelDescription
result string

error Error

SubscribeRequest

[Example]

{

"id": "demo-token-mt5",

"symbol": "EURUSD",

"interval": "0"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string

Symbol [Required]

interval int32 optional

Minimum interval between events in milliseconds

SubscribeTickValueReply

FieldTypeLabelDescription
result string

error Error

SubscribeTickValueRequest

[Example]

{

"id": "demo-token-mt5",

"symbol": "EURUSD",

"interval": "0"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string

Symbol [Required]

interval int32 optional

Minimum interval between events in milliseconds

SymGroup

Symbol group information

FieldTypeLabelDescription
MinLots double

MaxLots double

LotsStep double

GroupName string

DeviationRate int32

RoundRate int32

TradeMode TradeMode

SL int32

TP int32

TradeType ExecutionType

FillPolicy FillingFlags

Expiration ExpirationFlags

OrderFlags int32

PriceTimeout int32

RequoteTimeout int32

RequestLots uint32

tmp1 int32

MinVolume uint64

MaxVolume uint64

VolumeStep int64

InitialMargin double

MaintenanceMargin double

InitMarginRate double repeated

MntnMarginRate double repeated

SwapType SwapType

SwapLong double

SwapShort double

ThreeDaysSwap V3DaysSwap

SymbolInfo

Symbol details

FieldTypeLabelDescription
UpdateTime int64

Update time

Currency string

Symbol currency

ISIN string

Symbol ISIN

Description string

Description

Basis string

RefToSite string

Reference to site

Custom int32

ProfitCurrency string

Currency for profit

MarginCurrency string

Currency for margin

Precision int32

BkgndColor int32

Background color

Digits int32

Significant digits

Points double

Symbol points

LimitPoints double

Symbol limit points

Id int32

Symbol id

DepthOfMarket int32

Depth of market

Spread int32

Spread

TickValue double

Tick value

TickSize double

Tick size

ContractSize double

Contract size

GTCMode GTCMode

Good till canceled mode

CalcMode CalculationMode

Calculation mode

SettlementPrice double

Settlement price

LowerLimit double

Lower limit

UpperLimit double

Upper limit

FaceValue double

Face value

AccruedInterest double

Accuired interest

FirstTradeTime int64

First trade time

LastTradeTime int64

Last trade time

SymbolListReply

FieldTypeLabelDescription
result string repeated

error Error

SymbolListRequest

[Example]

{

"id": ""

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

SymbolParams

Information about symbol and his group.

FieldTypeLabelDescription
Symbol string

Symbol name

SymbolInfo SymbolInfo

Symbol parameters

SymbolGroup SymGroup

Symbol group

SymbolParamsManyReply

FieldTypeLabelDescription
result SymbolParams repeated

error Error

SymbolParamsManyRequest

[Example]

{

"id": "demo-token-mt5",

"limit": "10000"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string repeated

Symbol

limit int32 optional

If server has more than 'limit' symbols functon throws an exception

SymbolParamsReply

FieldTypeLabelDescription
result SymbolParams

error Error

SymbolParamsRequest

[Example]

{

"id": "demo-token-mt5",

"symbol": "EURUSD"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string

Symbol [Required]

SymbolSessionsEx

Quote and trade sessions for each day of week starting from Sunday

FieldTypeLabelDescription
Symbol string

Symbol name

Quotes SessionsForDay repeated

Quote sessions for each day of week starting from Sunday

Trades SessionsForDay repeated

Trade sessions for each day of week starting from Sunday

SymbolSessionsExManyReply

FieldTypeLabelDescription
result SymbolSessionsEx repeated

error Error

SymbolSessionsExManyRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string repeated

Symbol [Required]

SymbolSessionsExReply

FieldTypeLabelDescription
result SymbolSessionsEx

error Error

SymbolSessionsExRequest

[Example]

{

"id": "demo-token-mt5",

"symbol": "EURUSD"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string

Symbol [Required]

SymbolTickValue

Tick value update

FieldTypeLabelDescription
Symbol string

Symbol

TickValue double

Tick value

SymbolsReply

FieldTypeLabelDescription
result SymbolInfo repeated

error Error

SymbolsRequest

[Example]

{

"id": ""

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

TickBar

FieldTypeLabelDescription
Time google.protobuf.Timestamp

Bid double

Ask double

Last double

Volume uint64

TickHistoryEventArgs

FieldTypeLabelDescription
Symbol string

Bars TickBar repeated

TickHistoryRequestReply

FieldTypeLabelDescription
result string

error Error

TickHistoryRequestRequest

[Example]

{

"id": "demo-token-mt5",

"symbol": "EURUSD",

"startYear": "2023",

"startMonth": "11",

"startDay": "5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string

Symbol [Required]

startYear int32

startMonth int32

startDay int32

TickHistoryStopReply

FieldTypeLabelDescription
result string

error Error

TickHistoryStopRequest

[Example]

{

"id": "demo-token-mt5",

"symbol": "EURUSD"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string

Symbol [Required]

TickValueWithSize

Tick value with tick size

FieldTypeLabelDescription
TickValue double

Tick value

TickSize double

Tick size

Symbol string

Symbol

TickValueWithSizeReply

FieldTypeLabelDescription
result TickValueWithSize repeated

error Error

TickValueWithSizeRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string repeated

Symbol

TransactionInfo

Transaction information

FieldTypeLabelDescription
UpdateId int32

Transaction ticket

Action int32

Order ticket

TicketNumber int64

Deal ticket

Currency string

Id int32

Symbol currency

s58 OrderType

Transaction id

OrderState OrderState

Order type

ExpirationType ExpirationType

Order state

ExpirationTime int64

Order placed type

OpenPrice double

Deal type

OrderPrice double

Deal placed type

StopLoss double

Expiration type

TakeProfit double

Expiration time

Volume uint64

Open price

UnSubscribeManyReply

FieldTypeLabelDescription
result string

error Error

UnSubscribeManyRequest

[Example]

{

"id": "demo-token-mt5"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbols string repeated

Symbols [Required]

UnSubscribeReply

FieldTypeLabelDescription
result string

error Error

UnSubscribeRequest

[Example]

{

"id": "demo-token-mt5",

"symbol": "EURUSD"

}

FieldTypeLabelDescription
id string

Token returned by 'Connect' method [Required]

symbol string

Symbol [Required]

VersionReply

FieldTypeLabelDescription
result string

error Error

VersionRequest

AccMethod

Netting or Hedging

NameNumberDescription
AccMethod_Default 0

AccMethod_Netting 1

AccMethod_Hedging 2

CalculationMode

Profit calculation mode

NameNumberDescription
CalculationMode_Forex 0

CalculationMode_Futures 1

CalculationMode_CFD 2

CalculationMode_CFDIndex 3

CalculationMode_CFDLeverage 4

CalculationMode_CalcMode5 5

CalculationMode_ExchangeStocks 32

CalculationMode_ExchangeFutures 33

CalculationMode_FORTSFutures 34

CalculationMode_ExchangeOption 35

CalculationMode_ExchangeMarginOption 36

CalculationMode_ExchangeBounds 37

CalculationMode_Collateral 64

DealType

Deal type

NameNumberDescription
DealType_DealBuy 0

DealType_DealSell 1

DealType_Balance 2

DealType_Credit 3

DealType_Charge 4

DealType_Correction 5

DealType_Bonus 6

DealType_Commission 7

DealType_DailyCommission 8

DealType_MonthlyCommission 9

DealType_DailyAgentCommission 10

DealType_MonthlyAgentCommission 11

DealType_InterestRate 12

DealType_CanceledBuy 13

DealType_CanceledSell 14

Direction

Direction of the deal

NameNumberDescription
Direction_In 0

Direction_Out 1

Direction_InOut 2

Direction_OutBy 3

ErrorCode

NameNumberDescription
DONE 0

OK 1

COMMON_ERROR 2

INVALID_PARAM 3

INVALID_DATA 4

DISK_ERROR 5

MEMORY_ERROR 6

NETWORK_ERROR 7

NOT_PERMISSION 8

OPERATION_TIMEOUT 9

NO_CONNECTION 10

SERVICE_NOT_AVAILABLE 11

TOO_FREQUENT_REQUEST 12

NOT_FOUND 13

SERVER_SHUTDOWN 15

OPERATION_CANCELED 16

DUPLICATE_ATTEMPT 17

INVALID_TERMINAL 1000

INVALID_ACCOUNT 1001

ACCOUNT_DISABLED 1002

ADVANCED_AUTHORIZATION 1003

CERTIFICATE_REQUIRED 1004

INVALID_CERTIFICATE 1005

CERTIFICATE_NOT_CONFIRM 1006

ATTEMPT_CONNECT_NON_ACCESS_SERVER 1007

INVALID_SERVER 1008

ONLY_UPDATES_AVAILABLE 1009

OLD_VERSION 1010

ACCOUNT_NOT_MANAGER_CONFIG 1011

UNALLOWED_IP_ADDRESS 1012

GROUP_NOT_INITIALIZED 1013

CERTIFICATE_GENERATION_DISABLED 1014

INVALID_SERVER_ID 1015

UNALLOWED_ADDRESS 1016

INVALID_SERVER_TYPE 1017

SERVER_BUSY 1018

INVALID_SERVER_CERTIFICATE 1019

UNKNOWN_ACCOUNT 1020

OLD_SERVER 1021

SERVER_LICENSE_LIMITATION 1022

MOBILE_TERMINAL_NOT_ALLOWED 1023

CONNECTION_NOT_PERMITTED 1024

DEMO_DISABLED 1025

PASSWORD_MUST_CHANGED 1026

INVALID_ONETIME_PASSWORD 1027

SECRET_KEY_REQUIRED 1028

MT4_MIGRATION_PASSWORD 1029

MT5_MIGRATION_PASSWORD 1030

LAST_CONFIG_CANT_DELETE 2000

LAST_GROUP_CANT_DELETE 2001

ACCOUNTS_IN_GROUP 2003

INVALID_ACCOUNT_OR_TRADE_RANGES 2004

ACCOUNT_NOT_GROUP 2005

PROTECTED_CONFIG 2006

CONFIG_DUPLICATE 2007

CONFIG_LIMIT_REACHED 2008

INVALID_NETWORK_CONFIG 2009

DIALER_ID_ALREADY_EXISTS 2010

ADDRESS_ALREADY_EXISTS 2011

ATTEMPT_DELETE_WORKING_SERVER 2012

GATEWAY_NAME_ALREADY_EXISTS 2013

SERWER_SWITCHED_TO_BACKUP 2014

BACKUP_MODULE_ABSENT 2015

TRADE_MODULE_ABSENT 2016

HISTORY_MODULE_ABSENT 2017

ANOTHER_PROCESS_IN_PROGRESS 2018

LAST_ACCOUNT_CANT_DELETE 3001

LOGIN_RANGE_EXHAUSTED 3002

LOGIN_RESERVED 3003

ACCOUNT_ALREADY_EXISTS 3004

ATTEMPT_SELF_DELETION 3005

INVALID_PASSWORD 3006

USERS_LIMIT_REACHED 3007

ACCOUNT_HAS_OPEN_TRADES 3008

ATTEMPT_TO_MORE_ACCOUNT 3009

ATTEMPT_TO_MORE_GROUP 3010

ACCOUNT_BALANCE_ERROR 3011

ACCOUNT_HAS_INVALID_GROUP 3012

ONETRADE_ACCOUNT_ALREADY_EXISTS 3013

ACCOUNT_TRADE_DATA_IMPORT_ERROR 3014

ACCOUNT_TRADE_POSITION_IMPORT_ERROR 3015

ACCOUNT_OPEN_ORDERS_IMPORT_ERROR 3016

ACCOUNT_DEALS_HISTORY_IMPORT_ERROR 3017

ACCOUNT_ORDERS_HISTORY_IMPORT_ERROR 3018

ORDER_LIMIT_REACHED 4001

ORDER_ALREADY_EXISTS 4002

ORDER_RANGE_EXHAUSTED 4003

DEAL_RANGE_EXHAUSTED 4004

MONEY_LIMIT_REACHED 4005

DEAL_ALREADY_EXISTS 4006

ORDER_TICKET_RESERVED 4007

DEAL_TICKET_RESERVED 4008

BASE_SNAPSHOT_ERROR 5001

METHOD_NOT_SUPPORTED 5002

NO_DATA_REPORT 5003

BAD_TEMPLATE 5004

END_OF_TEMPLATE 5005

INVALID_ROW_SIZE 5006

REPEAT_LIMIT_REACHED 5007

REPORT_SIZE_LIMIT_REACHED 5008

SYMBOL_NOT_FOUND 6001

REQUEST_ON_WAY 10001

REQUEST_ACCEPTED 10002

REQUEST_PROCESSED 10003

REQUOTE 10004

PRICES 10005

REQUEST_REJECTED 10006

REQUEST_CANCELLED 10007

ORDER_PLACED 10008

REQUEST_EXECUTED 10009

REQUEST_EXECUTED_PARTIALLY 10010

REQUEST_ERROR 10011

REQUEST_TIMEOUT 10012

INVALID_REQUEST 10013

INVALID_VOLUME 10014

INVALID_PRICE 10015

INVALID_STOPS 10016

TRADE_DISABLED 10017

MARKET_CLOSED 10018

NO_MONEY 10019

PRICE_CHANGED 10020

NO_PRICES 10021

INVALID_EXPIRATION 10022

ORDER_ALREADY_CHANGED 10023

TOO_MANY_TRADE_REQUESTS 10024

NO_CHANGES 10025

AUTOTRADE_DISABLE_SERVER 10026

AUTOTRADE_DISABLE_CLIENT 10027

MODIFICATION_FAILED 10029

UNSUPPORTED_FILLING_MODE 10030

REQUEST_REJECTED_TO_ABSENCE_CONNECT 10031

ALLOWED_REAL_ACCOUNTS_ONLY 10032

ORDER_LIMIT_REACHED_EX 10033

VOLUME_LIMIT_REACHED 10034

INVALID_ORDER 10035

POSITION_NOT_EXISTS 10036

EXECUTION_NOT_BELONG_SERVER 10037

VOLUME_CLOSE_EXCEEDS_POSITION 10038

ORDER_CLOSE_ALREADY_EXISTS 10039

POSITION_LIMIT_REACHED 10040

ORDER_CANCELLED 10041

ONLY_LONG_POSITION 10042

ONLY_SHORT_POSITION 10043

ONLY_CLOSE_POSITION 10044

FIFO_CLOSE 10045

HEDGE_PROHIBITED 10046

REQUEST_RETURNED_IN_QUEUE 11000

REQUEST_EXECUTED_PARTIALLY_EX 11001

REQUOTE_EX 11002

INVALID_TOKEN 65536

Custom error codes

INVALID_SYMBOL 65537

INVALID_TICKET 65538

SAME_PARAMS 65539

CONNECT_ERROR 65540

TIMEOUT 65541

SOCKET_ERROR 65542

DOUBLE_REQUEST 65543

SERVER_BLACKLISTED 65544

NETWORK_PROBLEM 2147483647

ExecutionType

Execution type

NameNumberDescription
ExecutionType_Request 0

ExecutionType_Instant 1

ExecutionType_Market 2

ExecutionType_Exchange 3

ExpirationFlags

NameNumberDescription
ExpirationFlags_NONE 0

ExpirationFlags_GTC 1

ExpirationFlags_DAY 2

ExpirationFlags_SPECIFIED 4

ExpirationFlags_SPECIFIED_DAY 8

ExpirationFlags_ALL 15

ExpirationType

Expiration type

NameNumberDescription
ExpirationType_GTC 0

ExpirationType_Today 1

ExpirationType_Specified 2

ExpirationType_SpecifiedDay 3

FillPolicy

Fill policy

NameNumberDescription
FillPolicy_FillOrKill 0

FillPolicy_ImmediateOrCancel 1

FillPolicy_FlashFill 2

FillPolicy_Any 3

FillingFlags

NameNumberDescription
FillingFlags_NONE 0

FillingFlags_FOK 1

FillingFlags_IOC 2

FillingFlags_BOC 4

GTCMode

GTC mode

NameNumberDescription
GTCMode_Cancelled 0

GTCMode_TodayIncludeSL_TP 1

GTCMode_TodayExcludeSL_TP 2

OrderSort

NameNumberDescription
OrderSort_OpenTime 0

OrderSort_CloseTime 1

OrderState

Order state

NameNumberDescription
OrderState_Started 0

OrderState_Placed 1

OrderState_Cancelled 2

OrderState_Partial 3

OrderState_Filled 4

OrderState_Rejected 5

OrderState_Expired 6

OrderState_RequestAdding 7

OrderState_RequestModifying 8

OrderState_RequestCancelling 9

OrderType

Order type

NameNumberDescription
OrderType_Buy 0

OrderType_Sell 1

OrderType_BuyLimit 2

OrderType_SellLimit 3

OrderType_BuyStop 4

OrderType_SellStop 5

OrderType_BuyStopLimit 6

OrderType_SellStopLimit 7

OrderType_CloseBy 8

OrderType_Balance 100

OrderType_Credit 101

PlacedType

Placed manually or ByExpert

NameNumberDescription
PlacedType_Manually 0

PlacedType_Mobile 16

PlacedType_Web 17

PlacedType_ByExpert 1

PlacedType_OnSL 3

PlacedType_OnTP 4

PlacedType_OnStopOut 5

PlacedType_OnRollover 6

PlacedType_OnVmargin 8

PlacedType_OnSplit 18

PlacedType_ByDealer 2

PlacedType_Gateway 9

PlacedType_Signal 10

PlacedType_Settlement 11

PlacedType_Transfer 12

PlacedType_Sync 13

PlacedType_ExternalService 14

PlacedType_Migration 15

PlacedType_Default 20

ProxyTypes

Specifies the type of proxy servers that an instance of the ProxySocket class can use.

NameNumberDescription
ProxyTypes_None 0

No proxy server; the ProxySocket object behaves exactly like an ordinary Socket object.

ProxyTypes_Https 1

A HTTPS (CONNECT) proxy server.

ProxyTypes_Socks4 2

A SOCKS4[A] proxy server.

ProxyTypes_Socks5 3

A SOCKS5 proxy server.

SwapType

Swap type

NameNumberDescription
SwapType_SwapNone 0

SwapType_InPoints 1

SwapType_SymInfo_s408 2

SwapType_MarginCurrency 3

SwapType_Currency 4

SwapType_PercCurPrice 5

SwapType_PercOpenPrice 6

SwapType_PointClosePrice 7

SwapType_PointBidPrice 8

TradeMode

Trade mode

NameNumberDescription
TradeMode_Disabled 0

TradeMode_LongOnly 1

TradeMode_ShortOnly 2

TradeMode_CloseOnly 3

TradeMode_FullAccess 4

UpdateType

NameNumberDescription
UpdateType_Unknown 0

UpdateType_PendingClose 1

UpdateType_MarketOpen 2

UpdateType_PendingOpen 3

UpdateType_MarketClose 4

UpdateType_PartialClose 5

UpdateType_Started 6

UpdateType_Filled 7

UpdateType_Cancelling 8

UpdateType_MarketModify 9

UpdateType_PendingModify 10

UpdateType_OnStopLoss 11

UpdateType_OnTakeProfit 12

UpdateType_OnStopOut 13

UpdateType_Balance 14

UpdateType_Expired 15

UpdateType_Rejected 16

UpdateType_MarketCloseBy 17

V3DaysSwap

Swap day

NameNumberDescription
V3DaysSwap_Sunday 0

V3DaysSwap_Monday 1

V3DaysSwap_Tuesday 2

V3DaysSwap_Wednesday 3

V3DaysSwap_Thursday 4

V3DaysSwap_Friday 5

V3DaysSwap_Saturday 6

Connection

Method NameRequest TypeResponse TypeDescription
Connect ConnectRequest ConnectReply

Connect to account with user, password, host, port. [Example] { "user": "21455", "password": "1nJeS+Ae", "host": "95.217.147.61", "port": "443" }

ConnectProxy ConnectProxyRequest ConnectProxyReply

Connect to account with user, password, host, port. [Example] { "user": "21455", "password": "1nJeS+Ae", "host": "95.217.147.61", "port": "443", "proxyUser": "ProxyUser123", "proxyPassword": "qwerty123", "proxyHost": "65.108.126.217", "proxyPort": "1080", "proxyType": "Socks5" }

CheckConnect CheckConnectRequest CheckConnectReply

Check connection state and reconnect if connection lost [Example] { "id": "demo-token-mt5" }

Disconnect DisconnectRequest DisconnectReply

Disconnect from account [Example] { "id": "" }

MT5

Method NameRequest TypeResponse TypeDescription
Account AccountRequest AccountReply

Accound details [Example] { "id": "demo-token-mt5" }

AccountSummary AccountSummaryRequest AccountSummaryReply

Balance, Equity, Currency, FreeMargin, Margin, MarginLevel, Profit, Leverage, Credit [Example] { "id": "demo-token-mt5" }

OpenedOrders OpenedOrdersRequest OpenedOrdersReply

List of opened orders [Example] { "id": "", "sort": "OpenTime", "ascending": "True" }

OpenedOrder OpenedOrderRequest OpenedOrderReply

List of opened orders [Example] { "id": "", "ticket": "" }

OpenedOrdersTickets OpenedOrdersTicketsRequest OpenedOrdersTicketsReply

Just tickets of opened orders [Example] { "id": "demo-token-mt4" }

OrderHistory OrderHistoryRequest OrderHistoryReply

Order history [Example] { "id": "demo-token-mt5", "from": "2022-01-01T00:00:00", "to": "2022-09-01T00:00:00", "sort": "OpenTime", "ascending": "True" }

PendingOrderHistory PendingOrderHistoryRequest PendingOrderHistoryReply

Pending order history [Example] { "id": "demo-token-mt5", "from": "2023-09-01T00:00:00", "to": "2023-10-01T00:00:00", "ascending": "True" }

OrderHistoryPagination OrderHistoryPaginationRequest OrderHistoryPaginationReply

Order history [Example] { "id": "demo-token-mt5", "from": "2022-01-01T00:00:00", "to": "2022-09-01T00:00:00", "ordersPerPage": "10", "pageNumber": "0", "requestAgain": "False", "sort": "OpenTime", "ascending": "True", "ignoreDepositWithdraw": "False" }

Symbols SymbolsRequest SymbolsReply

List of avaliable symbols with parameters [Example] { "id": "" }

SymbolList SymbolListRequest SymbolListReply

List of avaliable symbols [Example] { "id": "" }

GetQuote GetQuoteRequest GetQuoteReply

Lot of informationabout about acocount. Can stuck swagger because of long json. You can use filter to reduce data. [Example] { "id": "demo-token-mt5", "symbol": "EURUSD", "msNotOlder": "0" }

GetQuoteMany GetQuoteManyRequest GetQuoteManyReply

Latest quote for the specified symbol [Example] { "id": "demo-token-mt5", "msNotOlder": "0" }

MarketWatchMany MarketWatchManyRequest MarketWatchManyReply

Market Watch for the specified symbols [Example] { "id": "demo-token-mt5" }

SymbolParams SymbolParamsRequest SymbolParamsReply

Full infromation about symbol and his group [Example] { "id": "demo-token-mt5", "symbol": "EURUSD" }

SymbolParamsMany SymbolParamsManyRequest SymbolParamsManyReply

Full infromation about symbol and his group for several symbols [Example] { "id": "demo-token-mt5", "limit": "10000" }

SymbolSessionsEx SymbolSessionsExRequest SymbolSessionsExReply

Quote and trade sessions(open and close time) for the symbol. Returns 2 arrays. One for quotes and one for trades. Each array contains 7 elements for each day of weeks starting from Sunday. [Example] { "id": "demo-token-mt5", "symbol": "EURUSD" }

SymbolSessionsExMany SymbolSessionsExManyRequest SymbolSessionsExManyReply

Quote and trade sessions(open and close time) for the symbol. Returns 2 arrays. One for quotes and one for trades. Each array contains 7 elements for each day of weeks starting from Sunday. <br> [Example] <br> { <br> "id": "demo-token-mt5" <br> }

ServerTimezone ServerTimezoneRequest ServerTimezoneReply

Server timezone. [Example] { "id": "" }

IsTradeSession IsTradeSessionRequest IsTradeSessionReply

Check market open or not for specified symbol. [Example] { "id": "demo-token-mt5", "symbol": "EURUSD" }

IsTradeSessionMany IsTradeSessionManyRequest IsTradeSessionManyReply

Check market open or not for specified symbol. [Example] { "id": "demo-token-mt5" }

IsQuoteSession IsQuoteSessionRequest IsQuoteSessionReply

Check market open or not for specified symbol. [Example] { "id": "demo-token-mt5", "symbol": "EURUSD" }

IsQuoteSessionMany IsQuoteSessionManyRequest IsQuoteSessionManyReply

Check market open or not for specified symbol. [Example] { "id": "demo-token-mt5" }

GetTickValueMany GetTickValueManyRequest GetTickValueManyReply

Tick value. [Example] { "id": "demo-token-mt5" }

TickValueWithSize TickValueWithSizeRequest TickValueWithSizeReply

Tick value with size. [Example] { "id": "demo-token-mt5" }

ChangePassword ChangePasswordRequest ChangePasswordReply

Mails MailsRequest MailsReply

Mail inbox [Example] { "id": "demo-token-mt5" }

RequiredMargin RequiredMarginRequest RequiredMarginReply

Required margin [Example] { "id": "demo-token-mt5", "symbol": "EURUSD", "lots": "1", "type": "DealBuy", "price": "0" }

QuoteHistory

Method NameRequest TypeResponse TypeDescription
PriceHistoryMonth PriceHistoryMonthRequest PriceHistoryMonthReply

Price history for 30 days [Example] { "id": "demo-token-mt5", "symbol": "EURUSD", "year": "2022", "month": "6", "day": "1", "timeFrame": "240" }

PriceHistoryMonthMany PriceHistoryMonthManyRequest PriceHistoryMonthManyReply

OHLC for 30 days for several symbols [Example] { "id": "demo-token-mt5", "year": "2022", "month": "6", "day": "1", "timeFrame": "240" }

PriceHistoryToday PriceHistoryTodayRequest PriceHistoryTodayReply

Price history for today [Example] { "id": "demo-token-mt5", "symbol": "EURUSD", "timeFrame": "240" }

PriceHistoryTodayMany PriceHistoryTodayManyRequest PriceHistoryTodayManyReply

Price history for today for several symbols [Example] { "id": "demo-token-mt5", "timeFrame": "240" }

PriceHistory PriceHistoryRequest PriceHistoryReply

Price history for 30 days [Example] { "id": "demo-token-mt5", "symbol": "EURUSD", "from": "2022-01-01T00:00:00", "to": "2022-03-01T00:00:00", "timeFrame": "240" }

PriceHistoryMany PriceHistoryManyRequest PriceHistoryManyReply

Price history for several symbols <br> [Example] <br> { <br> "id": "demo-token-mt5", <br> "from": "2024-01-01T00:00:00", <br> "to": "2024-03-01T00:00:00", <br> "timeFrame": "240" <br> }

PriceHistoryHighLow PriceHistoryHighLowRequest PriceHistoryHighLowReply

Price history for range [Example] { "id": "demo-token-mt5", "symbol": "EURUSD", "from": "2022-11-01T00:00:00", "to": "2022-11-02T00:00:00", "timeFrame": "60" }

PriceHistoryEx PriceHistoryExRequest PriceHistoryExReply

Request quote history from specified date for several bars back to the past <br> [Example] <br> { <br> "id": "demo-token-mt5", <br> "symbol": "EURUSD", <br> "to": "2022-03-01T00:00:00", <br> "numBars": "10", <br> "timeFrame": "240" <br> }

PriceHistoryExMany PriceHistoryExManyRequest PriceHistoryExManyReply

Request quote history from specified date for several bars back to the past <br> [Example] <br> { <br> "id": "demo-token-mt5", <br> "to": "2022-03-01T00:00:00", <br> "numBars": "10", <br> "timeFrame": "240" <br> }

Service

Method NameRequest TypeResponse TypeDescription
Ping PingRequest PingReply

Simple test without parameters

Health HealthRequest HealthReply

PingHost PingHostRequest PingHostReply

Simple test without parameters [Example] { "host": "", "port": "443" }

PingHostMany PingHostManyRequest PingHostManyReply

Simple test without parameters [Example] { "host": "", "port": "" }

MemorySnapshot MemorySnapshotRequest MemorySnapshotReply

Memory snapshot

Search SearchRequest SearchReply

Broker search by company name [Example] { "company": "" }

GetClients GetClientsRequest GetClientsReply

Return all active with connection state

GetDemo GetDemoRequest GetDemoReply

Create demo account [Example] { "host": "", "port": "" }

Version VersionRequest VersionReply

API version

Streams

Method NameRequest TypeResponse TypeDescription
Events EventsRequest EventsReply stream

Use this endpoint to get all events(OnQuote, OnOrderUpdate, etc..) via one web socket cobnnection. [Example] { "id": "demo-token-mt5" }

OnOrderUpdate OnOrderUpdateRequest OnOrderUpdateReply stream

All trading activity on accont. [Example] { "id": "demo-token-mt5" }

OnQuote OnQuoteRequest OnQuoteReply stream

Real time quotes. [Example] { "id": "demo-token-mt5" }

OnTickValue OnTickValueRequest OnTickValueReply stream

Real time quotes. [Example] { "id": "demo-token-mt5" }

OnOrderProfit OnOrderProfitRequest OnOrderProfitReply stream

Orders profits updates. [Example] { "id": "demo-token-mt5" }

OnMarketWatch OnMarketWatchRequest OnMarketWatchReply stream

Market watch updates. [Example] { "id": "demo-token-mt5" }

OnTickHistory OnTickHistoryRequest OnTickHistoryReply stream

Tick history. [Example] { "id": "demo-token-mt5" }

OnMail OnMailRequest OnMailReply stream

Tick history. [Example] { "id": "demo-token-mt5" }

OnOpenedOrdersTickets OnOpenedOrdersTicketsRequest OnOpenedOrdersTicketsReply stream

Sends opened order tickets each 'interval' milliseconds [Example] { "id": "demo-token-mt5", "interval": "1000" }

Subscriptions

Method NameRequest TypeResponse TypeDescription
Subscribe SubscribeRequest SubscribeReply

Subscribe symbol for real time quotes and get results via /events socket connection [Example] { "id": "demo-token-mt5", "symbol": "EURUSD", "interval": "0" }

SubscribeMany SubscribeManyRequest SubscribeManyReply

Subscribe symbosl for real time quotes and get results via /events socket connection [Example] { "id": "demo-token-mt5", "interval": "0" }

UnSubscribe UnSubscribeRequest UnSubscribeReply

Unsubscribe symbol for real time quotes and get results via /events socket connection [Example] { "id": "demo-token-mt5", "symbol": "EURUSD" }

UnSubscribeMany UnSubscribeManyRequest UnSubscribeManyReply

UnSubscribe symbosls for real time quotes and get results via /events socket connection [Example] { "id": "demo-token-mt5" }

SubscribeOrderProfit SubscribeOrderProfitRequest SubscribeOrderProfitReply

Subscribe for order profit updates and get results via /events socket connection [Example] { "id": "demo-token-mt5" }

SubscribeTickValue SubscribeTickValueRequest SubscribeTickValueReply

Subscribe symbol for tick value updates [Example] { "id": "demo-token-mt5", "symbol": "EURUSD", "interval": "0" }

SubscribeOrderUpdate SubscribeOrderUpdateRequest SubscribeOrderUpdateReply

Subscribe symbol for tick value updates [Example] { "id": "demo-token-mt5" }

SubscribeMarketWatch SubscribeMarketWatchRequest SubscribeMarketWatchReply

Subscribe market watch updates for /Events socket [Example] { "id": "demo-token-mt5" }

SubscribeOpenedOrdersTickets SubscribeOpenedOrdersTicketsRequest SubscribeOpenedOrdersTicketsReply

Subscribe symbol for tick value updates [Example] { "id": "demo-token-mt5", "interval": "1000" }

TickHistory

Method NameRequest TypeResponse TypeDescription
TickHistoryRequest TickHistoryRequestRequest TickHistoryRequestReply

Request tick history from specified time to present time. Please get result with OnTickHistory websocket. [Example] { "id": "demo-token-mt5", "symbol": "EURUSD", "startYear": "2023", "startMonth": "11", "startDay": "5" }

TickHistoryStop TickHistoryStopRequest TickHistoryStopReply

Stop tick history request for some symbol [Example] { "id": "demo-token-mt5", "symbol": "EURUSD" }

OnTickHistory OnTickHistoryRequest OnTickHistoryReply stream

Trading

Method NameRequest TypeResponse TypeDescription
OrderSend OrderSendRequest OrderSendReply

Send market or pending order [Example] { "id": "demo-token-mt5", "symbol": "EURUSD", "operation": "Buy", "volume": "0,1", "price": "0", "slippage": "0", "stoploss": "0", "takeprofit": "0", "expertID": "0", "stopLimitPrice": "0", "expirationType": "Specified", "placedType": "Manually" }

OrderModify OrderModifyRequest OrderModifyReply

Modify market or pending order [Example] { "id": "demo-token-mt5", "ticket": "0", "stoploss": "0", "takeprofit": "0", "price": "0", "expirationType": "Specified" }

OrderClose OrderCloseRequest OrderCloseReply

Close market or pending order [Example] { "id": "demo-token-mt5", "ticket": "0", "lots": "0", "price": "0", "slippage": "0" }

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
double double double float float64 double float Float
float float float float float32 float float Float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int int32 int integer Bignum or Fixnum (as required)
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long int64 long integer/string Bignum
uint32 Uses variable-length encoding. uint32 int int/long uint32 uint integer Bignum or Fixnum (as required)
uint64 Uses variable-length encoding. uint64 long int/long uint64 ulong integer/string Bignum or Fixnum (as required)
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int int32 int integer Bignum or Fixnum (as required)
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long int64 long integer/string Bignum
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int uint32 uint integer Bignum or Fixnum (as required)
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long uint64 ulong integer/string Bignum
sfixed32 Always four bytes. int32 int int int32 int integer Bignum or Fixnum (as required)
sfixed64 Always eight bytes. int64 long int/long int64 long integer/string Bignum
bool bool boolean boolean bool bool boolean TrueClass/FalseClass
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode string string string String (UTF-8)
bytes May contain any arbitrary sequence of bytes. string ByteString str []byte ByteString string String (ASCII-8BIT)