Open API Messages

Open API Messages .proto file

ProtoOAAuthReq

Authentication request

Required Type Field Name Description
optional ProtoOAPayloadType payloadType
required string clientId
required string clientSecret

ProtoOAAuthRes

Authentication response

Required Type Field Name Description
optional ProtoOAPayloadType payloadType

ProtoOASubscribeForTradingEventsReq

Request which subscribes for trading events for specified account

Required Type Field Name Description
optional ProtoOAPayloadType payloadType
required int64 accountId
required string accessToken

ProtoOASubscribeForTradingEventsRes

Trading event subscription response

Required Type Field Name Description
optional ProtoOAPayloadType payloadType

ProtoOAUnsubscribeFromTradingEventsReq

Request which unsubscribes from trading events for specified account

Required Type Field Name Description
optional ProtoOAPayloadType payloadType
required int64 accountId

ProtoOAUnsubscribeFromTradingEventsRes

Trading event unsubscription response

Required Type Field Name Description
optional ProtoOAPayloadType payloadType

ProtoOAGetSubscribedAccountsReq

Request for a list of accounts trading events from which are received

Required Type Field Name Description
optional ProtoOAPayloadType payloadType

ProtoOAGetSubscribedAccountsRes

Response with a list of accounts trading events from which are received

Required Type Field Name Description
optional ProtoOAPayloadType payloadType
repeated int64 accountId

ProtoOAExecutionEvent

Open Api Execution event

Required Type Field Name Description
optional ProtoOAPayloadType payloadType
required ProtoOAExecutionType executionType
required ProtoOAOrder order
optional ProtoOAPosition position
optional string reasonCode

ProtoOACreateOrderReq

A request for a new order

Required Type Field Name Description
optional ProtoOAPayloadType payloadType
required string accessToken
required int64 accountId
required string symbolName
required ProtoOAOrderType orderType
required ProtoTradeSide tradeSide
required int64 volume
optional int32 relativeStopLossInPips
optional int32 relativeTakeProfitInPips
optional double baseSlippagePrice
optional int64 slippageInPips
optional double limitPrice
optional double stopPrice
optional int64 expirationTimestamp
optional double stopLossPrice
optional double takeProfitPrice
optional string comment
optional int64 positionId
optional ProtoTimeInForce timeInForce
optional string clientOrderId
optional string slippageInPoints

ProtoOACancelOrderReq

Cancel pending order request

Required Type Field Name Description
optional ProtoOAPayloadType payloadType
required string accessToken
required int64 accountId
required int64 orderId

ProtoOAClosePositionReq

Closing existing position request

Required Type Field Name Description
optional ProtoOAPayloadType payloadType
required string accessToken
required int64 accountId
required int64 positionId
required int64 volume
optional ProtoTimeInForce timeInForce not supported yet

ProtoOAAmendPositionStopLossTakeProfitReq

Amending existing position's stop loss and take profit

Required Type Field Name Description
optional ProtoOAPayloadType payloadType
required string accessToken
required int64 accountId
required int64 positionId
optional double stopLossPrice absolute stop loss price (1.23456 for example).
optional double takeProfitPrice absolute take profit price (1.26543 for example).

ProtoOAAmendOrderReq

Amending existing pending order request

Required Type Field Name Description
optional ProtoOAPayloadType payloadType
required string accessToken
required int64 accountId
required int64 orderId
optional ProtoTimeInForce timeInForce available GTD and GTC only. not supported yet
optional double limitPrice
optional double stopPrice
optional int64 expirationTimestamp should be set in case GTD.
optional int64 minVolume min volume to fill. If minVolume equals to volume this means partial fills is disabled not supported yet
optional double stopLossPrice absolute stop loss price (1.23456 for example). Excludes takeProfitInPips field. Unsupported for MARKER orders.
optional double takeProfitPrice absolute take profit price (1.23456 for example). Excludes takeProfitInPips field. Unsupported for MARKER orders.
optional int32 relativeStopLossInPips relative stop loss price for Market order with relative SL/TP set in pips
optional int32 relativeTakeProfitInPips relative take profit price for Market order with relative SL/TP set in pips
optional string comment not supported yet

ProtoOASubscribeForSpotsReq

Request subscribes for spots for specified account and symbol

Required Type Field Name Description
optional ProtoOAPayloadType payloadType
required int64 accountId
required string accessToken
required string symblolName
repeated ProtoOATrendbarPeriod trendbarPeriod

ProtoOASubscribeForSpotsRes

Spot subscription response

Required Type Field Name Description
optional ProtoOAPayloadType payloadType
required uint32 subscriptionId this ID is assigned per trading account, same account has the same subscription ID for all its symbols subscribed, each connection can have up to 100 subscriptions max, but number of connections established from the same IP is not limited

ProtoOAUnsubscribeFromSpotsReq

Unsubscribes from spots for specified subscriptionId and accountId

Required Type Field Name Description
optional ProtoOAPayloadType payloadType
optional uint32 subscriptionId
optional string symbolName

ProtoOAUnsubscribeFromSpotsRes

Spot unsubscription response

Required Type Field Name Description
optional ProtoOAPayloadType payloadType

ProtoOAGetSpotSubscriptionReq

Request for subscription by its id

Required Type Field Name Description
optional ProtoOAPayloadType payloadType
required uint32 subscriptionId

ProtoOAGetSpotSubscriptionRes

SpotSubscription Response

Required Type Field Name Description
optional ProtoOAPayloadType payloadType
required ProtoOASpotSubscription spotSubscription

ProtoOAGetAllSpotSubscriptionsReq

Request for all subscriptions of specified account

Required Type Field Name Description
optional ProtoOAPayloadType payloadType

ProtoOAGetAllSpotSubscriptionsRes

Response with all account's spotSubscriptions

Required Type Field Name Description
optional ProtoOAPayloadType payloadType
repeated ProtoOASpotSubscription spotSubscriptions

ProtoOASpotEvent

Spot event

Required Type Field Name Description
optional ProtoOAPayloadType payloadType
required uint32 subscriptionId
required string symbolName
optional double bidPrice
optional double askPrice
repeated ProtoOATrendbar trendbar
required int64 timestamp

ProtoOAPingReq

Open API Ping request

Required Type Field Name Description
optional ProtoOAPayloadType payloadType
required int64 timestamp

ProtoOAPingRes

Open API Ping response

Required Type Field Name Description
optional ProtoOAPayloadType payloadType
required int64 timestamp

Scalar Value Types

.proto Type Notes C++ Type Java Type Python Type
double double double float
float 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
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
uint32 Uses variable-length encoding. uint32 int int/long
uint64 Uses variable-length encoding. uint64 long int/long
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long
sfixed32 Always four bytes. int32 int int
sfixed64 Always eight bytes. int64 long int/long
bool bool boolean boolean
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode
bytes May contain any arbitrary sequence of bytes. string ByteString str