Open API Model Messages

Open API Model Messages .proto file

ProtoOAPayloadType

The unique identifier of the request, response, or event command.

Name Number Description
PROTO_OA_APPLICATION_AUTH_REQ 2100 Application authorization request.
PROTO_OA_APPLICATION_AUTH_RES 2101 Application authorization response.
PROTO_OA_ACCOUNT_AUTH_REQ 2102 Account authorization request.
PROTO_OA_ACCOUNT_AUTH_RES 2103 Account authorization response.
PROTO_OA_VERSION_REQ 2104 Application version request.
PROTO_OA_VERSION_RES 2105 Application version response.
PROTO_OA_NEW_ORDER_REQ 2106 New Order request.
PROTO_OA_TRAILING_SL_CHANGED_EVENT 2107 The event for the Trailing Stop Loss change.
PROTO_OA_CANCEL_ORDER_REQ 2108 Cancel order request.
PROTO_OA_AMEND_ORDER_REQ 2109 Amend order request.
PROTO_OA_AMEND_POSITION_SLTP_REQ 2110 Amend position Stop Loss or Take Profit request.
PROTO_OA_CLOSE_POSITION_REQ 2111 Close position request.
PROTO_OA_ASSET_LIST_REQ 2112 Asset list request.
PROTO_OA_ASSET_LIST_RES 2113 Asset list response.
PROTO_OA_SYMBOLS_LIST_REQ 2114 Symbol list request.
PROTO_OA_SYMBOLS_LIST_RES 2115 Symbol list response.
PROTO_OA_SYMBOL_BY_ID_REQ 2116 Symbol ID request.
PROTO_OA_SYMBOL_BY_ID_RES 2117 Symbol ID response.
PROTO_OA_SYMBOLS_FOR_CONVERSION_REQ 2118 Symbols for conversion request.
PROTO_OA_SYMBOLS_FOR_CONVERSION_RES 2119 Symbols for conversion response.
PROTO_OA_SYMBOL_CHANGED_EVENT 2120 The event for the symbol change.
PROTO_OA_TRADER_REQ 2121 The trader request.
PROTO_OA_TRADER_RES 2122 The trader response.
PROTO_OA_TRADER_UPDATE_EVENT 2123 The event for trader update.
PROTO_OA_RECONCILE_REQ 2124 The reconcile request.
PROTO_OA_RECONCILE_RES 2125 The reconcile response.
PROTO_OA_EXECUTION_EVENT 2126 The execution event.
PROTO_OA_SUBSCRIBE_SPOTS_REQ 2127 The request for subscribing for spots.
PROTO_OA_SUBSCRIBE_SPOTS_RES 2128 The response for subscribing for the spots.
PROTO_OA_UNSUBSCRIBE_SPOTS_REQ 2129 The request for unsubscribing for spots.
PROTO_OA_UNSUBSCRIBE_SPOTS_RES 2130 The response for unsubscribing for spots.
PROTO_OA_SPOT_EVENT 2131 The spot event.
PROTO_OA_ORDER_ERROR_EVENT 2132 The order error event.
PROTO_OA_DEAL_LIST_REQ 2133 The deal list request.
PROTO_OA_DEAL_LIST_RES 2134 The deal list response.
PROTO_OA_SUBSCRIBE_LIVE_TRENDBAR_REQ 2135 Subscribe to the live trendbars request.
PROTO_OA_UNSUBSCRIBE_LIVE_TRENDBAR_REQ 2136 Unsubscribe to the live trendbars request.
PROTO_OA_GET_TRENDBARS_REQ 2137 Get trendbars request.
PROTO_OA_GET_TRENDBARS_REQ 2138 Get trendbars response.
PROTO_OA_EXPECTED_MARGIN_REQ 2139 The expected margin request.
PROTO_OA_EXPECTED_MARGIN_RES 2140 The expected margin response.
PROTO_OA_MARGIN_CHANGED_EVENT 2141 The event for the margin change.
PROTO_OA_ERROR_RES 2142 The error response.
PROTO_OA_CASH_FLOW_HISTORY_LIST_REQ 2143 The cash flow history list request.
PROTO_OA_CASH_FLOW_HISTORY_LIST_RES 2144 The cash flow history list response.
PROTO_OA_GET_TICKDATA_REQ 2145 Get tick data request.
PROTO_OA_GET_TICKDATA_RES 2146 Get tick data response.
PROTO_OA_ACCOUNTS_TOKEN_INVALIDATED_EVENT 2147 The event for the account token invalidation.
PROTO_OA_CLIENT_DISCONNECT_EVENT 2148 The event for the client disconnection.
PROTO_OA_GET_ACCOUNTS_BY_ACCESS_TOKEN_REQ 2149 Get accounts by access token request.
PROTO_OA_GET_ACCOUNTS_BY_ACCESS_TOKEN_RES 2150 Get accounts by access token response.
PROTO_OA_GET_CTID_PROFILE_BY_TOKEN_REQ 2151 Get cTID by token request.
PROTO_OA_GET_CTID_PROFILE_BY_TOKEN_RES 2152 Get cTID by token response.
PROTO_OA_ASSET_CLASS_LIST_REQ 2153 Asset class list request.
PROTO_OA_ASSET_CLASS_LIST_RES 2154 Asset class list response.
PROTO_OA_DEPTH_EVENT 2155 The market depth event.
PROTO_OA_SUBSCRIBE_DEPTH_QUOTES_REQ 2156 Subscribe for market depth quotes request.
PROTO_OA_SUBSCRIBE_DEPTH_QUOTES_RES 2157 Subscribe for market depth quotes response.
PROTO_OA_UNSUBSCRIBE_DEPTH_QUOTES_REQ 2158 Unsubscribe for market depth quotes request.
PROTO_OA_UNSUBSCRIBE_DEPTH_QUOTES_RES 2159 Unsubscribe for market depth quotes response.
PROTO_OA_SYMBOL_CATEGORY_REQ 2160 Symbol category request.
PROTO_OA_SYMBOL_CATEGORY_RES 2161 Symbol category response.
PROTO_OA_ACCOUNT_LOGOUT_REQ 2162 Account login request.
PROTO_OA_ACCOUNT_LOGOUT_RES 2163 Account login response.
PROTO_OA_ACCOUNT_DISCONNECT_EVENT 2164 The event for an account disconnection.
PROTO_OA_SUBSCRIBE_LIVE_TRENDBAR_RES 2165 Subscribe for live trendbars response.
PROTO_OA_UNSUBSCRIBE_LIVE_TRENDBAR_RES 2166 Unsubscribe for live trendbars response.
PROTO_OA_MARGIN_CALL_LIST_REQ 2167 Margin call list request.
PROTO_OA_MARGIN_CALL_LIST_RES 2168 Margin call list response.
PROTO_OA_MARGIN_CALL_UPDATE_REQ 2169 Margin call update request.
PROTO_OA_MARGIN_CALL_UPDATE_RES 2170 Margin call update response.
PROTO_OA_MARGIN_CALL_UPDATE_EVENT 2171 The event for the margin call update.
PROTO_OA_MARGIN_CALL_TRIGGER_EVENT 2172 The event for the margin call trigger.
PROTO_OA_REFRESH_TOKEN_REQ 2173 Refresh token request.
PROTO_OA_REFRESH_TOKEN_RES 2174 Refresh token response.


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.
optional int32 digits Precision of the asset.


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 the 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 Step of the volume in cents 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. Deprecated. Use preciseTradingCommissionRate instead.
optional ProtoOACommissionType commissionType The commission type. See ProtoOACommissionType for details.
optional uint32 slDistance The minimum allowed distance between the Stop Loss and the current market price.
optional uint32 tpDistance The minimum allowed distance between the Take Profit and the 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 Minimum commission amount per trade. Deprecated. Use preciseMinCommission instead.
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).
optional int64 lotSize Lot size of the Symbol (in cents).
optional int64 preciseTradingCommissionRate Commission base amount. The total commission depends on commissionType: for non-percentage types, it is multiplied by 10^8.
optional int64 preciseMinCommission The precise minimum commission.
repeated ProtoOAHoliday holiday The list of holidays for this symbol is specified by the broker.


ProtoOALightSymbol

The lightweight symbol entity.

Required Type Field Name Description
required int64 symbolId The unique identifier of the symbol in a specific server environment within the cTrader platform. Different servers have different IDs.
optional string symbolName The 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 The symbol description.


ProtoOAArchivedSymbol

The archived symbol entity.

Required Type Field Name Description
required uint64 symbolId The unique ID of the archived symbol.
required string name The archived symbol name.
required uint64 utcLastUpdateTimestamp The exact time when the symbol was updated.
optional string description The description of the archived symbol.


ProtoOASymbolCategory

The symbol category entity.

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


ProtoOADayOfWeek The day of the week entity.

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.
USD_PER_LOT 2 USD per 1 lot - usually used for CFDs and futures for commodities, and indices. Example: 15 USD for 1 contract.
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.


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 the 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 Total margin requirements per symbol are equal to Max margin requirements from all long and all short positions of the symbol.
SUM 1 Total margin requirements per symbol are equal to the Sum of all margin requirements of all positions of the symbol.
NET 2 Total margin requirements per symbol are equal to the difference between margin requirements of all long and short positions of the symbol.


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.
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 the cTrader platform. See ProtoOAAccessRights for details.
required int64 depositAssetId Deposit currency of the account.
optional bool swapFree If TRUE then the 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 the account is AMF compliant. Deprecated. Use isLimitedRisk and limitedRiskMarginCalculationStrategy.
optional int64 traderLogin ID of the account that is the unique per server (Broker).
optional ProtoOAAccountType accountType Account type: HEDGED, NETTED, etc.
optional string brokerName Some white label assigned to the trader by the broker at the moment of account creation.
optional int64 registrationTimestamp Unix timestamp of the account registration. Should be used as a minimal date in historical data requests.
optional bool isLimitedRisk If TRUE then the account is compliant to use a specific margin calculation strategy.
optional ProtoOALimitedRiskMarginCalculationStrategy limitedRiskMarginCalculationStrategy Special strategy used in margin calculations for this account (if account isLimitedRisk).
optional uint32 moneyDigits Specifies the exponent of the monetary values. E.g., moneyDigits = 8 must be interpreted as business value multiplied by 10^8. Then the real balance would be 10053099944 / 10^8 = 100.53099944. Affects balance, managerBonus, ibBonus, nonWithdrawableBonus.


ProtoOAPositionStatus

The 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 the pending order.
POSITION_STATUS_ERROR 4 Error when opening or closing a position.


ProtoOATradeSide

Trade 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

The order status enum.

Name Number Description
ORDER_STATUS_ACCEPTED 1 Order request validated and accepted for execution.
ORDER_STATUS_FILLED 2 Order is 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 the 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 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 the Guaranteed Stop Loss.
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.
optional uint32 moneyDigits Specifies the exponent of the monetary values. E.g., moneyDigits = 8 must be interpreted as business value multiplied by 10^8. Then the real balance would be 10053099944 / 10^8 = 100.53099944. Affects swap, commission, mirroringCommission, usedMargin.


ProtoOATradeData

The Position and Order trading details entity.

Required Type Field Name Description
required int64 symbolId The unique identifier of the symbol in the specific server environment within the 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 the Guaranteed Stop Loss.
optional string comment User-specified comment.


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 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 the 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.
optional uint32 moneyDigits Specifies the exponent of the monetary values. E.g., moneyDigits = 8 must be interpreted as business value multiplied by 10^8. Then the real balance would be 10053099944 / 10^8 = 100.53099944. Affects managerBonus, managerDelta, ibBonus, ibDelta.


ProtoOAChangeBonusType

Bonus operation type enum.

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


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 that is 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.
optional uint32 moneyDigits Specifies the exponent of the monetary values. E.g., moneyDigits = 8 must be interpreted as business value multiplied by 10^8. Then the real balance would be 10053099944 / 10^8 = 100.53099944. Affects balance, delta, equity.


ProtoOAChangeBalanceType

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

Name Number Description
BALANCE_DEPOSIT 0 Cash deposit.
BALANCE_WITHDRAW 1 Cash withdrawal.
BALANCE_DEPOSIT_STRATEGY_COMMISSION_INNER 3 Received mirroring commission.
BALANCE_WITHDRAW_STRATEGY_COMMISSION_INNER 4 Paid mirroring commission.
BALANCE_DEPOSIT_IB_COMMISSIONS 5 For IB account. Commissions paid by the trader.
BALANCE_WITHDRAW_IB_SHARED_PERCENTAGE 6 For IB account. Withdrawal of commissions shared with the broker.
BALANCE_DEPOSIT_IB_SHARED_PERCENTAGE_FROM_SUB_IB 7 For IB account. Commissions paid by sub-IB accounts.
BALANCE_DEPOSIT_IB_SHARED_PERCENTAGE_FROM_BROKER 8 or IB account. Commissions paid by the broker.
BALANCE_DEPOSIT_REBATE 9 Deposit rebate for trading volume for the period.
BALANCE_WITHDRAW_REBATE 10 Withdrawal of rebate.
BALANCE_DEPOSIT_STRATEGY_COMMISSION_OUTER 11 Mirroring commission deposited.
BALANCE_WITHDRAW_STRATEGY_COMMISSION_OUTER 12 Mirroring commission withdrawn.
BALANCE_WITHDRAW_BONUS_COMPENSATION 13 For IB account. Share commission with the Broker.
BALANCE_WITHDRAW_IB_SHARED_PERCENTAGE_TO_BROKER 14 IB commissions.
BALANCE_DEPOSIT_DIVIDENDS 15 Deposit dividends payments.
BALANCE_WITHDRAW_DIVIDENDS 16 Negative dividend charge for a short position.
BALANCE_WITHDRAW_GSL_CHARGE 17 Charge for the Guaranteed Stop Loss.
BALANCE_WITHDRAW_ROLLOVER 18 Charge of the rollover fee for the Shariah-Compliant accounts.
BALANCE_DEPOSIT_NONWITHDRAWABLE_BONUS 19 Broker's operation to deposit bonus.
BALANCE_WITHDRAW_NONWITHDRAWABLE_BONUS 20 Broker's operation to withdrawal bonus.
BALANCE_DEPOSIT_SWAP 21 Deposits of negative SWAP.
BALANCE_WITHDRAW_SWAP 22 The SWAP charges.
BALANCE_DEPOSIT_MANAGEMENT_FEE 27 Management Fee deposit.
BALANCE_WITHDRAW_MANAGEMENT_FEE 28 Mirroring commission. Deprecated since 7.1 in favor of BALANCE_WITHDRAW_COPY_FEE (34).
BALANCE_DEPOSIT_PERFORMANCE_FEE 29 Performance Fee deposit.
BALANCE_WITHDRAW_FOR_SUBACCOUNT 30 Funds withdrawal to the subaccount.
BALANCE_DEPOSIT_TO_SUBACCOUNT 31 Funds deposit to the subaccount.
BALANCE_WITHDRAW_FROM_SUBACCOUNT 32 Funds withdrawal from the subaccount.
BALANCE_DEPOSIT_FROM_SUBACCOUNT 33 Funds deposit from the subaccount.
BALANCE_WITHDRAW_COPY_FEE 34 Withdrawal fees to Strategy Provider.
BALANCE_WITHDRAW_INACTIVITY_FEE 35 Withdrawal of inactivity fee from the balance.
BALANCE_DEPOSIT_TRANSFER 36 Deposit transfer operation.
BALANCE_WITHDRAW_TRANSFER 37 Withdrawal transfer operation.
BALANCE_DEPOSIT_CONVERTED_BONUS 38 Deposit converted bonus.


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 the 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.
optional uint32 moneyDigits Specifies the exponent of the monetary values. E.g., moneyDigits = 8 must be interpreted as business value multiplied by 10^8. Then the real balance would be 10053099944 / 10^8 = 100.53099944. Affects commission.


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 LP has rejected the deal due to an error (e.g., the symbol is unknown).
MISSED 7 The liquidity provider did not send a response on the deal during the specified execution 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 balanceVersion The balance version of the account related to the closing deal operation.
optional uint32 moneyDigits The money digits.


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.
required int64 sellMargin Sell margin amount.


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 the view commands only. 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 the cTrader platform. Different brokers might have different IDs.
optional bool isLive If TRUE then the account belongs to the live environment and the live host must be used to authorize it.
optional int64 traderLogin The trading account number. Value is displayed in the Client App UI.


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 was 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, threshold 1.
MARGIN_LEVEL_THRESHOLD_2 62 One of three margin calls, threshold 2.
MARGIN_LEVEL_THRESHOLD_3 63 One of three margin calls, threshold 3.


ProtoOAErrorCode

The error code enum.

Authorization Errors

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 Errors

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.
WORSE_GSL_NOT_ALLOWED 68 Not allowed to increase the risk for the Positions with the Guaranteed Stop Loss.
SYMBOL_HAS_HOLIDAY 69 Trading disabled because the symbol has a holiday.


Pricing Errors

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 the requested period (from, to) is too large, or the invalid values are set.


Trading Errors

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 is not open.
POSITION_LOCKED 123 Position in the state that does not allow to operate.
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.


ProtoOALimitedRiskMarginCalculationStrategy

The enum for the strategy Limited Risk Margin calculation.

Name Number Description
ACCORDING_TO_LEVERAGE 0 According to the account leverage.
ACCORDING_TO_GSL 1 According to GSL.
ACCORDING_TO_GSL_AND_LEVERAGE 2 According to GSL and Leverage.


ProtoOAHoliday

The holiday entity.

Required Type Field Name Description
required int64 holidayId The unique ID of the holiday.
required string name Name of the holiday.
optional string description Description of the holiday.
required string scheduleTimeZone Timezone used for the holiday.
required int64 holidayDate The number of days from 01-01-1970. Multiply it by 86400000 to get the UNIX timestamp.
required bool isRecurring If TRUE, then the holiday happens each year.
optional int32 startSecond The number of seconds from 00:00:00 of the holiday day when the holiday starts.
optional int32 startSecond The number of seconds from 00:00:00 of the holiday day when the holiday starts.