Field | Type | Label | Description |
Login | uint64 |
|
|
Password | string |
|
|
Investor | string |
|
Account details
Field | Type | Label | Description |
Login | uint64 |
|
|
Type | string |
|
|
UserName | string |
|
|
TradeFlags | int32 |
|
|
Country | string |
|
|
City | string |
|
|
State | string |
|
|
ZipCode | string |
|
|
UserAddress | string |
|
|
Phone | string |
|
|
string |
|
||
Balance | double |
|
|
Credit | double |
|
|
Blocked | double |
|
|
Leverage | int32 |
|
Field | Type | Label | Description |
result | AccountRec |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Account summary trading information
Field | Type | Label | Description |
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) |
Field | Type | Label | Description |
result | AccountSummary |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
OHLC
Field | Type | Label | Description |
Time | google.protobuf.Timestamp |
|
|
OpenPrice | double |
|
|
HighPrice | double |
|
|
LowPrice | double |
|
|
ClosePrice | double |
|
|
TickVolume | uint64 |
|
|
Spread | int32 |
|
|
Volume | uint64 |
|
Field | Type | Label | Description |
Symbol | string |
|
|
Bars | Bar | repeated |
|
Exception | string |
|
Field | Type | Label | Description |
result | string |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"password": "",
"isInvestor": "False"
}
Field | Type | Label | Description |
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 |
Field | Type | Label | Description |
result | string |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Client ID with connection status
Field | Type | Label | Description |
Id | string | Token |
|
Connected | bool | Connection status |
|
User | uint64 | User |
|
Host | string | Host |
|
Port | int32 | Port |
|
ConnectTime | google.protobuf.Timestamp | Connect time |
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Field | Type | Label | Description |
CompanyName | string |
|
|
Results | Result | repeated |
|
Field | Type | Label | Description |
result | string |
|
|
error | Error |
|
[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"
}
Field | Type | Label | Description |
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 |
Field | Type | Label | Description |
result | string |
|
|
error | Error |
|
[Example]
{
"user": "21455",
"password": "1nJeS+Ae",
"host": "95.217.147.61",
"port": "443"
}
Field | Type | Label | Description |
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 |
Internal details for the deal
Field | Type | Label | Description |
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 |
Field | Type | Label | Description |
result | string |
|
|
error | Error |
|
[Example]
{
"id": ""
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Field | Type | Label | Description |
code | ErrorCode |
|
|
message | string |
|
|
stackTrace | string |
|
Field | Type | Label | Description |
result | string |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Field | Type | Label | Description |
result | ClientStatus | repeated |
|
error | Error |
|
Field | Type | Label | Description |
result | AccountAnswer |
|
|
error | Error |
|
[Example]
{
"host": "",
"port": ""
}
Field | Type | Label | Description |
host | string | Host - ip adddress or dns name. [Required] |
|
port | int32 | Port. [Required] |
Field | Type | Label | Description |
result | Quote | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"msNotOlder": "0"
}
Field | Type | Label | Description |
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. |
Field | Type | Label | Description |
result | Quote |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"symbol": "EURUSD",
"msNotOlder": "0"
}
Field | Type | Label | Description |
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. |
Field | Type | Label | Description |
result | double | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbol | string | repeated | Symbol |
Field | Type | Label | Description |
result | string |
|
|
error | Error |
|
Field | Type | Label | Description |
result | SessionState | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbols | string | repeated | Symbols |
Field | Type | Label | Description |
result | bool |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"symbol": "EURUSD"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbol | string | Symbol [Required] |
Field | Type | Label | Description |
result | SessionState | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbols | string | repeated | Symbols |
Field | Type | Label | Description |
result | bool |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"symbol": "EURUSD"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbol | string | Symbol [Required] |
Field | Type | Label | Description |
Id | int64 |
|
|
Time | google.protobuf.Timestamp |
|
|
From | string |
|
|
To | string |
|
|
Subject | string |
|
|
Body | string |
|
Field | Type | Label | Description |
result | MailMessage | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Field | Type | Label | Description |
Symbol | string |
|
|
High | double |
|
|
Low | double |
|
|
OpenPrice | double |
|
|
ClosePrice | double |
|
|
DailyChange | double |
|
|
Bid | double |
|
|
Ask | double |
|
|
Spread | int32 |
|
|
Volume | uint64 |
|
Field | Type | Label | Description |
result | MarketWatch | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbols | string | repeated | Symbols [Required] |
Field | Type | Label | Description |
result | string |
|
|
error | Error |
|
Field | Type | Label | Description |
result | MailMessage |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Field | Type | Label | Description |
result | MarketWatch |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Field | Type | Label | Description |
result | MailMessage |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"interval": "1000"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
interval | int32 | optional | Minimum interval between events in milliseconds |
Field | Type | Label | Description |
result | ProfitUpdate |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Field | Type | Label | Description |
result | OrderUpdateSummary |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Field | Type | Label | Description |
result | Quote |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Field | Type | Label | Description |
result | TickHistoryEventArgs |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Field | Type | Label | Description |
result | SymbolTickValue |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Field | Type | Label | Description |
result | Order |
|
|
error | Error |
|
[Example]
{
"id": "",
"ticket": ""
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
ticket | int64 | optional | Ticket number |
Field | Type | Label | Description |
result | Order | repeated |
|
error | Error |
|
[Example]
{
"id": "",
"sort": "OpenTime",
"ascending": "True"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
sort | OrderSort | optional | Sort by open time or close time |
ascending | bool | optional | Ascending sort |
Field | Type | Label | Description |
result | int64 | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt4"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Pending, market or history order
Field | Type | Label | Description |
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 |
|
Field | Type | Label | Description |
result | Order |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"ticket": "0",
"lots": "0",
"price": "0",
"slippage": "0"
}
Field | Type | Label | Description |
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. |
Field | Type | Label | Description |
result | PaginationReply |
|
|
error | Error |
|
[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"
}
Field | Type | Label | Description |
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 |
Field | Type | Label | Description |
result | Order | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"from": "2022-01-01T00:00:00",
"to": "2022-09-01T00:00:00",
"sort": "OpenTime",
"ascending": "True"
}
Field | Type | Label | Description |
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 |
Internal information for the order(pending)
Field | Type | Label | Description |
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) |
Field | Type | Label | Description |
result | Order |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"ticket": "0",
"stoploss": "0",
"takeprofit": "0",
"price": "0",
"expirationType": "Specified"
}
Field | Type | Label | Description |
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 |
Field | Type | Label | Description |
result | Order |
|
|
error | Error |
|
[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"
}
Field | Type | Label | Description |
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 |
Details of order update
Field | Type | Label | Description |
Trans | TransactionInfo |
|
|
OrderInternal | OrderInternal |
|
|
Deal | DealInternal |
|
|
OppositeDeal | DealInternal |
|
|
Order | Order |
|
|
Type | UpdateType |
|
|
CloseByTicket | int32 |
|
Order update event details
Field | Type | Label | Description |
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 |
OrderHistoryPagination
Field | Type | Label | Description |
PagesCount | int32 | Total pages count |
|
PageNumber | int32 | Current page |
|
Orders | Order | repeated | Orders |
Field | Type | Label | Description |
result | OrderInternal | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"from": "2023-09-01T00:00:00",
"to": "2023-10-01T00:00:00",
"ascending": "True"
}
Field | Type | Label | Description |
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 |
Field | Type | Label | Description |
result | int32 | repeated |
|
error | Error |
|
[Example]
{
"host": "",
"port": ""
}
Field | Type | Label | Description |
host | string | repeated | Host - ip adddress or dns name. [Required] |
port | int32 | repeated | Port. [Required] |
Field | Type | Label | Description |
result | int32 |
|
|
error | Error |
|
[Example]
{
"host": "",
"port": "443"
}
Field | Type | Label | Description |
host | string | Host - ip adddress or dns name. [Required] |
|
port | int32 | optional | Port. |
Field | Type | Label | Description |
result | string |
|
|
error | Error |
|
Field | Type | Label | Description |
result | BarsForSymbol | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"to": "2022-03-01T00:00:00",
"numBars": "10",
"timeFrame": "240"
}
Field | Type | Label | Description |
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 |
|
Field | Type | Label | Description |
result | Bar | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"symbol": "EURUSD",
"to": "2022-03-01T00:00:00",
"numBars": "10",
"timeFrame": "240"
}
Field | Type | Label | Description |
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 |
|
Field | Type | Label | Description |
result | Bar |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"symbol": "EURUSD",
"from": "2022-11-01T00:00:00",
"to": "2022-11-02T00:00:00",
"timeFrame": "60"
}
Field | Type | Label | Description |
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 |
|
Field | Type | Label | Description |
result | BarsForSymbol | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"from": "2024-01-01T00:00:00",
"to": "2024-03-01T00:00:00",
"timeFrame": "240"
}
Field | Type | Label | Description |
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 |
|
Field | Type | Label | Description |
result | QuoteHistoryEventArgs | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"year": "2022",
"month": "6",
"day": "1",
"timeFrame": "240"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbols | string | repeated | Symbols [Required] |
year | int32 |
|
|
month | int32 |
|
|
day | int32 |
|
|
timeFrame | int32 |
|
Field | Type | Label | Description |
result | Bar | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"symbol": "EURUSD",
"year": "2022",
"month": "6",
"day": "1",
"timeFrame": "240"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbol | string | Symbol [Required] |
|
year | int32 |
|
|
month | int32 |
|
|
day | int32 |
|
|
timeFrame | int32 |
|
Field | Type | Label | Description |
result | Bar | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"symbol": "EURUSD",
"from": "2022-01-01T00:00:00",
"to": "2022-03-01T00:00:00",
"timeFrame": "240"
}
Field | Type | Label | Description |
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 |
|
Field | Type | Label | Description |
result | QuoteHistoryEventArgs | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"timeFrame": "240"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbols | string | repeated | Symbols [Required] |
timeFrame | int32 |
|
Field | Type | Label | Description |
result | Bar | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"symbol": "EURUSD",
"timeFrame": "240"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbol | string | Symbol [Required] |
|
timeFrame | int32 |
|
Profit update message
Field | Type | Label | Description |
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 |
New quote event arguments.
Field | Type | Label | Description |
Symbol | string | Trading instrument. |
|
Bid | double | Bid. |
|
Ask | double | Ask. |
|
Time | google.protobuf.Timestamp | Server time. |
|
Last | double | Last deal price. |
|
Volume | uint64 | Volume |
Quote history event args.
Field | Type | Label | Description |
Symbol | string | Instrument. |
|
Bars | Bar | repeated | History bars. |
Field | Type | Label | Description |
result | double |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"symbol": "EURUSD",
"lots": "1",
"type": "DealBuy",
"price": "0"
}
Field | Type | Label | Description |
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 |
Field | Type | Label | Description |
Name | string |
|
|
Access | string | repeated |
|
Field | Type | Label | Description |
result | Company | repeated |
|
error | Error |
|
[Example]
{
"company": ""
}
Field | Type | Label | Description |
company | string | Company name [Required] |
Server details from servers.dat
Field | Type | Label | Description |
ServerName | string |
|
|
CompanyName | string |
|
|
DST | int32 |
|
|
TimeZone | int32 |
|
Field | Type | Label | Description |
result | int32 |
|
|
error | Error |
|
[Example]
{
"id": ""
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Trade or quote session details
Field | Type | Label | Description |
StartTime | int32 | Start time (in minites) |
|
EndTime | int32 | End time (in minutes) |
True or false for current symbol for now
Field | Type | Label | Description |
Symbol | string | Symbol |
|
Active | bool | Active or not |
List of sessions for one day
Field | Type | Label | Description |
Sessions | Session | repeated | List of sessions |
Field | Type | Label | Description |
result | string |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"interval": "0"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbols | string | repeated | Symbols [Required] |
interval | int32 | optional | Minimum interval between events in milliseconds |
Field | Type | Label | Description |
result | string |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Field | Type | Label | Description |
result | string |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"interval": "1000"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
interval | int32 | optional | Minimum interval between events in milliseconds |
Field | Type | Label | Description |
result | Order | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Field | Type | Label | Description |
result | Order | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Field | Type | Label | Description |
result | string |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"symbol": "EURUSD",
"interval": "0"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbol | string | Symbol [Required] |
|
interval | int32 | optional | Minimum interval between events in milliseconds |
Field | Type | Label | Description |
result | string |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"symbol": "EURUSD",
"interval": "0"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbol | string | Symbol [Required] |
|
interval | int32 | optional | Minimum interval between events in milliseconds |
Symbol group information
Field | Type | Label | Description |
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 |
|
Symbol details
Field | Type | Label | Description |
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 |
Field | Type | Label | Description |
result | string | repeated |
|
error | Error |
|
[Example]
{
"id": ""
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Information about symbol and his group.
Field | Type | Label | Description |
Symbol | string | Symbol name |
|
SymbolInfo | SymbolInfo | Symbol parameters |
|
SymbolGroup | SymGroup | Symbol group |
Field | Type | Label | Description |
result | SymbolParams | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"limit": "10000"
}
Field | Type | Label | Description |
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 |
Field | Type | Label | Description |
result | SymbolParams |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"symbol": "EURUSD"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbol | string | Symbol [Required] |
Quote and trade sessions for each day of week starting from Sunday
Field | Type | Label | Description |
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 |
Field | Type | Label | Description |
result | SymbolSessionsEx | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbol | string | repeated | Symbol [Required] |
Field | Type | Label | Description |
result | SymbolSessionsEx |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"symbol": "EURUSD"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbol | string | Symbol [Required] |
Tick value update
Field | Type | Label | Description |
Symbol | string | Symbol |
|
TickValue | double | Tick value |
Field | Type | Label | Description |
result | SymbolInfo | repeated |
|
error | Error |
|
[Example]
{
"id": ""
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
Field | Type | Label | Description |
Time | google.protobuf.Timestamp |
|
|
Bid | double |
|
|
Ask | double |
|
|
Last | double |
|
|
Volume | uint64 |
|
Field | Type | Label | Description |
Symbol | string |
|
|
Bars | TickBar | repeated |
|
Field | Type | Label | Description |
result | string |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"symbol": "EURUSD",
"startYear": "2023",
"startMonth": "11",
"startDay": "5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbol | string | Symbol [Required] |
|
startYear | int32 |
|
|
startMonth | int32 |
|
|
startDay | int32 |
|
Field | Type | Label | Description |
result | string |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"symbol": "EURUSD"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbol | string | Symbol [Required] |
Tick value with tick size
Field | Type | Label | Description |
TickValue | double | Tick value |
|
TickSize | double | Tick size |
|
Symbol | string | Symbol |
Field | Type | Label | Description |
result | TickValueWithSize | repeated |
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbol | string | repeated | Symbol |
Transaction information
Field | Type | Label | Description |
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 |
Field | Type | Label | Description |
result | string |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbols | string | repeated | Symbols [Required] |
Field | Type | Label | Description |
result | string |
|
|
error | Error |
|
[Example]
{
"id": "demo-token-mt5",
"symbol": "EURUSD"
}
Field | Type | Label | Description |
id | string | Token returned by 'Connect' method [Required] |
|
symbol | string | Symbol [Required] |
Field | Type | Label | Description |
result | string |
|
|
error | Error |
|
Netting or Hedging
Name | Number | Description |
AccMethod_Default | 0 | |
AccMethod_Netting | 1 | |
AccMethod_Hedging | 2 |
Profit calculation mode
Name | Number | Description |
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 |
Deal type
Name | Number | Description |
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 of the deal
Name | Number | Description |
Direction_In | 0 | |
Direction_Out | 1 | |
Direction_InOut | 2 | |
Direction_OutBy | 3 |
Name | Number | Description |
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 |
Execution type
Name | Number | Description |
ExecutionType_Request | 0 | |
ExecutionType_Instant | 1 | |
ExecutionType_Market | 2 | |
ExecutionType_Exchange | 3 |
Name | Number | Description |
ExpirationFlags_NONE | 0 | |
ExpirationFlags_GTC | 1 | |
ExpirationFlags_DAY | 2 | |
ExpirationFlags_SPECIFIED | 4 | |
ExpirationFlags_SPECIFIED_DAY | 8 | |
ExpirationFlags_ALL | 15 |
Expiration type
Name | Number | Description |
ExpirationType_GTC | 0 | |
ExpirationType_Today | 1 | |
ExpirationType_Specified | 2 | |
ExpirationType_SpecifiedDay | 3 |
Fill policy
Name | Number | Description |
FillPolicy_FillOrKill | 0 | |
FillPolicy_ImmediateOrCancel | 1 | |
FillPolicy_FlashFill | 2 | |
FillPolicy_Any | 3 |
Name | Number | Description |
FillingFlags_NONE | 0 | |
FillingFlags_FOK | 1 | |
FillingFlags_IOC | 2 | |
FillingFlags_BOC | 4 |
GTC mode
Name | Number | Description |
GTCMode_Cancelled | 0 | |
GTCMode_TodayIncludeSL_TP | 1 | |
GTCMode_TodayExcludeSL_TP | 2 |
Name | Number | Description |
OrderSort_OpenTime | 0 | |
OrderSort_CloseTime | 1 |
Order state
Name | Number | Description |
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 |
Order type
Name | Number | Description |
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 |
Placed manually or ByExpert
Name | Number | Description |
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 |
Specifies the type of proxy servers that an instance of the ProxySocket class can use.
Name | Number | Description |
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. |
Swap type
Name | Number | Description |
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 |
Trade mode
Name | Number | Description |
TradeMode_Disabled | 0 | |
TradeMode_LongOnly | 1 | |
TradeMode_ShortOnly | 2 | |
TradeMode_CloseOnly | 3 | |
TradeMode_FullAccess | 4 |
Name | Number | Description |
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 |
Swap day
Name | Number | Description |
V3DaysSwap_Sunday | 0 | |
V3DaysSwap_Monday | 1 | |
V3DaysSwap_Tuesday | 2 | |
V3DaysSwap_Wednesday | 3 | |
V3DaysSwap_Thursday | 4 | |
V3DaysSwap_Friday | 5 | |
V3DaysSwap_Saturday | 6 |
Method Name | Request Type | Response Type | Description |
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": "" } |
Method Name | Request Type | Response Type | Description |
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" } |
Method Name | Request Type | Response Type | Description |
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> } |
Method Name | Request Type | Response Type | Description |
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 |
Method Name | Request Type | Response Type | Description |
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" } |
Method Name | Request Type | Response Type | Description |
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" } |
Method Name | Request Type | Response Type | Description |
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 |
Method Name | Request Type | Response Type | Description |
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" } |
.proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
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) |