[原文網址](https://connect.spotware.com/docs/open_api_2/protobuf_messages_reference_v2/open_api_messages)
[Open API Messages .proto file](https://github.com/spotware/Open-API-2.0-protobuf-messages/blob/master/OpenApiMessages.proto)
**ProtoOAApplicationAuthReq**
*要求授權應用程序與cTrader平臺代理一起使用。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | string | clientId | The unique Client ID provided during the registration. |
| required | string | clientSecret | The unique Client Secret provided during the registration. |
**ProtoOAApplicationAuthRes**
*對 ProtoOAApplicationAuthReq 請求的響應。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
**ProtoOAAccountAuthReq**
*要求授權交易賬戶會話。 需要與客戶端應用程序建立授權連接。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique identifier of the Trader's Account in cTrader platform. |
| required | string | accessToken | The Access Token issued for providing access to the Trader's Account. |
**ProtoOAAccountAuthRes**
*對ProtoOAAccountAuthReq請求的響應。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique identifier of the Trader's Account in cTrader platform. |
**ProtoOAErrorRes**
*發生錯誤時的通用響應。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| optional | int64 | ctidTraderAccountId | The unique identifier of the Trader's Account in cTrader platform. Used to match responses to the Trader's Accounts. |
| required | string | errorCode | The name of the ProtoErrorCode or the other custom ErrorCodes (e.g. ProtoCHErrorCode). |
| optional | string | description | The error description. |
**ProtoOAClientDisconnectEvent**
*服務器取消與客戶端應用程序的連接時發送的事件。 交易者賬戶的所有會話將被終止。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| optional | string | reason | The disconnection reason explained. For example: The application access was blocked by cTrader Administrator. |
**ProtoOAAccountsTokenInvalidatedEvent**
*服務器取消與特定交易者帳戶的連接時發生的事件。 將保留與其他交易者賬戶的現有聯系。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| repeated | int64 | ctidTraderAccountIds | Unique identifier of the Trader's Account. Used to match Responses to Trader's Accounts. |
| optional | string | reason | The disconnection reason explained. For example: Access Token is expired or recalled. |
**ProtoOAVersionReq**
*代理版本請求。 可用于檢查.proto文件是否過時。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
**ProtoOAVersionRes**
*對ProtoOAVersionReq請求的響應。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | string | version | The current version of the server application. |
**ProtoOANewOrderReq**
*發送新交易訂單的請求。 僅當accessToken字段具有交易賬戶的“交易”權限時才允許。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | A unique identifier of the Trader Account. Used to match responses to the Trader’s Accounts |
| required | int64 | symbolId | The unique identifier of the Symbol in cTrader platform. |
| required | ProtoOAOrderType | orderType | The type of order - MARKET, LIMIT, STOP, MARKET\_RANGE, STOP\_LIMIT. |
| required | ProtoOATradeSide | tradeSide | Trading direction - BUY or SELL. |
| required | int64 | volume | The volume represented in 0.01 of a unit (e.g. US\\$ 10.00 = 1000). |
| optional | double | limitPrice | The limit price, can be specified for the LIMIT order only. |
| optional | double | stopPrice | Stop Price, can be specified for the STOP and the STOP\_LIMIT orders only. |
| optional | ProtoOATimeInForce | timeInForce | The specific order execution or expiration instruction - GOOD\_TILL\_DATE, GOOD\_TILL\_CANCEL, IMMEDIATE\_OR\_CANCEL, FILL\_OR\_KILL, MARKET\_ON\_OPEN. |
| optional | int64 | expirationTimestamp | The exact order expiration time. Should be set for the Good Till Date orders. |
| optional | double | stopLoss | The absolute Stop Loss price (1.23456 for example). Not supported for the MARKER orders. |
| optional | double | takeProfit | The absolute Take Profit price (1.23456 for example). Unsupported for the MARKER orders. |
| optional | string | comment | User-specified comment. MaxLength = 512. |
| optional | double | baseSlippagePrice | Base price to calculate relative slippage price for MARKET\_RANGE order. |
| optional | int32 | slippageInPoints | Slippage distance for MARKET\_RANGE and STOP\_LIMIT order. |
| optional | string | label | User-specified label. MaxLength = 100. |
| optional | int64 | positionId | Reference to the existing position if the Order is intended to modify it. |
| optional | string | clientOrderId | Optional user-specific clientOrderId (similar to FIX ClOrderID). MaxLength=50. |
| optional | int64 | relativeStopLoss | Relative Stop Loss that can be specified instead of the absolute as one. Specified in 1/100'000 of unit of a price. For BUY stopLoss = entryPrice - relativeStopLoss, for SELL stopLoss = entryPrice + relativeStopLoss. |
| optional | int64 | relativeTakeProfit | Relative Take Profit that can be specified instead of the absolute one. Specified in 1/100'000 of unit of a price. For BUY takeProfit = entryPrice + relativeTakeProfit, for SELL takeProfit = entryPrice - relativeTakeProfit. |
| optional | bool | guaranteedStopLoss | If TRUE then stopLoss is guaranteed. Avalible for the French Risk or the Guaranteed Stop Loss Accounts. |
| optional | bool | trailingStopLoss | If TRUE, then the Stop Loss is Trailing. |
| optional | ProtoOAOrderTriggerMethod | stopTriggerMethod | The trigger method for the STOP or the STOP\_LIMIT pending orders. |
**ProtoOAExecutionEvent**
*在成功獲得訂單或服務器執行后發送的事件。 作為對ProtoOANewOrderReq,ProtoOACancelOrderReq,ProtoOAAmendOrderReq,ProtoOAAmendPositionSLTPReq,ProtoOAClosePositionReq請求的響應。 此外,該事件是在存款/借款發生時發送的。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | Unique identifier of the Trader's Account. Used to match Responses to Trader's Accounts. |
| required | ProtoOAExecutionType | executionType | Type of the order operation. For example: ACCEPTED, FILLED, etc. |
| optional | ProtoOAPosition | position | Reference to the position linked with the execution. |
| optional | ProtoOAOrder | order | Reference to the initial order. |
| optional | ProtoOADeal | deal | Reference to the deal (execution). |
| optional | ProtoOABonusDepositWithdraw | bonusDepositWithdraw | Reference to the Bonus Deposit or Withdrawal operation. |
| optional | ProtoOADepositWithdraw | depositWithdraw | Reference to the Deposit or Withdrawal operation. |
| optional | string | errorCode | The name of the ProtoErrorCode or the other custom ErrorCodes (e.g. ProtoCHErrorCode). |
| optional | bool | isServerEvent | If TRUE, then the event is generated as a result of Server logic instead of the Trader's request (e.g. Stop-out). |
**ProtoOACancelOrderReq**
*要求取消現有掛單。 僅當accessToken字段具有交易賬戶的“交易”權限時才允許。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | Unique identifier of the Trader's Account. Used to match Responses to Trader's Accounts. |
| required | int64 | orderId | The unique ID of an order to be canceled. |
**ProtoOAAmendOrderReq**
*要求修改現有掛單。 僅當accessToken具有交易賬戶的“交易”權限時才允許。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| required | int64 | orderId | The ID of the order to amend. |
| optional | int64 | volume | Volume represented in 0.01 of a unit (e.g. cents). |
| optional | double | limitPrice | The Limit Price, can be specified for the LIMIT order only. |
| optional | double | stopPrice | The Stop Price, can be specified for the STOP and the STOP\_LIMIT orders. |
| optional | int64 | expirationTimestamp | The exact Order expiration time. Should be set for the Good Till Date orders. |
| optional | double | stopLoss | The absolute Stop Loss price (1.23456 for example). Not supported for the MARKER orders. |
| optional | double | takeProfit | The absolute Take Profit price (1.23456 for example). Not supported for the MARKER orders. |
| optional | int32 | slippageInPoints | Slippage distance for the MARKET\_RANGE and the STOP\_LIMIT orders. |
| optional | int64 | relativeStopLoss | The relative Stop Loss can be specified instead of the absolute one. Sepcified in 1/100'000 of a unit of price. For BUY stopLoss = entryPrice - relativeStopLoss, for SELL stopLoss = entryPrice + relativeStopLoss. |
| optional | int64 | relativeTakeProfit | The relative Take Profit can be specified instead of the absolute one. Specified in 1/100'000 of a unit of price. For BUY takeProfit = entryPrice + relativeTakeProfit, for SELL takeProfit = entryPrice - relativeTakeProfit. |
| optional | bool | guaranteedStopLoss | If TRUE then the Stop Loss is guaranteed. Available for the French Risk or the Guaranteed Stop Loss Accounts. |
| optional | bool | trailingStopLoss | If TRUE then the Trailing Stop Loss is applied. |
| optional | ProtoOAOrderTriggerMethod | stopTriggerMethod | Trigger method for the STOP or the STOP\_LIMIT pending orders. |
**ProtoOAAmendPositionSLTPReq**
*要求修改現有頭寸的StopLoss和TakeProfit。 僅當accessToken具有交易賬戶的“交易”權限時才允許。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | Unique identifier of the Trader's Account. Used to match Responses to Trader's Accounts. |
| required | int64 | positionId | The unique ID of the position to amend. |
| optional | double | stopLoss | The absolute Stop Loss price (e.g.: 1.23456). |
| optional | double | takeProfit | The absolute Take Profit price (e.g.: 1.26543). |
| optional | bool | guaranteedStopLoss | If TRUE, then the Stop Loss is guaranteed. Available for the French Risk or the Guaranteed Stop Loss Accounts. |
| optional | bool | trailingStopLoss | If TRUE, then the Trailing Stop Loss is applied. |
| optional | ProtoOAOrderTriggerMethod | topLossTriggerMethod | The Stop trigger method for the Stop Loss or the Take Profit orders. |
**ProtoOAClosePositionReq**
*要求關閉現有職位。 僅當accessToken具有交易賬戶的“交易”權限時才允許。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| required | int64 | positionId | The unique ID of the position to close. |
| required | int64 | volume | Volume to close, represented in 0.01 of a unit (e.g. cents). |
**ProtoOATrailingSLChangedEvent**
*由于價格水平變化導致追蹤止損水平發生變化時發生的事件。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | Unique identifier of the Trader's Account. Used to match Responses to Trader's Accounts. |
| required | int64 | positionId | The unique ID of the position to close. |
| required | int64 | orderId | The unique ID of the order. |
| required | double | stopPrice | New value of the Stop Loss price. |
| required | int64 | utcLastUpdateTimestamp | The exact UTC time when the Stop Loss was updated. |
**ProtoOAAssetListReq**
*請求交易者賬戶可用的資產清單。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | Unique identifier of the Trader's Account. Used to match Responses to Trader's Accounts. |
**ProtoOAAssetListRes**
*響應ProtoOAAssetListReq請求。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | Unique identifier of the Trader's Account. Used to match Responses to Trader's Accounts. |
| repeated | ProtoOAAsset | asset | The list of assets. |
**ProtoOASymbolsListReq**
*請求交易者賬戶服務器上可用的符號列表。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | Unique identifier of the Trader's Account. Used to match Responses to Trader's Accounts. |
**ProtoOASymbolsListRes**
*響應ProtoOASymbolsListReq請求。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | Unique identifier of the Trader's Account. Used to match Responses to Trader's Accounts. |
| repeated | ProtoOALightSymbol | symbol | The list of symbols. |
**ProtoOASymbolByIdReq**
*請求獲取完整的Symbol實體。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | Unique identifier of the Trader's Account. Used to match Responses to Trader's Accounts. |
| repeated | int64 | symbolId | Unique identifier of the Symbol in cTrader platform. |
**ProtoOASymbolByIdRes**
*對ProtoOASymbolByIdReq請求的響應。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | Unique identifier of the Trader's Account. Used to match Responses to Trader's Accounts. |
| repeated | ProtoOASymbol | symbol | Symbol entity with the full set of fields. |
**ProtoOASymbolsForConversionReq**
*請求獲取由多個符號組成的兩個資產之間的轉換鏈。 在沒有直接報價的情況下使用。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | Unique identifier of the Trader's Account. Used to match Responses to Trader's Accounts. |
| required | int64 | firstAssetId | The ID of the first asset in the conversation chain. |
| required | int64 | lastAssetId | The ID of the last asset in the conversation chain. |
**ProtoOASymbolsForConversionRes**
*對ProtoOASymbolsForConversionReq請求的響應。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | Unique identifier of the Trader's Account. Used to match Responses to Trader's Accounts. |
| repeated | ProtoOALightSymbol | symbol | Conversion chain of the symbols (e.g. EUR/USD, USD/JPY, GBP/JPY -> EUR/GBP). |
**ProtoOASymbolChangedEvent**
*在服務器端更改符號時發送的事件。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| repeated | int64 | symbolId | A unique identifier of the Symbol in cTrader platform. |
**ProtoOAAssetClassListReq**
*索取交易者賬戶可用的資產類別列表。*
*Request for a list of asset classes available for the trader's account.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | A unique identifier of the Trader's Account. Used to match responses to Trader's Accounts. |
**ProtoOAAssetClassListRes**
*對ProtoOAAssetListReq請求的響應。*
*The response to the ProtoOAAssetListReq request.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| repeated | ProtoOAAssetClass | assetClass | List of the asset classes. |
**ProtoOATraderReq**
*要求獲取交易者賬戶的數據。*
*Request for getting data of Trader's Account.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
**ProtoOATraderRes**
*對ProtoOATraderReq請求的響應。*
*Response to the ProtoOATraderReq request.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| required | ProtoOATrader | trader | The Trader account information. |
**ProtoOATraderUpdatedEvent**
*在服務器端更新交易者時發送的事件。*
*Event that is sent when a Trader is updated on Server side.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| required | ProtoOATrader | trader | The Trader account information. |
**ProtoOAReconcileReq**
*要求獲取交易者當前未平倉頭寸和掛單數據。*
*Request for getting Trader's current open positions and pending orders data.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
**ProtoOAReconcileRes**
*對ProtoOAReconcileReq請求的響應。*
*The response to the ProtoOAReconcileReq request.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| repeated | ProtoOAPosition | position | The list of trader's account open positions. |
| repeated | ProtoOAOrder | order | The list of trader's account pending orders. |
**ProtoOAOrderErrorEvent**
在訂單請求期間發生錯誤時發送的事件。
Event that is sent when errors occur during the order requests.
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| required | string | errorCode | The name of the ProtoErrorCode or the other custom ErrorCodes (e.g. ProtoCHErrorCode). |
| optional | int64 | orderId | The unique ID of the order. |
| optional | int64 | positionId | The unique ID of the position. |
| optional | string | description | The error description. |
**ProtoOADealListReq**
*要求獲得交易者的交易歷史數據(執行細節)。*
*Request for getting Trader's deals historical data (execution details).*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| required | int64 | fromTimestamp | The UNIX time from which the search starts >=0 (1-1-1970). Validation: toTimestamp - fromTimestamp \\<= 604800000 (1 week). |
| required | int64 | toTimestamp | The UNIX time where to stop searching \\<= 2147483646000 (19-1-2038). |
| optional | int32 | maxRows | The maximum number of the deals to return. |
**ProtoOADealListRes**
*對ProtoOADealListRes請求的響應。*
*The response to the ProtoOADealListRes request.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| repeated | ProtoOADeal | deal | The list of the deals. |
| repeated | bool | hasMore | If TRUE then the response will provide more than 10000 deals. |
**ProtoOAExpectedMarginReq**
*要求獲得保證金估算。 可在發送新訂單請求之前使用。*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| required | int64 | symbolId | A unique identifier of the Symbol in cTrader platform. |
| repeated | int64 | volume | Volume represented in 0.01 of a unit (e.g. cents). |
**ProtoOAExpectedMarginRes**
*對ProtoOAExpectedMarginReq請求的響應。*
*The response to the ProtoOAExpectedMarginReq request.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| repeated | ProtoOAExpectedMargin | margin | The buy and sell margin estimate. |
**ProtoOAMarginChangedEvent**
*更改分配給特定職位的保證金時發送的事件。*
*Event that is sent when the margin allocated to a specific position is changed.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| required | uint64 | positionId | The unique ID of the position. |
| required | uint64 | usedMargin | The new value of the margin used. |
**ProtoOACashFlowHistoryListReq**
*要求獲取交易者的存款和取款歷史數據。*
*Request for getting Trader's historical data of deposits and withdrawals.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| required | int64 | fromTimestamp | The exact UNIX time from which the search starts >=0 (1-1-1970). Validation: toTimestamp - fromTimestamp \\<= 604800000 (1 week). |
| required | int64 | toTimestamp | The exact UNIX time where to stop searching \\<= 2147483646000 (19-1-2038). |
**ProtoOACashFlowHistoryListRes**
*對ProtoOACashFlowHistoryListReq請求的響應。*
*Response to the ProtoOACashFlowHistoryListReq request.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| repeated | ProtoOADepositWithdraw | depositWithdraw | The list of deposit and withdrawal operations. |
**ProtoOAGetAccountListByAccessTokenReq**
*要求獲取授權交易者的訪問令牌帳戶列表。*
*Request for getting the list of granted trader's account for the access token.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | string | accessToken | The Access Token issued for providing access to the Trader's Account. |
**ProtoOAGetAccountListByAccessTokenRes**
*對ProtoOAGetAccountListByAccessTokenReq請求的響應。*
*Response to the ProtoOAGetAccountListByAccessTokenReq request.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | string | accessToken | The Access Token issued for providing access to the Trader's Account. |
| optional | ProtoOAClientPermissionScope | permissionScope | The sco0pe of permissions - SCOPE\_VIEW or SCOPE\_TRADE. |
| repeated | ProtoOACtidTraderAccount | ctidTraderAccountIds | The list of the accounts IDs. |
**Quotes**
**ProtoOASubscribeSpotsReq**
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| repeated | int64 | symbolId | The unique identifier of the Symbol in cTrader platform. |
**ProtoOASubscribeSpotsRes**
*Response to the ProtoOASubscribeSpotsReq request.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
**ProtoOAUnsubscribeSpotsReq**
*要求取消訂閱指定符號的現場活動。*
*Request for unsubscribing from the spot events of the specified symbol.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| repeated | int64 | symbolId | The unique identifier of the Symbol in cTrader platform. |
**ProtoOAUnsubscribeSpotsRes**
*Response to the ProtoOASubscribeSpotsRes request.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
**ProtoOASpotEvent**
*在服務器端生成新的spot事件時發送的事件。 需要訂閱現場活動,請參閱ProtoOASubscribeSpotsReq.*
*Event that is sent when a new spot event is generated on the server side. Requires subscription on the spot events, see ProtoOASubscribeSpotsReq.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| required | int64 | symbolId | Unique identifier of the Symbol in cTrader platform. |
| optional | uint64 | bid | Bid price. |
| optional | uint64 | ask | Ask price. |
| repeated | ProtoOATrendbar | trendbar | Returns live trend bar. Requires subscription on the trend bars. |
**ProtoOASubscribeLiveTrendbarReq**
*請求訂閱實時趨勢欄。 需要訂閱現場活動,請參閱ProtoOASubscribeSpotsReq。*
*Request for subscribing for live trend bars. Requires subscription on the spot events, see ProtoOASubscribeSpotsReq.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| required | ProtoOATrendbarPeriod | period | Specifies period of trend bar series (e.g. M1, M10, etc.). |
| repeated | int64 | symbolId | The unique identifier of the Symbol in cTrader platform. |
**ProtoOAUnsubscribeLiveTrendbarReq**
*要求從實時趨勢欄中取消訂閱。*
*Request for unsubscribing from the live trend bars.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| required | ProtoOATrendbarPeriod | period | Specifies period of trend bar series (e.g. M1, M10, etc.). |
| repeated | int64 | symbolId | The unique identifier of the Symbol in cTrader platform. |
**ProtoOAGetTrendbarsReq**
*要求獲取符號的歷史趨勢條。*
*Request for getting historical trend bars for the symbol.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| required | int64 | fromTimestamp | The exact time of starting the search in milliseconds. Must be bigger or equal to zero (1-1-1970). Validation: toTimestamp - fromTimestamp \\<= X, where X depends on series period: M1, M2, M3, M4, M5: 302400000 (5 weeks); M10, M15, M30, H1: 21168000000 (35 weeks), H4, H12, D1: 31622400000 (1 year); W1, MN1: 158112000000 (5 years). |
| required | int64 | toTimestamp | The exact time of finishing the search in milliseconds. Smaller or equal to 2147483646000 (19-1-2038). |
| required | ProtoOATrendbarPeriod | period | Specifies period of trend bar series (e.g. M1, M10, etc.). |
| required | int64 | symbolId | Unique identifier of the Symbol in cTrader platform. |
**ProtoOAGetTrendbarsRes**
*Response to the ProtoOAGetTrendbarsReq request.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| required | ProtoOATrendbarPeriod | period | Specifies period of trend bar series (e.g. M1, M10, etc.). |
| required | int64 | timestamp | Equals to toTimestamp from the request. |
| repeated | int64 | imbolId | Unique identifier of the Symbol in cTrader platform. |
**ProtoOAGetTickDataReq**
*要求獲取符號的歷史刻度數據。*
*Request for getting historical tick data for the symbol.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| required | int64 | symbolId | The unique identifier of the Symbol in cTrader platform. |
| repeated | ProtoOAQuoteType | type | Bid/Ask (1/2). |
| required | int64 | fromTimestamp | The exact time of starting the search in milliseconds. Must be bigger of equal to zero (1-1-1970). Validation: toTimestamp - fromTimestamp \\<= 604800000 (1 week). |
| required | int64 | toTimestamp | The exact time of finishing the search in milliseconds \\<= 2147483646000 (19-1-2038). |
**ProtoOAGetTickDataRes**
*對ProtoOAGetTickDataReq請求的響應。*
*Response to the ProtoOAGetTickDataReq request.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| repeated | ProtoOATickData | tickData | The list of ticks. |
| required | bool | hasMore | If TRUE then the number of records by filter is larger than chunkSize, the response contains the number of records that is equal to chunkSize. |
**End Quotes**
**ProtoOAGetCtidProfileByTokenReq**
*要求獲取交易者個人資料的詳細信息。 受GDRP要求限制。*
*Request for getting details of Trader's profile. Limited due to GDRP requirements.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | string | accessToken | The Access Token issued for providing access to the Trader's Account. |
**ProtoOAGetCtidProfileByTokenRes**
*Response to the ProtoOAGetCtidProfileByTokenReq request.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | ProtoOACtidProfile | profile | Trader's profile. |
**ProtoOADepthEvent**
*市場深度結構發生變化時發送的事件。 需要訂閱符號的市場深度,請參閱ProtoOASubscribeDepthQuotesReq。*
*Event that is sent when the structure of the depth of market is changed. Requires subscription on the depth of markets for the symbol, see ProtoOASubscribeDepthQuotesReq.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| required | int64 | symbolId | The unique identifier of the Symbol in cTrader platform. |
| repeated | ProtoOADepthQuote | newQuotes | The list of changes in the depth of market quotes. |
| repeated | uint64 | deletedQuotes | The list of quotes to delete. |
**ProtoOASubscribeDepthQuotesReq**
*要求訂閱指定符號的市場深度。*
*Request for subscribing on depth of market of the specified symbol.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| required | int64 | symbolId | The unique identifier of the Symbol in cTrader platform. |
**ProtoOASubscribeDepthQuotesRes**
*Response to the ProtoOASubscribeDepthQuotesReq request.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
**ProtoOAUnsubscribeDepthQuotesReq**
*要求取消訂閱指定符號的市場深度。*
*Request for unsubscribing from the depth of market of the specified symbol.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
| required | int64 | symbolId | The unique identifier of the Symbol in cTrader platform. |
**ProtoOAUnsubscribeDepthQuotesRes**
*Response to the ProtoOAUnsubscribeDepthQuotesReq request.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique Trader's Account ID used to match the responses to the Trader's Account. |
**ProtoOAAccountLogoutReq**
*要求注銷交易賬戶并關閉會話。 需要與客戶端應用程序建立授權連接。*
*Request to logout a trading account and close the session. Requires established authorized connection with the client application.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique identifier of the Trader's Account in cTrader platform. |
**ProtoOAAccountLogoutRes**
*Response to the ProtoOATraderLogoutReq request.*
| **Required** | **Type** | **Field Name** | **Description** |
| --- | --- | --- | --- |
| optional | ProtoOAPayloadType | payloadType | |
| required | int64 | ctidTraderAccountId | The unique identifier of the Trader's Account in cTrader platform. |
- 空白目錄
- API Reference 2.0
- Getting Started
- Open Authentication
- Protocol Buffers
- Protobuf Messages Reference
- Open API Messages
- Open API Model Messages
- Open API Error Codes
- Example Projects .NET
- Spotware Proxy Cloud
- Getting Started in C#
- Test Environment
- Playground
- Frequently Asked Questions
- Lesson 1. Your First App
- Lesson 2. Get Trading Data
- Lesson 3. Get Market Data
- Lesson 4. Using Trading API