Open API Model Messages

Open API Model Messages .proto file

ProtoOAAsset

The asset entity.

Required Type Field Name Description
required int64 assetId The unique asset ID.
required string name The asset name.
optional string displayName User friendly name.


ProtoOASymbol

The trading symbol entity.

Required Type Field Name Description
required int64 symbolId The unique identifier of the symbol in a specific server environment within cTrader platform. Different servers have different IDs.
required int32 digits The number of price digits to be displayed.
required int32 pipPosition The pip position on digits.
optional bool enableShortSelling If TRUE then the short selling with the symbol is enabled.
optional bool guaranteedStopLoss If TRUE then setting the guaranteed Stop Loss is available for the limited risk accounts.
optional ProtoOADayOfWeek swapRollover3Days Day of the week when the SWAP charge amount will be tripled. It doesn't impact the Rollover Commission.
optional double swapLong SWAP charge for the long positions.
optional double swapShort SWAP charge for the short positions.
optional int64 maxVolume The maximum allowed volume in cents for an order with a symbol.
optional int64 minVolume The minimum allowed volume in cents for an order with a symbol.
optional int64 stepVolume Multiplier of the volume for an order.
optional uint64 maxExposure Value of max exposure per symbol, per account. Blocks execution if breached.
repeated ProtoOAInterval schedule Symbol trading interval, specified in seconds starting from Sunday 00:00 in the specified time zone.
required int64 commission The commission base amount. The total commission depends on the commission type.
optional ProtoOACommissionType commissionType The commission type. See ProtoOACommissionType for details.
optional uint32 slDistance The minimum allowed distance between stop loss and current market price.
optional uint32 tpDistance The minimum allowed distance between the Take Profit and current market price.
optional uint32 gslDistance The minimum allowed distance between the guaranteed Stop Loss and current market price.
optional int64 gslCharge The guaranteed Stop Loss fee.
optional ProtoOASymbolDistanceType distanceSetIn Unit of the distance measure for slDistance, tpDistance, gslDistance.
optional int64 minCommission The minimum commission amount per trade.
optional ProtoOAMinCommissionType minCommissionType The minimum commission Type. See ProtoOAMinCommissionType for details.
optional string minCommissionAsset Currency for the minimum commission. (USD or quote currency).
optional int64 rolloverCommission The amount of commission per trade for the Shariah-Compliant accounts in the deposit currency (swapFree = TRUE).
optional int32 skipRolloverDays The initial period before the first Rollover Commission will be charged on the account.
optional string scheduleTimeZone Time zone for the symbol trading intervals.
optional ProtoOATradingMode tradingMode Rules for trading with the symbol. See ProtoOATradingMode for details.
optional ProtoOADayOfWeek rolloverCommission3Days The day of the week (UTC) when the Administrative Fee charge amount will be tripled. Applied only if RolloverChargePeriod = 0 or 1.
optional ProtoOASwapCalculationType swapCalculationType Specifies type of the SWAP computation as points (0) or interest (1, annual, in percent).


ProtoOALightSymbol

Lightweight symbol entity.

Required Type Field Name Description
required int64 symbolId The unique identifier of the symbol in a specific server environment within cTrader platform. Different servers have different IDs.
optional string symbolName Name of the symbol (e.g. EUR/USD).
optional bool enabled If TRUE then the symbol is visible for traders.
optional int64 baseAssetId The base asset.
optional int64 quoteAssetId The quote asset.
optional int64 symbolCategoryId The ID of the symbol category used for symbols grouping.
optional int64 description


ProtoOASymbolCategory

Symbol category entity.

Required Type Field Name Description
required int64 id The unique identifier of the symbol category.
required int64 assetClassId Link to the asset class. One asset class can have many symbol categories.
required string name Category name.


ProtoOADayOfWeek

Name Number Description
NONE 0 No day of the week.
MONDAY 1 Monday.
TUESDAY 2 Tuesday.
WEDNESDAY 3 Wednesday.
THURSDAY 4 Thursday.
FRIDAY 5 Friday.
SATURDAY 6 Saturday.
SUNDAY 7 Sunday.


ProtoOAInterval

Symbol trading session entity.

Required Type Field Name Description
required uint32 startSecond The interval start, specified in seconds starting from Sunday 00:00 in the specified time zone (inclusive to the interval).
required uint32 endSecond The interval end, specified in seconds starting from Sunday 00:00 in the specified time zone (exclusive from the interval).


ProtoOACommissionType

Enum for specifying the type of trading commission.

Name Number Description
USD_PER_MIL_USD 1 USD per million USD volume - usually used for FX. Example: 50 USD for 1 million USD of the trading volume. In cents.
USD_PER_LOT 2 USD per 1 lot - usually used for CFDs and futures for commodities, and indices. Example: 15 USD for 1 contract. In cents.
PERCENTAGE 3 Percentage of trading volume - usually used for Equities. Example: 0.005% of the notional trading volume. Multiplied by 100,00.
QUOTE_CCY_PER_LOT 4 Quote currency of Symbol per 1 lot - will be used for CFDs and futures for commodities, and indices. Example: 15 EUR for 1 contract of DAX. In cents.


ProtoOASymbolDistanceType

Enum for specifying Stop Loss and Take Profit distances.

Name Number Description
SYMBOL_DISTANCE_IN_POINTS 1 The Stop Loss or Take Profit distance in points.
SYMBOL_DISTANCE_IN_PERCENTAGE 2 The Stop Loss or Take Profit distance in percents.


ProtoOAMinCommissionType

Enum for specifying the type of minimum trading commission.

Name Number Description
CURRENCY 1 Base currency.
QUOTE_CURRENCY 2 Quote currency.


ProtoOATradingMode

Enum for specifying symbol trading mode.

Name Number Description
ENABLED 0 Symbol trading mode is enabled.
DISABLED_WITHOUT_PENDINGS_EXECUTION 1 Symbol trading mode is disabled without pending execution.
DISABLED_WITH_PENDINGS_EXECUTION 2 Symbol trading mode is disabled with pending execution.
CLOSE_ONLY_MODE 3 Close only symbol trading mode.


ProtoOASwapCalculationType

Enum for specifying SWAP calculation type for the symbol.

Name Number Description
POINTS 0 Specifies type of SWAP computation as points (0).
INTEREST 1 Specifies type of SWAP computation as interest (1, annual, in percent).


ProtoOAAccessRights

Enum for specifying access rights for a trader.

Name Number Description
FULL_ACCESS 0 Enable all trading.
CLOSE_ONLY 1 Only closing trading requests are enabled.
NO_TRADING 2 View only access.
NO_LOGIN 3 No access.


ProtoOATotalMarginCalculationType

Enum for specifying margin calculation type for an account.

Name Number Description
MAX 0
SUM 1
NET 2


ProtoOAAccountType

Enum for specifying the type of an account.

Name Number Description
HEDGED 0 Allows multiple positions on a trading account for a symbol.
NETTED 1 Only one position per symbol is allowed on a trading account.
SPREAD_BETTING 2 Spread betting type account.


ProtoOATrader

Trading account entity.

Required Type Field Name Description
required int64 ctidTraderAccountId The unique Trader's Account ID used to match the responses to the Trader's Account.
required int64 balance Current account balance in cents (e.g. If USD 100.00 then value = 10000).
optional int64 balanceVersion Balance version used to identify the final balance. Increments each time when the trader's account balance is changed.
optional int64 managerBonus The amount of broker's bonus allocated to the account in cents.
optional int64 ibBonus The amount of introducing broker bonus allocated to the account cents.
optional int64 nonWithdrawableBonus Broker's bonus that cannot be withdrawn from the account as cash.
optional ProtoOAAccessRights accessRights Access rights that an owner has to the account in cTrader platform. See ProtoOAAccessRights for details.
required int64 depositAssetId Deposit currency of the account.
optional bool swapFree If TRUE than account is Shariah-Compliant.
optional uint32 leverageInCents Account leverage (e.g. If leverage = 1:50 then value = 5000).
optional ProtoOATotalMarginCalculationType totalMarginCalculationType Margin computation type for the account (MAX, SUM, NET).
optional uint32 maxLeverage Maximum allowed leverage for the account. Used as validation when a Trader can change leverage value.
optional bool frenchRisk If TRUE then account is AMF compliant.
optional int64 traderLogin ID of the account that is unique per server (Broker).
optional ProtoOAAccountType accountType Account type: HEDGED, NETTED, etc.
optional string brokerName Some white label assigned to trader by broker at the moment of account creation.
optional int64 registrationTimestamp Unix timestamp of the account registration. Should be used as minimal date in historical data requests.


ProtoOAPositionStatus

Position status enum.

Name Number Description
POSITION_STATUS_OPEN 1 The open position.
POSITION_STATUS_CLOSED 2 The closed position.
POSITION_STATUS_CREATED 3 Empty position is created for pending order.
POSITION_STATUS_ERROR 4 Error when opening or closing a position.


ProtoOATradeSide

Trader side enum. Used for order, position, deal.

Name Number Description
BUY 1 Buy.
SELL 2 Sell


ProtoOAOrderType

Order type enum.

Name Number Description
MARKET 1 The Market Order.
LIMIT 2 The Limit Order.
STOP 3 The Stop Order
STOP_LOSS_TAKE_PROFIT 4 The Stop Loss or Take Profit Order.
MARKET_RANGE 5 The market range.
STOP_LIMIT 6 The Stop Limit Order.


ProtoOATimeInForce

The Time-In-Force Orders enum.

Name Number Description
GOOD_TILL_DATE 1 Good-Till-Date - the order automatically expires if not executed at the end of the trading day on a specified date.
GOOD_TILL_CANCEL 2 Good-Til-Canceled - the order will remain active until canceled or filled.
IMMEDIATE_OR_CANCEL 3 Immediate-or-Cancel - the order will be canceled if not filled immediately.
FILL_OR_KILL 4 Fill-or-Kill - the order is canceled if not filled in its entirety.
MARKET_RANGE 5 Market Range orders are executed at any available price within a specified range.


ProtoOAOrderStatus

Order status enum.

Name Number Description
ORDER_STATUS_ACCEPTED 1 Order request validated and accepted for execution.
ORDER_STATUS_FILLED 2 Order is fully filled.
ORDER_STATUS_REJECTED 3 Order is rejected due to validation.
ORDER_STATUS_EXPIRED 4 Order expired. It might be valid for orders with partially filled volumes that were expired on LP.
ORDER_STATUS_CANCELLED 5 Order is canceled. Might be valid for orders with partially filled volume that were canceled by LP.


ProtoOAOrderTriggerMethod

Stop Order and Stop Lost triggering method enum.

Name Number Description
TRADE 1 Stop Order: buy is triggered by ask, sell is triggered by bid; Stop Loss Order: for buy position is triggered by bid, and for sell position by ask.
OPPOSITE 2 Stop Order: buy is triggered by bid, sell is triggered ask; Stop Loss Order: for buy position is triggered by ask, and for sell position by bid.
DOUBLE_TRADE 3 The same as TRADE, but the trigger is checked after the second consecutive tick.
DOUBLE_OPPOSITE 4 The same as OPPOSITE, but the trigger is checked after the second consecutive tick.


ProtoOAPosition

The trading position entity.

Required Type Field Name Description
required uint64 positionId The unique ID of the position. Note that a trader may have two positions with the same IDs if the positions are taken from the different brokers accounts.
required ProtoOATradeData tradeData Position details. See ProtoOATradeData for details.
required ProtoOAPositionStatus positionStatus Current status of the position.
required int64 swap The total amount of charged swap on an open position.
optional double price VWAP price of the position based on all executions (orders) linked to the position.
optional double stopLoss Current Stop Loss price.
optional double takeProfit Current Take Profit price.
optional int64 utcLastUpdateTimestamp The exact UTC time of the last change of the position, including amending Stop Loss or Take Profit of the position, execution of the related order, canceling of the related order, etc.
optional int64 commission Current unrealized commission related to the position.
optional double marginRate The rate for used margin computation. Represented as Base/Deposit.
optional int64 mirroringCommission The amount of unrealized commission for copying the strategy.
optional bool guaranteedStopLoss If TRUE then the position Stop Loss is guaranteedStopLoss.
optional int64 usedMargin The amount of margin used for the position in the deposit currency.
optional ProtoOAOrderTriggerMethod stopLossTriggerMethod The stop trigger method for the Stop Loss and Take Profit of the position.


ProtoOATradeData

The Position and Order trading details entity.

Required Type Field Name Description
required int64 symbolId The unique identifier of the symbol in specific server environment within cTrader platform. Different brokers have different IDs.
required int64 volume Volume in cents.
required ProtoOATradeSide tradeSide Trading direction - Buy or Sell.
optional int64 openTimestamp The exact time when the position was opened or the order was created.
optional string label The text label specified during the order request.
optional bool guaranteedStopLoss If TRUE then the position or order Stop Loss is guaranteedStopLoss.


ProtoOAOrder

Trade order entity.

Required Type Field Name Description
required int64 orderId The unique ID of the order. Note: trader might have two orders with the same ID if orders are taken from the accounts from different brokers.
required ProtoOATradeData tradeData Detailed trader data.
required ProtoOAOrderType orderType The order type.
required ProtoOAOrderStatus orderStatus The order status.
optional int64 expirationTimestamp If the order has time in force GTD then expiration is specified.
optional double executionPrice The price at which the order was executed. For the order with FILLED status.
optional int64 executedVolume The part of the volume that was filled.
optional int64 utcLastUpdateTimestamp The exact UTC time the order was last updated.
optional double baseSlippagePrice Used for the Market Range order with a combination of slippageInPoints to specify the price range where the order can be executed.
optional int64 slippageInPoints Used for the Market Range and the Stop Limit orders to specify the price range where the order can be executed.
optional bool closingOrder If TRUE then the order is closing the part of the whole position. Should have specified positionId.
optional double limitPrice Valid only for the Limit Orders.
optional double stopPrice Valid only for the Stop and the Stop Limit Orders.
optional double stopLoss The absolute Stop Loss price.
optional double takeProfit The absolute Take Profit price.
optional string clientOrderId The optional client order ID. Maximum length - 50 characters.
optional ProtoOATimeInForce timeInForce Order's Time-In-Force. Depends on the order type.
optional int64 positionId The unique ID of the position linked to the order (e.g. closing order, order that increases volume of a specific position, etc.)
optional int64 relativeStopLoss The relative Stop Loss that can be specified instead of the absolute one. Specified in 1/100'000 of a unit of the price. For the Buy: Stop Loss = Entry Price - Relative Stop Loss. For the Sell: Stop Loss = Entry Price + relative Stop Loss.
optional int64 relativeTakeProfit The relative Take Profit that can be specified instead of the absolute one. Specified in 1/100'000 of a unit of the price. For the Buy: Take Profit = Entry Price + relative Take Profit. For the Sell: Take Profit = Entry Price - relative Take Profit.
optional bool isStopOut If TRUE then the order was stopped out from the server side.
optional bool trailingStopLoss If TRUE then the order is a Trailing Stop Loss. Valid for the Stop Loss and Take Profit orders.
optional ProtoOAOrderTriggerMethod stopTriggerMethod Trigger method for the order. Valid only for the Stop and the Stop Limit orders.


ProtoOAExecutionType

The execution event type enum.

Name Number Description
ORDER_ACCEPTED 2 The order has passed validation.
ORDER_FILLED 3 The order is filled.
ORDER_REPLACED 4 A pending order is replaced with a new one.
ORDER_CANCELLED 5 An order is canceled.
ORDER_EXPIRED 6 The order with GTD Time-In-Force is expired.
ORDER_REJECTED 7 The order is rejected due to validations.
ORDER_CANCEL_REJECTED 8 The cancel order request is rejected.
SWAP 9 The type related to SWAP execution events.
DEPOSIT_WITHDRAW 10 The type related to the event of deposit or withdrawal cash flow operation.
ORDER_PARTIAL_FILL 11 The order is partially filled.
BONUS_DEPOSIT_WITHDRAW 12 The type related to the event of bonus deposit or bonus withdrawal.


ProtoOABonusDepositWithdraw

The bonus deposit and withdrawal operation entity.

Required Type Field Name Description
required ProtoOAChangeBalanceType operationType The operation type - deposit or withdrawal.
required int64 bonusHistoryId The unique ID of the bonus deposit or withdrawal operation.
required int64 managerBonus The total amount of the broker's bonus after the operation.
required int64 managerDelta The amount of bonus deposited withdrawn by a manager.
required int64 isBonus The total amount of introducing broker's bonus after the operation.
required int64 isDelta The amount of bonus deposited or withdrawn by an introducing broker.
required int64 changeBonusTimestamp The exact time when the bonus operation was executed.
optional string externalNote The note added to an operation. Visible to a trader.
required int64 introducingBrokerId The unique ID of the introducing broker who deposited or withdrew the bonus.


ProtoOAChangeBonusType

Bonus operation type enum.

Name Number Description
BONUS_DEPOSIT 1 Bonus deposit.
BONUS_WITHDRAW 2 Bonus wisdraw.


ProtoOADepositWithdraw

The account deposit or withdrawal operation entity.

Required Type Field Name Description
required ProtoOAChangeBalanceType operationType The operation type - deposit or withdrawal.
required int64 balanceHistoryId The unique ID of the deposit or withdrawal operation.
required int64 balance The account balance after the operation was executed.
required int64 delta The amount of deposit or withdrawal operation.
required int64 changeBalanceTimestamp The exact time when the deposit or withdrawal operation was executed.
optional string externalNote The custom note added to an operation. Visible to a trader.
required int64 balanceVersion The balance version used to identify the final balance. Increments each time when a trader's account balance is changed.
required int64 equity The total account equity after a balance operation was executed.


ProtoOAChangeBalanceType

The balance operation entity. Covers all cash movement operations related to the account, trading, IB operations, mirroring, etc.

Name Number Description
BALANCE_DEPOSIT 1 Cash deposit.
BALANCE_WITHDRAW 2 Cash withdrawal.
BALANCE_DEPOSIT_STRATEGY_COMMISSION_INNER 1 Received mirroring commission.
BALANCE_WITHDRAW_STRATEGY_COMMISSION_INNER 2 Paid mirroring commission.
BALANCE_DEPOSIT_IB_COMMISSIONS 1 For IB account. Commissions paid by the trader.
BALANCE_WITHDRAW_IB_SHARED_PERCENTAGE 2 For IB account. Withdrawal of commissions shared with the broker.
BALANCE_DEPOSIT_IB_SHARED_PERCENTAGE_FROM_SUB_IB 1 For IB account. Commissions paid by sub-IB accounts.
BALANCE_DEPOSIT_IB_SHARED_PERCENTAGE_FROM_BROKER 2 or IB account. Commissions paid by the broker.
BALANCE_DEPOSIT_REBATE 1 Deposit rebate for trading volume for the period.
BALANCE_WITHDRAW_REBATE 2 Withdrawal of rebate.
BALANCE_DEPOSIT_STRATEGY_COMMISSION_OUTER 1 Mirroring commission deposited.
BALANCE_WITHDRAW_STRATEGY_COMMISSION_OUTER 2 Mirroring commission withdrawn.
BALANCE_WITHDRAW_BONUS_COMPENSATION 1 For IB account. Share commission with the Broker.
BALANCE_WITHDRAW_IB_SHARED_PERCENTAGE_TO_BROKER 2 IB commissions.
BALANCE_DEPOSIT_DIVIDENDS 1 Deposit dividends payments.
BALANCE_WITHDRAW_DIVIDENDS 2 Negative dividend charge for a short position.
BALANCE_WITHDRAW_GSL_CHARGE 1 Charge for guaranteedStopLoss.
BALANCE_WITHDRAW_ROLLOVER 2 Charge of rollover fee for Shariah-Compliant accounts.
BALANCE_DEPOSIT_NONWITHDRAWABLE_BONUS 1 Broker's operation to deposit bonus.
BALANCE_WITHDRAW_NONWITHDRAWABLE_BONUS 2 Broker's operation to withdrawal bonus.
BALANCE_DEPOSIT_SWAP 1 Deposits of negative SWAP.
BALANCE_WITHDRAW_SWAP 2 SWAP charges.
BALANCE_DEPOSIT_MANAGEMENT_FEE 1 Management Fee deposit.
BALANCE_WITHDRAW_MANAGEMENT_FEE 2 Management Fee withdrawal.
BALANCE_DEPOSIT_PERFORMANCE_FEE 1 Performance Fee deposit.
BALANCE_WITHDRAW_INACTIVITY_FEE 2 Withdrawal of inactivity fee from the balance.


ProtoOADeal

The execution entity.

Required Type Field Name Description
required int64 dealId The unique ID of the execution deal.
required int64 orderId Source order of the deal.
required int64 positionId Source position of the deal.
required int64 volume Volume sent for execution, in cents.
required int64 filledVolume Filled volume in cents.
required int64 symbolId The unique identifier of the symbol in the specific server environment within cTrader platform. Different servers have different IDs.
required int64 createTimestamp The exact time when the deal was sent for execution.
required int64 executionTimestamp The exact time when the deal was executed.
optional int64 utcLastUpdateTimestamp The exact time when the deal was created, executed or rejected.
optional double executionPrice The execution price.
required ProtoOATradeSide tradeSide The trading direction - Buy or Sell.
required ProtoOADealStatus dealStatus The current status of the deal.
optional double marginRate The rate for used margin computation. Represented as Base/Deposit.
optional int64 commission The amount of trading commission associated with the deal.
optional double baseToUsdConversionRate Base to the USD conversion rate on the time of the deal execution.
optional ProtoOAClosePositionDetail closePositionDetail Closing position details. Valid only for the closing deal.


ProtoOADealStatus

The current deal status enum..

Name Number Description
FILLED 2 The deal is filled.
PARTIALLY_FILLED 3 The deal is partially filled.
REJECTED 4 The deal is correct but was rejected by the liquidity provider (e.g. no liquidity).
INTERNALLY_REJECTED 5 The deal is rejected by the server (e.g. no price quotes).
ERROR 6 The deal is rejected by LP due to an error (e.g. symbol is unknown).
MISSED 7 The liquidity provider did not send a response on the deal during the specified execution time period.


ProtoOAClosePositionDetail

Trading details for the closing deal.

Required Type Field Name Description
required double entryPrice The position price at the moment of filling the closing order.
required int64 grossProfit The amount of realized gross profit after the closing deal execution.
required int64 swap The amount of realized swap in cents related to the closed volume.
required int64 commission The amount of realized commission in cents related to closed volume.
required int64 balance The account balance after the closing deal execution.
optional double quoteToDepositConversionRate The Quote/Deposit currency conversion rate on the time of closing deal execution.
optional int64 closedVolume The closed volume in cents.
optional int64 alanceVersion The balance version of the account related to the closing deal operation.


ProtoOATrendbarPeriod

Trendbar period enum.

Name Number Description
M1 1 1 minute.
M2 2 2 minutes.
M3 3 3 minutes.
M4 4 4 minutes.
M5 5 5 minutes.
M10 6 10 minutes.
M15 7 15 minutes.
M30 8 30 minutes.
H1 9 1 hour.
H4 10 4 hours.
H12 11 12 hours.
D1 12 1 day.
W1 13 1 week.
MN1 14 1 month.


ProtoOATrendbar

The historical Trendbar entity.

Required Type Field Name Description
required int64 volume The bar volume in ticks.
optional ProtoOATrendbarPeriod period The bar period.
optional int64 low The low price of the bar.
optional uint64 deltaOpen The delta between the open and the low price. Open = Low + Delta Open.
optional uint64 deltaClose The delta between the open and the low price. Close = Low + Delta Close.
optional uint64 deltaHigh The delta between the open and the low price. High = Low + Delta High.
optional uint32 utcTimestampInMinutes The timestamp of the bar. Equals to the timestamp of the open tick.


ProtoOAExpectedMargin

Expected margin computation entity.

Required Type Field Name Description
required int64 volume The volume in cents used for computation of the expected margin.
required int64 buyMargin Buy margin amount in cents.
required int64 sellMargin Sell margin amount in cents.


ProtoOAQuoteType

The price quote type enum.

Name Number Description
BID 1 Bid.
ASK 2 Ask.


ProtoOATickData

The historical tick data type.

Required Type Field Name Description
required int64 timestamp The tick timestamp.
required int64 tick The tick price.


ProtoOAClientPermissionScope

Open API application permission in regards to the token enum.

Name Number Description
SCOPE_VIEW 0 Allows using only view commands. Trade is prohibited.
SCOPE_TRADE 1 Allows using all commands.


ProtoOACtidProfile

Trader profile entity. Empty due to GDPR.

Required Type Field Name Description
required int64 userId The unique user ID.


ProtoOACtidTraderAccount

The trader account entity.

Required Type Field Name Description
required int64 ctidTraderAccountId The unique identifier of the trader's account. Used to match responses to trader's accounts in cTrader platform. Different brokers might have different IDs.
optional bool isLive If TRUE then the account belongs to the live environment and live host must be used to authorize it.
optional int64 traderLogin The trading account number.


ProtoOAAssetClass

The asset class entity.

Required Type Field Name Description
optional int64 id The unique asset ID.
optional string name The asset class name.


ProtoOADepthQuote

The depth of market entity.

Required Type Field Name Description
required uint64 id The quote ID.
required uint64 size The quote size in cents.
required uint64 bid The bid price for bid quotes.
required uint64 ask The ask price for ask quotes.


ProtoOAMarginCall

The margin call entity specifies a threshold for the exact margin call type. Only 3 instances of margin calls are supported, identified by marginCallType. See ProtoOANotificationType for details.

Required Type Field Name Description
required ProtoOANotificationType marginCallType The margin call type.
required double marginLevelThreshold The threshold for the exact margin call type.
optional int64 utcLastUpdateTimestamp The exact time and date the margin call wast last updated.


ProtoOANotificationType

The type of notification enum, currently only 3 types of the margin calls are supported.

Name Number Description
MARGIN_LEVEL_THRESHOLD_1 61 One of three margin calls, they are all similar.
MARGIN_LEVEL_THRESHOLD_2 62 One of three margin calls, they are all similar.
MARGIN_LEVEL_THRESHOLD_3 63 One of three margin calls, they are all similar.


ProtoOAErrorCode

The error code enum.

Authorization

Name Number Description
OA_AUTH_TOKEN_EXPIRED 1 When token used for the account authorization is expired.
ACCOUNT_NOT_AUTHORIZED 2 When the account is not authorized.
ALREADY_LOGGED_IN 14 When a client tries to authorize after it was already authorized.
CH_CLIENT_AUTH_FAILURE 101 Open API client is not activated or client credentials are wrong.
CH_CLIENT_NOT_AUTHENTICATED 102 When a command is sent for an unauthorized Open API client.
CH_CLIENT_ALREADY_AUTHENTICATED 103 Client is trying to authenticate twice.
CH_ACCESS_TOKEN_INVALID 104 The access token is invalid.
CH_SERVER_NOT_REACHABLE 105 Trading service is not available.
CH_CTID_TRADER_ACCOUNT_NOT_FOUND 106 Trading account is not found.
CH_OA_CLIENT_NOT_FOUND 107 Could not find the client ID.


General

Name Number Description
REQUEST_FREQUENCY_EXCEEDED 108 Request frequency is reached.
SERVER_IS_UNDER_MAINTENANCE 109 Server is under maintenance.
CHANNEL_IS_BLOCKED 110 Operations are not allowed for this account.
CONNECTIONS_LIMIT_EXCEEDED 67 Limit of connections is reached for this Open API client.


Pricing

Name Number Description
NOT_SUBSCRIBED_TO_SPOTS 112 When trying to subscribe to depth, trendbars, etc. without spot subscription.
ALREADY_SUBSCRIBED 113 When the subscription is requested.
SYMBOL_NOT_FOUND 114 Symbol not found.
UNKNOWN_SYMBOL 115 Note: to be merged with SYMBOL_NOT_FOUND.
INCORRECT_BOUNDARIES 35 When requested period (from, to) is too large or invalid values are set to from, to.


Trading

Name Number Description
NO_QUOTES 117 Trading cannot be done as no quotes are available. Applicable for Book B.
NOT_ENOUGH_MONEY 118 Not enough funds to allocate margin.
MAX_EXPOSURE_REACHED 119 Max exposure limit is reached for a {trader, symbol, side}.
POSITION_NOT_FOUND 120 Position not found.
ORDER_NOT_FOUND 121 Order not found.
POSITION_NOT_OPEN 122 When trying to close a position that it is not open.
POSITION_LOCKED 123 Position in the state that does not allow to perform an operation.
TOO_MANY_POSITIONS 124 Trading account reached its limit for the max number of open positions and orders.
TRADING_BAD_VOLUME 125 Invalid volume.
TRADING_BAD_STOPS 126 Invalid stop price.
TRADING_BAD_PRICES 127 Invalid price (e.g. negative).
TRADING_BAD_STAKE 128 Invalid stake volume (e.g. negative).
PROTECTION_IS_TOO_CLOSE_TO_MARKET 129 Invalid protection prices.
TRADING_BAD_EXPIRATION_DATE 130 Invalid expiration.
PENDING_EXECUTION 131 Unable to apply changes as the position has an order under execution.
TRADING_DISABLED 132 Trading is blocked for the symbol.
TRADING_NOT_ALLOWED 133 Trading account is in read-only mode.
UNABLE_TO_CANCEL_ORDER 134 Unable to cancel the order.
UNABLE_TO_AMEND_ORDER 135 Unable to amend the order.
SHORT_SELLING_NOT_ALLOWED 136 Short selling is not allowed.