Skip to main content

Module openapi

Module openapi 

Source

Structs§

ProtoErrorRes
Error response that is sent from Open API proxy when error occurs.
ProtoHeartbeatEvent
Event that is sent from Open API proxy and can be used as criteria that connection is healthy when no other messages are sent by cTrader platform. Open API client can send this message when he needs to keep the connection open for a period without other messages longer than 30 seconds.
ProtoMessage
Base message that is used for all messages that are sent to/from Open API proxy of cTrader platform.
ProtoOaAccountAuthReq
Request for authorizing of the trading account session. Requires established authorized connection with the client application using ProtoOAApplicationAuthReq.
ProtoOaAccountAuthRes
Response to the ProtoOAApplicationAuthRes request.
ProtoOaAccountDisconnectEvent
Event that is sent when the established session for an account is dropped on the server side. A new session must be authorized for the account.
ProtoOaAccountLogoutReq
Request for logout of trading account session.
ProtoOaAccountLogoutRes
Response to the ProtoOAAccountLogoutReq request. Actual logout of trading account will be completed on ProtoOAAccountDisconnectEvent.
ProtoOaAccountsTokenInvalidatedEvent
Event that is sent when a session to a specific trader’s account is terminated by the server but the existing connections with the other trader’s accounts are maintained. Reasons to trigger: account was deleted, cTID was deleted, token was refreshed, token was revoked.
ProtoOaAmendOrderReq
Request for amending the existing pending order. Allowed only if the Access Token has “trade” permissions for the trading account.
ProtoOaAmendPositionSltpReq
Request for amending StopLoss and TakeProfit of existing position. Allowed only if the accessToken has “trade” permissions for the trading account.
ProtoOaApplicationAuthReq
Request for the authorizing an application to work with the cTrader platform Proxies.
ProtoOaApplicationAuthRes
Response to the ProtoOAApplicationAuthReq request.
ProtoOaArchivedSymbol
ProtoOaAsset
Asset entity.
ProtoOaAssetClass
Asset class entity.
ProtoOaAssetClassListReq
Request for a list of asset classes available for the trader’s account.
ProtoOaAssetClassListRes
Response to the ProtoOAAssetListReq request.
ProtoOaAssetListReq
Request for the list of assets available for a trader’s account.
ProtoOaAssetListRes
Response to the ProtoOAAssetListReq request.
ProtoOaBonusDepositWithdraw
Bonus deposit/withdrawal entity.
ProtoOaCancelOrderReq
Request for cancelling existing pending order. Allowed only if the accessToken has “trade” permissions for the trading account.
ProtoOaCashFlowHistoryListReq
Request for getting Trader’s historical data of deposits and withdrawals.
ProtoOaCashFlowHistoryListRes
Response to the ProtoOACashFlowHistoryListReq request.
ProtoOaClientDisconnectEvent
Event that is sent when the connection with the client application is cancelled by the server. All the sessions for the traders’ accounts will be terminated.
ProtoOaClosePositionDetail
Trading details for closing deal.
ProtoOaClosePositionReq
Request for closing or partially closing of an existing position. Allowed only if the accessToken has “trade” permissions for the trading account.
ProtoOaCtidProfile
Trader profile entity. Empty due to GDPR.
ProtoOaCtidTraderAccount
Trader account entity.
ProtoOaDeal
Execution entity.
ProtoOaDealListByPositionIdReq
Request for retrieving the deals related to a position.
ProtoOaDealListByPositionIdRes
Response to the ProtoOADealListByPositionIdReq request.
ProtoOaDealListReq
Request for getting Trader’s deals historical data (execution details).
ProtoOaDealListRes
The response to the ProtoOADealListRes request.
ProtoOaDealOffset
Deal details for ProtoOADealOffsetListReq.
ProtoOaDealOffsetListReq
Request for getting sets of Deals that were offset by a specific Deal and that are offsetting the Deal.
ProtoOaDealOffsetListRes
Response for ProtoOADealOffsetListReq.
ProtoOaDepositWithdraw
Account deposit/withdrawal operation entity.
ProtoOaDepthEvent
Event that is sent when the structure of depth of market is changed. Requires subscription on the depth of markets for the symbol, see ProtoOASubscribeDepthQuotesReq.
ProtoOaDepthQuote
Depth of market entity.
ProtoOaDynamicLeverage
ProtoOaDynamicLeverageTier
ProtoOaErrorRes
Generic response when an ERROR occurred.
ProtoOaExecutionEvent
Event that is sent following the successful order acceptance or execution by the server. Acts as response to the ProtoOANewOrderReq, ProtoOACancelOrderReq, ProtoOAAmendOrderReq, ProtoOAAmendPositionSLTPReq, ProtoOAClosePositionReq requests. Also, the event is sent when a Deposit/Withdrawal took place.
ProtoOaExpectedMargin
Expected margin computation entity.
ProtoOaExpectedMarginReq
Request for getting the margin estimate according to leverage profiles. Can be used before sending a new order request. This doesn’t consider ACCORDING_TO_GSL margin calculation type, as this calculation is trivial: usedMargin = (VWAP price of the position - GSL price) * volume * Quote2Deposit.
ProtoOaExpectedMarginRes
The response to the ProtoOAExpectedMarginReq request.
ProtoOaGetAccountListByAccessTokenReq
Request for getting the list of granted trader’s account for the access token.
ProtoOaGetAccountListByAccessTokenRes
Response to the ProtoOAGetAccountListByAccessTokenReq request.
ProtoOaGetCtidProfileByTokenReq
Request for getting details of Trader’s profile. Limited due to GDRP requirements.
ProtoOaGetCtidProfileByTokenRes
Response to the ProtoOAGetCtidProfileByTokenReq request.
ProtoOaGetDynamicLeverageByIdReq
Request for getting a dynamic leverage entity referenced in ProtoOASymbol.leverageId.
ProtoOaGetDynamicLeverageByIdRes
Response to the ProtoOAGetDynamicLeverageByIDReq request.
ProtoOaGetPositionUnrealizedPnLReq
Request for getting trader’s positions’ unrealized PnLs.
ProtoOaGetPositionUnrealizedPnLRes
Response to ProtoOAGetPositionUnrealizedPnLReq request.
ProtoOaGetTickDataReq
Request for getting historical tick data for the symbol.
ProtoOaGetTickDataRes
Response to the ProtoOAGetTickDataReq request.
ProtoOaGetTrendbarsReq
Request for getting historical trend bars for the symbol.
ProtoOaGetTrendbarsRes
Response to the ProtoOAGetTrendbarsReq request.
ProtoOaHoliday
ProtoOaInterval
Symbol trading session entity.
ProtoOaLightSymbol
Lightweight symbol entity.
ProtoOaMarginCall
Margin call entity, specifies threshold for exact margin call type. Only 3 instances of margin calls are supported, identified by marginCallType. See ProtoOANotificationType for details.
ProtoOaMarginCallListReq
Request for a list of existing margin call thresholds configured for a user.
ProtoOaMarginCallListRes
Response with a list of existing user Margin Calls, usually contains 3 items.
ProtoOaMarginCallTriggerEvent
Event that is sent when account margin level reaches target marginLevelThreshold. Event is sent no more than once every 10 minutes to avoid spamming.
ProtoOaMarginCallUpdateEvent
Event that is sent when a Margin Call threshold configuration is updated.
ProtoOaMarginCallUpdateReq
Request to modify marginLevelThreshold of specified marginCallType for ctidTraderAccountId.
ProtoOaMarginCallUpdateRes
If this response received, it means that margin call was successfully updated.
ProtoOaMarginChangedEvent
Event that is sent when the margin allocated to a specific position is changed.
ProtoOaNewOrderReq
Request for sending a new trading order. Allowed only if the accessToken has the “trade” permissions for the trading account.
ProtoOaOrder
Trade order entity.
ProtoOaOrderDetailsReq
Request for getting Order and its related Deals.
ProtoOaOrderDetailsRes
Response to the ProtoOAOrderDetailsReq request.
ProtoOaOrderErrorEvent
Event that is sent when errors occur during the order requests.
ProtoOaOrderListByPositionIdReq
Request for retrieving Orders related to a Position by using Position ID. Filtered by utcLastUpdateTimestamp.
ProtoOaOrderListByPositionIdRes
Response to ProtoOAOrderListByPositionIdReq request.
ProtoOaOrderListReq
Request for getting Trader’s orders filtered by timestamp
ProtoOaOrderListRes
The response to the ProtoOAOrderListReq request.
ProtoOaPosition
Trade position entity.
ProtoOaPositionUnrealizedPnL
ProtoOaReconcileReq
Request for getting Trader’s current open positions and pending orders data.
ProtoOaReconcileRes
The response to the ProtoOAReconcileReq request.
ProtoOaRefreshTokenReq
Request to refresh the access token using refresh token of granted trader’s account.
ProtoOaRefreshTokenRes
Response to the ProtoOARefreshTokenReq request.
ProtoOaSpotEvent
Event that is sent when a new spot event is generated on the server side. Requires subscription on the spot events, see ProtoOASubscribeSpotsReq. First event, received after subscription will contain latest spot prices even if market is closed.
ProtoOaSubscribeDepthQuotesReq
Request for subscribing on depth of market of the specified symbol.
ProtoOaSubscribeDepthQuotesRes
Response to the ProtoOASubscribeDepthQuotesReq request.
ProtoOaSubscribeLiveTrendbarReq
Request for subscribing for live trend bars. Requires subscription on the spot events, see ProtoOASubscribeSpotsReq.
ProtoOaSubscribeLiveTrendbarRes
Response to the ProtoOASubscribeLiveTrendbarReq request.
ProtoOaSubscribeSpotsReq
Request for subscribing on spot events of the specified symbol. After successful subscription you’ll receive technical ProtoOASpotEvent with latest price, after which you’ll start receiving updates on prices via consequent ProtoOASpotEvents.
ProtoOaSubscribeSpotsRes
Response to the ProtoOASubscribeSpotsReq request. Reflects that your request to subscribe for symbol has been added to queue. You’ll receive technical ProtoOASpotEvent with current price shortly after this response.
ProtoOaSymbol
Trading symbol entity.
ProtoOaSymbolByIdReq
Request for getting a full symbol entity.
ProtoOaSymbolByIdRes
Response to the ProtoOASymbolByIdReq request.
ProtoOaSymbolCategory
Symbol category entity.
ProtoOaSymbolCategoryListReq
Request for a list of symbol categories available for a trading account.
ProtoOaSymbolCategoryListRes
Response to the ProtoSymbolCategoryListReq request.
ProtoOaSymbolChangedEvent
Event that is sent when the symbol is changed on the Server side.
ProtoOaSymbolsForConversionReq
Request for getting a conversion chain between two assets that consists of several symbols. Use when no direct quote is available.
ProtoOaSymbolsForConversionRes
Response to the ProtoOASymbolsForConversionReq request.
ProtoOaSymbolsListReq
Request for a list of symbols available for a trading account. Symbol entries are returned with the limited set of fields.
ProtoOaSymbolsListRes
Response to the ProtoOASymbolsListReq request.
ProtoOaTickData
Historical tick data type.
ProtoOaTradeData
Position/order trading details entity.
ProtoOaTrader
Trading account entity.
ProtoOaTraderReq
Request for getting data of Trader’s Account.
ProtoOaTraderRes
Response to the ProtoOATraderReq request.
ProtoOaTraderUpdatedEvent
Event that is sent when a Trader is updated on Server side.
ProtoOaTrailingSlChangedEvent
Event that is sent when the level of the Trailing Stop Loss is changed due to the price level changes.
ProtoOaTrendbar
Historical Trendbar entity.
ProtoOaUnsubscribeDepthQuotesReq
Request for unsubscribing from the depth of market of the specified symbol.
ProtoOaUnsubscribeDepthQuotesRes
Response to the ProtoOAUnsubscribeDepthQuotesReq request.
ProtoOaUnsubscribeLiveTrendbarReq
Request for unsubscribing from the live trend bars.
ProtoOaUnsubscribeLiveTrendbarRes
Response to the ProtoOASubscribeLiveTrendbarReq request.
ProtoOaUnsubscribeSpotsReq
Request for unsubscribing from the spot events of the specified symbol. Request to stop receiving ProtoOASpotEvents related to particular symbols. Unsubscription is useful to minimize traffic, especially during high volatility events.
ProtoOaUnsubscribeSpotsRes
Response to the ProtoOASubscribeSpotsRes request. Reflects that your request to unsubscribe will has been added to queue and will be completed shortly. You may still occasionally receive ProtoOASpotEvents until request processing is complete.
ProtoOaVersionReq
Request for getting the proxy version. Can be used to check the current version of the Open API scheme.
ProtoOaVersionRes
Response to the ProtoOAVersionReq request.

Enums§

ProtoErrorCode
COMMON error codes 1 - 99
ProtoOaAccessRights
Enum for specifying access right for a trader.
ProtoOaAccountType
Enum for specifying type of an account.
ProtoOaChangeBalanceType
Balance operation entity. Covers all cash movement operations related to account, trading, IB operations, mirroring, etc.
ProtoOaChangeBonusType
Bonus operation type ENUM.
ProtoOaClientPermissionScope
Open API application permission in regards to token ENUM.
ProtoOaCommissionType
Enum for specifying type of trading commission.
ProtoOaDayOfWeek
ProtoOaDealStatus
Deal status ENUM.
ProtoOaErrorCode
Error code ENUM.
ProtoOaExecutionType
Execution event type ENUM.
ProtoOaLimitedRiskMarginCalculationStrategy
ProtoOaMinCommissionType
Enum for specifying type of minimum trading commission.
ProtoOaNotificationType
Type of notification, currently only 3 instances of marginCall are supported.
ProtoOaOrderStatus
Order status ENUM.
ProtoOaOrderTriggerMethod
Stop Order and Stop Loss triggering method ENUM.
ProtoOaOrderType
Order type ENUM.
ProtoOaPayloadType
ProtoOaPositionStatus
Position status ENUM.
ProtoOaQuoteType
Price quote type.
ProtoOaStopOutStrategy
The strategy for choosing which Position to close during a Stop Out
ProtoOaSwapCalculationType
Enum for specifying SWAP calculation type for symbol.
ProtoOaSymbolDistanceType
Enum for specifying stop loss and take profit distances.
ProtoOaTimeInForce
Order’s time in force ENUM.
ProtoOaTotalMarginCalculationType
Enum for specifying margin calculation type for an account.
ProtoOaTradeSide
Trader side ENUM. Used for order, position, deal.
ProtoOaTradingMode
Enum for specifying symbol trading mode.
ProtoOaTrendbarPeriod
Trendbar period ENUM.
ProtoPayloadType
— INTENSIVE COMMANDS 1 - 49 — COMMON API 50 - 69