Public server model
ProtoAccountLifetimeType
Lifetime type of accounts
| Name | Value | Description |
|---|---|---|
| UNLIMITED | 1 | Default type for live accounts and subaccounts, exempt from expiration |
| LIMITED_INACTIVITY | 2 | Accounts that expire based on inactivity |
| LIMITED_CREATION | 3 | Accounts with a predefined lifespan from creation time |
| LIMITED_CREATION_FREE | 4 | Accounts with a predefined lifespan from creation time but are explicitly free for proprietary firms with deposit/withdrawal restrictions (it must be available only for servers with setting.PROP_TRADING != 0 |
ProtoAccountType
Defines the type of trading account which determines how positions are managed
| Name | Value | Description |
|---|---|---|
| HEDGED | 0 | Allows multiple positions on the same instrument in opposite directions (buy and sell) simultaneously |
| NETTED | 1 | Consolidates all positions on the same instrument into a single net position |
| SPREAD_BETTING | 2 | An account enabling speculation on price movements through spreads rather than ownership of underlying assets |
ProtoArchivedSymbol
| Field | Type | Label | Description |
|---|---|---|---|
| symbolId | int64 | Required | The unique identifier of the symbol in the specific server environment within the cTrader platform |
| name | string | Required | Symbol code or ticker symbol used for identification (e.g., "EURUSD", "BTCUSD") |
| utcLastUpdateTimestamp | int64 | Required | UNIX timestamp in milliseconds indicating when the symbol information was last updated |
| description | string | Optional | Human-readable description of the trading instrument |
| digits | int32 | Required | Number of decimal places in the symbol's price representation |
| pipPosition | int32 | Required | Position of the pip digit in the price (e.g., for EURUSD with price 1.12345, pipPosition=4 means the '4' digit) |
| lotSize | int64 | Required | Standard lot size for the instrument, expressed in base units |
| measurementUnits | string | Optional | The unit of measurement for the instrument (e.g., "USD", "Barrels", "Troy Ounces") |
| baseAssetId | int64 | Required | Identifier of the base asset (first currency in a pair or underlying asset) |
| unifiedSymbolId | int32 | Optional | Cross-broker standardized identifier for the same financial instrument |
ProtoBonusDepositWithdraw
| Field | Type | Label | Description |
|---|---|---|---|
| operationType | ProtoChangeBonusType | Required | Whether bonus (credit) was added or removed. |
| bonusHistoryId | int64 | Required | Unique identifier for this bonus history record. |
| changeBonusTimestamp | int64 | Required | When the bonus operation happened, as a Unix timestamp in milliseconds (UTC). |
| externalNote | string | Optional | Note visible to the trader explaining the bonus operation. |
| moneyDigits | uint32 | Optional | Number of decimal places for monetary values. |
ProtoChangeBalanceType
| Name | Value | Description |
|---|---|---|
| BALANCE_DEPOSIT | 0 | Manual deposit operation, or initial deposit operation for demo accounts. Can be initiated via cBroker "Deposit" button, via client application "Deposit" button for demo accounts, via API endpoints |
| BALANCE_WITHDRAW | 1 | Manual withdrawal operation |
| BALANCE_CLOSE_POSITION | 2 | Internal balance update when a position is closed |
| BALANCE_DEPOSIT_STRATEGY_COMMISSION_INNER | 3 | Used for payment of Copy fees to Provider from Follower of the same brokerName |
| BALANCE_WITHDRAW_STRATEGY_COMMISSION_INNER | 4 | Used for withdrawal of performance and management Copy fees from the Follower to the Provider from the same brokerName |
| BALANCE_DEPOSIT_IB_COMMISSIONS | 5 | Direct IB commission paid to IB by Trader. Done with nightly job |
| BALANCE_WITHDRAW_IB_SHARED_PERCENTAGE | 6 | Commission paid by IB to its parent IB or to broker. Done with nightly job |
| BALANCE_DEPOSIT_IB_SHARED_PERCENTAGE_FROM_SUB_IB | 7 | Commission received by parent IB from his sub-ibs. Done with nightly job |
| BALANCE_DEPOSIT_IB_SHARED_PERCENTAGE_FROM_BROKER | 8 | Commission paid by Broker to IB |
| BALANCE_DEPOSIT_REBATE | 9 | Deposit of trading rebate to the trader's account |
| BALANCE_WITHDRAW_REBATE | 10 | Withdrawal of trading rebate from the trader's account |
| BALANCE_DEPOSIT_STRATEGY_COMMISSION_OUTER | 11 | Used for payment of Copy fees to Provider from Follower of another brokerName |
| BALANCE_WITHDRAW_STRATEGY_COMMISSION_OUTER | 12 | Used for withdrawal of performance and management Copy fees from the Follower to the Provider from another brokerName |
| BALANCE_WITHDRAW_BONUS_COMPENSATION | 13 | Withdrawal to compensate for bonus funds |
| BALANCE_WITHDRAW_IB_SHARED_PERCENTAGE_TO_BROKER | 14 | Commission paid by IB to the broker |
| BALANCE_DEPOSIT_DIVIDENDS | 15 | Deposit of dividends to the trader's account |
| BALANCE_WITHDRAW_DIVIDENDS | 16 | Withdrawal of dividends from the trader's account |
| BALANCE_WITHDRAW_GSL_CHARGE | 17 | Withdrawal of guaranteed stop loss charge |
| BALANCE_WITHDRAW_ROLLOVER | 18 | Withdrawal of rollover fee for swap-free accounts |
| BALANCE_DEPOSIT_NONWITHDRAWABLE_BONUS | 19 | Deposit of bonus funds that cannot be withdrawn |
| BALANCE_WITHDRAW_NONWITHDRAWABLE_BONUS | 20 | Withdrawal of non-withdrawable bonus funds |
| BALANCE_DEPOSIT_SWAP | 21 | used only for limited risk accounts. SWAP for ordinary accounts is based on swapCalculationEvents |
| BALANCE_WITHDRAW_SWAP | 22 | used only for limited risk accounts |
| BALANCE_WITHDRAW_INVESTMENT_TO_STRATEGY | 23 | Withdrawal for investment into a copy trading strategy |
| BALANCE_DEPOSIT_FROM_INVESTOR | 24 | Deposit received from an investor into a strategy |
| BALANCE_DEPOSIT_RETURNED_INVESTMENT | 25 | Deposit of returned investment funds from a strategy |
| BALANCE_WITHDRAW_BY_INVESTOR | 26 | Withdrawal by an investor from a strategy |
| BALANCE_DEPOSIT_MANAGEMENT_FEE | 27 | Deposit of management fee to strategy provider |
| BALANCE_WITHDRAW_MANAGEMENT_FEE | 28 | Withdrawal of management fee from investor |
| BALANCE_DEPOSIT_PERFORMANCE_FEE | 29 | Deposit of performance fee to strategy provider |
| BALANCE_WITHDRAW_FOR_SUBACCOUNT | 30 | Withdrawal from main account to fund a subaccount |
| BALANCE_DEPOSIT_TO_SUBACCOUNT | 31 | Deposit to a subaccount from the main account |
| BALANCE_WITHDRAW_FROM_SUBACCOUNT | 32 | Withdrawal from a subaccount |
| BALANCE_DEPOSIT_FROM_SUBACCOUNT | 33 | Deposit from a subaccount to the main account |
| BALANCE_WITHDRAW_COPY_FEE | 34 | Withdrawal of copy trading fee |
| BALANCE_WITHDRAW_INACTIVITY_FEE | 35 | Withdraw of inactivity fee from the balance |
| BALANCE_DEPOSIT_TRANSFER | 36 | Deposit from an internal transfer |
| BALANCE_WITHDRAW_TRANSFER | 37 | Withdrawal for an internal transfer |
| BALANCE_DEPOSIT_CONVERTED_BONUS | 38 | Deposit of bonus funds converted to real balance |
| BALANCE_DEPOSIT_NEGATIVE_BALANCE_PROTECTION | 39 | Deposit to reset negative balance to zero for protected accounts |
| BALANCE_RESERVED1 | 40 | Reserved for future use |
| BALANCE_RESERVED2 | 41 | Reserved for future use |
| BALANCE_RESERVED3 | 42 | Reserved for future use |
ProtoChangeBonusType
| Name | Value | Description |
|---|---|---|
| BONUS_DEPOSIT | 0 | Adding bonus funds to a trader's account |
| BONUS_WITHDRAW | 1 | Removing bonus funds from a trader's account |
ProtoCommissionType
| Name | Value | Description |
|---|---|---|
| USD_PER_MILLION_USD | 1 | USD per million USD volume - usually used for FX. Example: 50 USD for 1 mil USD of trading volume. In 10^8. |
| 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 10^8. |
| PERCENTAGE_OF_VALUE | 3 | Percentage of trading volume - usually used for Equities. Example: 0.005% of notional trading volume. Multiplied by 100000. |
| QUOTE_CCY_PER_LOT | 4 | Quote ccy 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 10^8. |
ProtoDayOfWeek
| Name | Value | Description |
|---|---|---|
| NONE | 0 | No specific day, or day not applicable |
| MONDAY | 1 | First day of the trading week |
| TUESDAY | 2 | Second day of the trading week |
| WEDNESDAY | 3 | Third day of the trading week |
| THURSDAY | 4 | Fourth day of the trading week |
| FRIDAY | 5 | Fifth day of the trading week |
| SATURDAY | 6 | Weekend day, limited trading hours |
| SUNDAY | 7 | Weekend day, market opening preparations |
ProtoDeal
| Field | Type | Label | Description |
|---|---|---|---|
| dealId | int64 | Required | Unique identifier for the deal |
| orderId | int64 | Required | Identifier of the order that generated this deal |
| positionId | int64 | Required | Identifier of the position associated with this deal |
| volume | int64 | Required | Total volume of the deal in cents |
| filledVolume | int64 | Required | Actual volume that was filled in cents |
| symbolId | int64 | Required | Identifier of the trading symbol |
| createTimestamp | int64 | Required | Timestamp when the deal was created |
| executionTimestamp | int64 | Required | Timestamp when the deal was executed |
| executionPrice | double | Optional | Price at which the deal was executed |
| tradeSide | ProtoTradeSide | Required | Buy or sell direction of the deal |
| dealStatus | ProtoDealStatus | Required | Current status of the deal |
| dealType | ProtoDealType | Required | Type of the deal (market or limit) |
| commission | int64 | Optional | Commission charged for the deal in deposit currency cents |
| label | string | Optional | Label field value from corresponding order. Used by cAlgo bots to identify its own orders. max length 100 |
| channel | string | Optional | Channel through which the deal was executed |
| comment | string | Optional | User or system comment attached to the deal |
| baseToUsdConversionRate | double | Optional | Conversion rate from the symbol's base currency to USD at execution time. |
| closePositionDetail | ProtoLightClosePositionDetail | Optional | Present when this deal closed (or partly closed) a position; carries the realized P&L, swap and commission of the close. |
| lotSize | int64 | Optional | Standard lot size for the symbol in cents |
| stake | int64 | Optional | Stake amount for spread betting accounts |
| offsetDeals | RepeatedField<ProtoLightOffsetDeal> | Repeated | List of deals that offset this deal |
| moneyDigits | uint32 | Optional | Number of decimal places for monetary values |
| marginRate | double | Optional | Base to Deposit rate computed before deal is sent for execution |
ProtoDealStatus
| Name | Value | Description |
|---|---|---|
| FILLED | 2 | Order or deal was fully executed at the requested volume |
| PARTIALLY_FILLED | 3 | Order or deal was partially executed with some volume remaining |
| REJECTED | 4 | Order was rejected by the system before execution |
| INTERNALLY_REJECTED | 5 | Order was rejected internally by the broker's system |
| ERROR | 6 | An error occurred during order processing |
| MISSED | 7 | Order was missed or not processed due to market conditions |
ProtoDealType
| Name | Value | Description |
|---|---|---|
| MARKET_DEAL | 1 | Deal executed at current market price |
| LIMIT_DEAL | 2 | Deal executed at a specific price limit set by the trader |
ProtoDepositWithdraw
| Field | Type | Label | Description |
|---|---|---|---|
| operationType | ProtoChangeBalanceType | Required | What kind of balance change this is (deposit, withdrawal, etc.). |
| balanceHistoryId | int64 | Required | Unique identifier for this balance history record. |
| balance | int64 | Required | Resulting account balance after the operation, as an integer in the deposit currency (divide by 10^moneyDigits). |
| delta | int64 | Required | Signed change applied to the balance, as an integer in the deposit currency (divide by 10^moneyDigits). |
| changeBalanceTimestamp | int64 | Required | When the operation happened, as a Unix timestamp in milliseconds (UTC). |
| externalNote | string | Optional | Note visible to the trader explaining the operation. |
| equity | int64 | Optional | Account equity right after the operation, as an integer in the deposit currency (divide by 10^moneyDigits). |
| nonWithdrawableBonus | int64 | Optional | Credit (bonus) available after the operation, as an integer in the deposit currency (divide by 10^moneyDigits). |
| source | string | Optional | Origin of the operation (e.g. system, manual). |
| moneyDigits | uint32 | Optional | Number of decimal places for the monetary fields above. Divide those values by 10^moneyDigits. |
ProtoDepthQuote
| Field | Type | Label | Description |
|---|---|---|---|
| id | uint64 | Optional | Unique identifier for the market depth quote |
| size | uint64 | Required | Size in whole units (e.g. USD 1000.20 will have size = 1_000) |
| bid | uint64 | Optional | Bid price in platform's internal price format |
| ask | uint64 | Optional | Ask price in platform's internal price format |
| fractionalSize | uint32 | Optional | Value of fractional part of volume (size) in cents (e.g. 1000.20 = 20) |
ProtoDynamicLeverage
Dynamic Leverage <https://help.
ctrader.
com/trading-with-ctrader/dynamic-leverage>
| Field | Type | Label | Description |
|---|---|---|---|
| leverageId | int64 | Required | unique identifier returned in ProtoSymbol by ProtoGetSymbolReq |
| name | string | Required | Leverage ratio |
| description | string | Optional | Symbol category or leverage ratio |
| tiers | RepeatedField<ProtoDynamicLeverageTier> | Repeated | Tier of Dynamic Leverage |
| utcLastUpdateTimestamp | int64 | Optional | UNIX timestamp in milliseconds when record was updated |
ProtoDynamicLeverageTier
Dynamic Leverage tier entity
| Field | Type | Label | Description |
|---|---|---|---|
| volume | int64 | Required | Maximum position size in USD for this tier; when position size exceeds this value, the next tier's leverage applies |
| leverage | int32 | Required | Leverage ratio for this tier expressed in hundredths (e.g., 1000 = 1:10, 2000 = 1:20) |
ProtoExecutionType
Execution type ENUM
| Name | Value | Description |
|---|---|---|
| ORDER_ACCEPTED | 2 | Sent when order is accepted by server, and initial validations passed |
| ORDER_FILLED | 3 | Sent when order is filled - could be opening new position, closing existing position, changing volume or direction of the position |
| ORDER_REPLACED | 4 | Sent when existing order was amended - in most cases, due to changes in pending orders (price, side, TIF) |
| ORDER_CANCELLED | 5 | Sent when order is cancelled - in case of incomplete fill, or due to client request for pending orders |
| ORDER_EXPIRED | 6 | Sent when order with ProtoTimeInForce = GOOD_TILL_DATE has expired |
| ORDER_REJECTED | 7 | Sent when order is rejected due to validation failure or market conditions |
| ORDER_CANCEL_REJECTED | 8 | Sent when we can't cancel order (for example, it has already been sent to LP for execution and is currently being processed) |
| SWAP | 9 | Sent when swap is charged or credited |
| DEPOSIT_WITHDRAW | 10 | Sent when funds are deposited to or withdrawn from the account |
| ORDER_PARTIAL_FILL | 11 | Sent when order is partially filled with some volume remaining |
| BONUS_DEPOSIT_WITHDRAW | 12 | Sent when bonus funds are added to or removed from the account |
ProtoFuturesSettings
| Field | Type | Label | Description |
|---|---|---|---|
| datesTimeZone | string | Required | Time zone used for futures dates calculation |
| lastTradeTimestampInMinutes | uint32 | Required | In order to get epoch time in milliseconds should be multiplied by 60000. We do not need millisecond granularity, so decided to optimize a little bit like into ProtoTrendbar |
| expirationTimestampInMinutes | uint32 | Required | In order to get epoch time in milliseconds should be multiplied by 60000. We do not need millisecond granularity, so decided to optimize a little bit like into ProtoTrendbar |
| maintenanceMargin | int64 | Optional | Amount of quote Asset per 1 traded lot. 1 protocol value always equal to 0.00000001. If not NULL, then must be >0 |
ProtoGroup
| Field | Type | Label | Description |
|---|---|---|---|
| swapEnabled | bool | Optional | If TRUE, standard overnight swap charges apply to positions held by this account. |
| marginStopout | double | Optional | Stop-out level, expressed as a fraction of margin (e.g. 0.5 means 50%). When the account's margin level falls to this value, positions start to be closed automatically. Multiply by 100 to show it as a percentage. |
| negativeBalanceProtection | bool | Optional | If TRUE, the account is protected from a negative balance: when it has no open positions and the balance drops below zero, the broker tops it back up to 0. |
| negativeBalanceProtectionLimitUsd | int32 | Optional | Threshold for negative balance protection, in whole USD. If the (negative) balance is below this limit, protection is NOT applied and the balance is not reset to 0. Unset when negativeBalanceProtection is not TRUE. |
ProtoHoliday
| Field | Type | Label | Description |
|---|---|---|---|
| holidayId | int64 | Required | Unique identifier for the holiday entry |
| name | string | Required | Display name of the holiday |
| description | string | Optional | Detailed description of the holiday |
| scheduleTimeZone | string | Required | Time zone for the holiday schedule |
| holidayDate | int64 | Required | EpochMillis / 86400000 (ms * sec * min * hours) |
| isRecurring | bool | Required | If TRUE, the holiday repeats annually |
| startSecond | int32 | Optional | Amount of seconds from 00:00:00 of the holiday day when holiday actually starts |
| endSecond | int32 | Optional | Amount of seconds from 00:00:00 of the holiday day when holiday actually finished |
ProtoInterval
Represents time frame of symbol session
| Field | Type | Label | Description |
|---|---|---|---|
| startSecond | uint32 | Required | Seconds from the beginning of Sunday 00:00:00 |
| endSecond | uint32 | Required | Seconds from the beginning of Sunday 00:00:00 |
| isGlobalSessionStart | bool | Optional | If TRUE then session start is considered as a start of the Global session. Used for MOO desired timestamp validation |
| isGlobalSessionEnd | bool | Optional | If TRUE then session end is considered as end of the Global session. spotEvent.sessionClose,high,low will be generated |
ProtoLightClosePositionDetail
| Field | Type | Label | Description |
|---|---|---|---|
| entryPrice | double | Required | Average entry price of the position that was (partly) closed by this deal. |
| profit | int64 | Required | Gross realized profit of the closed part, as an integer in the deposit currency (divide by 10^moneyDigits). |
| swap | int64 | Required | Realized swap on the closed part, as an integer in the deposit currency (divide by 10^moneyDigits). |
| commission | int64 | Required | Realized trading commission on the closed part, as an integer in the deposit currency (divide by 10^moneyDigits). |
| balance | int64 | Required | Resulting account balance after this closing deal, as an integer in the deposit currency (divide by 10^moneyDigits). |
| quoteToDepositConversionRate | double | Optional | Quote-currency-to-deposit-currency rate used at the moment the closing deal was executed. |
| closedVolume | int64 | Optional | Volume that was closed by this deal, in cents (divide by 100 for lots-equivalent units). |
| closedStake | int64 | Optional | For spread-betting accounts: the stake amount that was closed, in cents. |
| moneyDigits | uint32 | Optional | Number of decimal places for the monetary fields above (profit, swap, commission, balance). Divide those values by 10^moneyDigits. |
| pnlConversionFee | int64 | Optional | Fee charged for converting the deal's profit/loss into the deposit currency, as an integer in the deposit currency (divide by 10^moneyDigits). |
ProtoLightOffsetDeal
| Field | Type | Label | Description |
|---|---|---|---|
| dealId | int64 | Required | Unique identifier for the offset deal |
| filledVolume | int64 | Required | Actual volume filled in this offset deal in cents |
| executionTimestamp | int64 | Required | Timestamp when the offset deal was executed |
| executionPrice | double | Optional | Price at which the offset deal was executed |
| stake | uint64 | Optional | Stake amount for spread betting accounts |
ProtoLightSymbol
| Field | Type | Label | Description |
|---|---|---|---|
| id | int64 | Required | Unique identifier for the trading symbol |
| symbolCategoryId | int64 | Required | Category identifier for grouping related symbols |
| sortingNumber | double | Required | Number used for sorting symbols in lists and displays |
| name | string | Optional | Display name of the symbol (e.g. "EURUSD") |
| description | string | Optional | Human-readable description of the symbol |
| tags | string | Optional | Comma-separated list of tags for categorizing and filtering symbols |
| favorite | bool | Optional | Indicates if the symbol is marked as favorite for the user |
| enabled | bool | Optional | Indicates if trading is enabled for this symbol |
| baseAssetId | int64 | Optional | ID of the base asset (first currency in a pair or the actual asset) |
| quoteAssetId | int64 | Optional | ID of the quote asset (second currency in a pair or the pricing currency) |
| translation | string | Optional | Localized name of the symbol in the user's language |
| unifiedSymbolId | int32 | Optional | Cross-broker identifier for the same instrument |
ProtoLimitedRiskMarginCalculationStrategy
| Name | Value | Description |
|---|---|---|
| ACCORDING_TO_LEVERAGE | 0 | Calculates margin based on account leverage settings only |
| ACCORDING_TO_GSL | 1 | Calculates margin based on Guaranteed Stop Loss level only |
| ACCORDING_TO_GSL_AND_LEVERAGE | 2 | Combines both leverage and Guaranteed Stop Loss for margin calculation |
ProtoLocalization
| Field | Type | Label | Description |
|---|---|---|---|
| locale | string | Required | Language and region code in ISO format |
| title | string | Required | Localized text for the title in the specified locale |
ProtoMinCommissionType
| Name | Value | Description |
|---|---|---|
| CURRENCY | 1 | Uses the account's deposit currency for minimum commission |
| QUOTE_CURRENCY | 2 | Uses the symbol's quote currency for minimum commission |
ProtoOrder
| Field | Type | Label | Description |
|---|---|---|---|
| orderId | int64 | Required | Unique identifier for the order |
| tradeData | ProtoTradeData | Required | Trade data associated with this order |
| orderType | ProtoOrderType | Required | Type of order (market, limit, stop, etc.) |
| orderStatus | ProtoOrderStatus | Required | Current status of the order (created, filled, rejected, etc.) |
| expirationTimestamp | int64 | Optional | Timestamp when the order expires if not executed |
| executionPrice | double | Optional | Price at which an order was executed |
| executedVolume | int64 | Optional | Volume that has been executed from the total order volume |
| stopLoss | double | Optional | Stop loss price attached to the order, if any. |
| takeProfit | double | Optional | Take profit price attached to the order, if any. |
| utcLastUpdateTimestamp | int64 | Optional | Timestamp of the last update to this order |
| method | string | Optional | quickTrade button, Order screen, Chart trading, etc. |
| baseSlippagePrice | double | Optional | Base price used for slippage calculation |
| closingOrder | bool | Optional | If TRUE, this order is closing an existing position |
| limitPrice | double | Optional | Price at which a limit order will be executed |
| stopPrice | double | Optional | Price at which a stop order will be triggered |
| clientOrderId | string | Optional | Optional clientOrderId. Max Length = 50 chars. |
| commission | int64 | Optional | Trading commission charged in deposit currency cents |
| clientToken | string | Optional | Optional clientToken. Max Length = 100 chars. |
| timeInForce | ProtoTimeInForce | Optional | Specifies how long the order remains active |
| positionId | int64 | Optional | ID of the position this order is associated with |
| relativeStopLoss | int64 | Optional | Relative stop loss level in points or percentage |
| relativeTakeProfit | int64 | Optional | Relative take profit level in points or percentage |
| originalClientOrderId | string | Optional | Original client order ID for modified orders |
| checkTolerance | bool | Optional | If TRUE, execution price is checked against tolerance |
| isStopOut | bool | Optional | If TRUE, this order was triggered by a stop out |
| trailingStopLoss | bool | Optional | If TRUE, stop loss adjusts automatically as price moves favorably |
| closeWithPID | int64 | Optional | Position ID to close with this order |
| stopTriggerMethod | ProtoOrderTriggerMethod | Optional | Trigger method for main pending order |
| stopLossTriggerMethod | ProtoOrderTriggerMethod | Optional | Stop trigger method for SL/TP order |
| slippageInPoints | int32 | Optional | Maximum allowed slippage in price points |
| desiredOpenTimestamp | int64 | Optional | Desired timestamp for order opening |
| ocoOrderId | int64 | Optional | ID of related one-cancels-other order |
| moneyDigits | uint32 | Optional | Number of decimal places for monetary values |
ProtoOrderStatus
| Name | Value | Description |
|---|---|---|
| ORDER_STATUS_CREATED | 0 | Order has been created in the system but not yet processed |
| ORDER_STATUS_ACCEPTED | 1 | Order has been accepted by the system and is active |
| ORDER_STATUS_FILLED | 2 | Order has been fully executed |
| ORDER_STATUS_REJECTED | 3 | Order has been rejected by the system |
| ORDER_STATUS_EXPIRED | 4 | Order has reached its expiration time and is no longer active |
| ORDER_STATUS_CANCELLED | 5 | Order has been cancelled by the trader or system |
| ORDER_STATUS_ERROR | 6 | Order has no symbol or any other reason |
| ORDER_STATUS_RESERVED | 7 | Order status reserved for future use |
ProtoOrderTriggerMethod
| Name | Value | Description |
|---|---|---|
| TRADE | 1 | Triggered by a trade price that crosses the trigger level |
| OPPOSITE | 2 | Triggered by a price from the opposite side (bid for buy stop, ask for sell stop) |
| DOUBLE_TRADE | 3 | Requires two consecutive trade prices to cross the trigger level |
| DOUBLE_OPPOSITE | 4 | Requires two consecutive opposite prices to cross the trigger level |
ProtoOrderType
| Name | Value | Description |
|---|---|---|
| MARKET | 1 | Executes immediately at the current market price |
| LIMIT | 2 | Executes at specified price or better |
| STOP | 3 | Becomes market order when price reaches specified level |
| STOP_LOSS_TAKE_PROFIT | 4 | Used to modify or place SL/TP on an existing position |
| MARKET_RANGE | 5 | Market order with allowed price range |
| STOP_LIMIT | 6 | Places a limit order when stop price is reached |
ProtoPosition
| Field | Type | Label | Description |
|---|---|---|---|
| positionId | int64 | Required | Unique identifier for the position |
| tradeData | ProtoTradeData | Required | Trade data associated with this position |
| positionStatus | ProtoPositionStatus | Required | Current status of the position (open, closed, etc.) |
| swap | int64 | Required | Accumulated swap charges/credits in deposit currency cents |
| price | double | Optional | vwap price shown as entry price in cTrader |
| stopLoss | double | Optional | Price level at which position will be closed to limit losses |
| takeProfit | double | Optional | Price level at which position will be closed to secure profits |
| utcLastUpdateTimestamp | int64 | Optional | Timestamp of the last update to this position |
| commission | int64 | Optional | Trading commission charged for this position, as an integer in the deposit currency (divide by 10^moneyDigits). |
| marginRate | double | Optional | Rate used to calculate the margin required for this position. |
| guaranteedStopLoss | bool | Optional | If TRUE, stop loss is guaranteed at exact price level |
| usedMargin | uint64 | Optional | Amount of margin required to maintain this position |
| trailingStopLoss | bool | Optional | If TRUE, stop loss adjusts automatically as price moves favorably |
| stopLossTriggerMethod | ProtoOrderTriggerMethod | Optional | Stop trigger method for SL/TP order |
| moneyDigits | uint32 | Optional | Number of decimal places for monetary values |
| pnlConversionFeeRate | int32 | Optional | Fee rate for converting profit/loss to deposit currency |
ProtoPositionStatus
Describes position status
| Name | Value | Description |
|---|---|---|
| POSITION_STATUS_OPEN | 1 | Position is currently active in the market |
| POSITION_STATUS_CLOSED | 2 | Position has been closed and is no longer active |
| POSITION_STATUS_CREATED | 3 | Position has been created but not yet opened in the market |
| POSITION_STATUS_ERROR | 4 | An error occurred during position processing |
ProtoSwapCalculationType
| Name | Value | Description |
|---|---|---|
| PIPS | 0 | Specifies type of SWAP computation as PIPS (0): swap = (volume * swapInPips) / (10 ^ Symbol.pipPosition) * dayOfWeekMultiplier * quoteToDeposit, round HALF_UP |
| PERCENTAGE | 1 | Specifies type of SWAP computation as PERCENTAGE (1, annual, in percent): swap = (volume * bid * swapInPips / 100 / 365) * dayOfWeekMultiplier * quoteToDeposit, round HALF_UP, for Spread-Betting accounts: swap = stake * swapInPips, round HALF_UP |
| POINTS | 2 | Specifies type of SWAP computation as POINTS (2): swap = (volume * swapInPips) / (10 ^ Symbol.digits) * dayOfWeekMultiplier * quoteToDeposit, round HALF_UP |
ProtoSymbol
| Field | Type | Label | Description |
|---|---|---|---|
| symbolId | int64 | Required | Unique identifier for the trading symbol |
| name | string | Required | Display name of the symbol (e.g., "EURUSD", "GOLD") |
| digits | int32 | Required | Number of decimal places displayed in the symbol's price |
| pipPosition | int32 | Required | Position of the pip decimal place (e.g., 4 for forex meaning 0.0001 is one pip) |
| lpEnabled | bool | Optional | If TRUE, the symbol is enabled and subscribed with the liquidity provider |
| enabled | bool | Optional | If TRUE, the symbol is enabled for trading on the platform |
| swapRollover3Days | ProtoDayOfWeek | Optional | Day of the week when SWAP charge amount will be tripled. Doesn't impact rollover commission |
| swapLong | double | Optional | Swap rate in pips per 100K for long positions held overnight |
| swapShort | double | Optional | Swap rate in pips per 100K for short positions held overnight |
| description | string | Optional | description |
| utcLastUpdateTimestamp | int64 | Optional | Timestamp of the last update to this symbol's settings |
| maxVolume | int64 | Optional | In cents. Maximum allowed volume in cents for an order with a symbol. Excludes closePosition orders |
| minVolume | int64 | Optional | In cents. Minimum allowed volume in cents for an order with a symbol. Excludes closePosition orders |
| schedule | RepeatedField<ProtoInterval> | Repeated | Trading schedule defining when the symbol can be traded |
| sortingNumber | double | Optional | Number used for sorting symbols in lists and displays |
| measurementUnits | string | Optional | OZ (ounces), BBL (barrels), BTU (British thermal units) |
| lotSize | int64 | Optional | Standard lot size in cents for the symbol |
| enableShortSelling | bool | Optional | If TRUE, selling without owning the asset is allowed |
| internalAlias | string | Optional | Symbol alias used for technical purposes |
| symbolCategoryId | int64 | Optional | Identifier for the category to which the symbol belongs (e.g., Forex, Indices, Commodities) |
| favorite | bool | Optional | If TRUE, the symbol is marked as a favorite for the user |
| tolerance | int32 | Optional | Allowed deviation in points from requested price for order execution |
| minStake | int64 | Optional | minimal stake in cents. Minimal - 1 |
| maxStake | int64 | Optional | maximal stake in cents. Default - 10000000 |
| guaranteedStopLoss | bool | Optional | Whether this symbol is allowed to have guaranteed stop loss orders. |
| commissionType | ProtoCommissionType | Optional | |
| slDistance | uint32 | Optional | Minimum distance in points required between current price and stop loss level |
| tpDistance | uint32 | Optional | Minimum distance in points required between current price and take profit level |
| gslDistance | uint32 | Optional | Minimum distance in points required between current price and guaranteed stop loss level |
| gslCharge | int64 | Optional | Fee charged when a guaranteed stop loss is triggered, in deposit currency cents |
| tags | string | Optional | Comma-separated list of tags for categorizing and filtering symbols |
| minCommissionType | ProtoMinCommissionType | Optional | |
| minCommissionAsset | string | Optional | |
| baseAssetId | int64 | Optional | ID of the base asset (first currency in a pair or the actual asset) |
| quoteAssetId | int64 | Optional | ID of the quote asset (second currency in a pair or the pricing currency) |
| stepVolume | int64 | Optional | Minimum volume increment allowed for orders in cents |
| stepStake | int64 | Optional | Minimum stake increment allowed for spread betting orders in cents |
| maxExposure | uint64 | Optional | Maximum allowed exposure in USD cents per combination of symbol and account |
| rolloverCommission | int64 | Optional | Administrative Fee, charged instead of Swaps if the Account is marked as a "Shariah Compliant (Swap Free)". The Administrative Fee is charged daily as USD per current open volume of Position in lots. The Account charged in the Deposit currency. |
| skipRolloverDays | int32 | Optional | defer rolloverCommission by skipRolloverDays, accounts weekends |
| leverageId | int64 | Optional | ID of the dynamic leverage profile applied to this symbol |
| scheduleTimeZone | string | Optional | Time zone used for the symbol's trading schedule |
| gslScheduleId | int64 | Optional | ID of the guaranteed stop loss schedule profile applied to this symbol |
| tradingMode | ProtoTradingMode | Optional | |
| distanceSetIn | ProtoSymbolDistanceType | Optional | |
| translation | RepeatedField<ProtoLocalization> | Repeated | |
| rolloverChargePeriod | int32 | Optional | Payment period of rolloverCommission in days (default = 1). 1 (or 0) means daily payments, 2 each second day. 3x rollover is applied only for daily payments |
| rolloverCommission3Days | ProtoDayOfWeek | Optional | Day of the week (in UTC) when Administrative Fee charge amount will be tripled. Applied only if rollover charge period = 0 or 1 |
| swapCalculationType | ProtoSwapCalculationType | Optional | Specifies type of SWAP computation |
| autochartistAlias | string | Optional | Symbol alias used for Autochartist pattern recognition integration |
| tradingCentralAlias | string | Optional | Symbol alias used for Trading Central analysis integration |
| unifiedSymbolId | int32 | Optional | Cross-broker identifier for the same instrument |
| holiday | RepeatedField<ProtoHoliday> | Repeated | |
| preciseTradingCommissionRate | int64 | Optional | Trading commission rate with higher precision, in platform's internal format |
| preciseMinCommission | int64 | Optional | Minimum commission amount with higher precision, in platform's internal format |
| bbspAlias | string | Optional | Symbol alias used for Bloomberg Best Sell Price integration |
| pnlConversionFeeRate | int32 | Optional | Fee rate applied when converting profit/loss to deposit currency, percentage value where 1 = 0.01% |
| futuresSettings | ProtoFuturesSettings | Optional | |
| swapTime | int32 | Optional | Time of day in seconds from midnight when swap charges are applied |
| swapPeriod | int32 | Optional | Period in days between swap charges (default is 1 for daily charges) |
| skipSWAPPeriods | int32 | Optional | Number of swap periods to skip before first charge |
| chargeSwapAtWeekends | bool | Optional | If TRUE, swap charges are applied on weekends |
| lastManualChartInvalidateTimestamp | int64 | Optional | Timestamp of last manual update of charts |
ProtoSymbolDistanceType
| Name | Value | Description |
|---|---|---|
| SYMBOL_DISTANCE_IN_POINTS | 1 | Distances measured in price points |
| SYMBOL_DISTANCE_IN_PERCENTAGE | 2 | Distances measured as percentage of current price |
ProtoTickbar
| Field | Type | Label | Description |
|---|---|---|---|
| period | ProtoTickbarPeriod | Optional | Tick aggregation period setting, default value handles .Net protobuf generator bug |
| low | uint64 | Required | Lowest price for the tick period in platform's internal price format |
| deltaOpen | uint64 | Required | Delta between open and low price in platform's internal price format |
| deltaClose | uint64 | Optional | Delta between close and low price in platform's internal price format |
| deltaHigh | uint64 | Required | Delta between high and low price in platform's internal price format |
| createTimestamp | uint64 | Required | Creation timestamp in milliseconds since epoch |
| volume | uint32 | Optional | Number of ticks in the bar |
ProtoTickbarPeriod
| Name | Value | Description |
|---|---|---|
| T2 | 2 | Chart based on 2 ticks |
| T3 | 3 | Chart based on 3 ticks |
| T4 | 4 | Chart based on 4 ticks |
| T5 | 5 | Chart based on 5 ticks |
| T6 | 6 | Chart based on 6 ticks |
| T7 | 7 | Chart based on 7 ticks |
| T8 | 8 | Chart based on 8 ticks |
| T9 | 9 | Chart based on 9 ticks |
| T10 | 10 | Chart based on 10 ticks |
| T15 | 15 | Chart based on 15 ticks |
| T20 | 20 | Chart based on 20 ticks |
| T25 | 25 | Chart based on 25 ticks |
| T30 | 30 | Chart based on 30 ticks |
| T40 | 40 | Chart based on 40 ticks |
| T50 | 50 | Chart based on 50 ticks |
| T60 | 60 | Chart based on 60 ticks |
| T80 | 80 | Chart based on 80 ticks |
| T90 | 90 | Chart based on 90 ticks |
| T100 | 100 | Chart based on 100 ticks |
| T150 | 150 | Chart based on 150 ticks |
| T200 | 200 | Chart based on 200 ticks |
| T250 | 250 | Chart based on 250 ticks |
| T300 | 300 | Chart based on 300 ticks |
| T500 | 500 | Chart based on 500 ticks |
| T750 | 750 | Chart based on 750 ticks |
| T1000 | 1000 | Chart based on 1000 ticks |
ProtoTimeframe
| Name | Value | Description |
|---|---|---|
| M1 | 1 | Chart timeframe 1 minute |
| M2 | 2 | Chart timeframe 2 minutes |
| M3 | 3 | Chart timeframe 3 minutes |
| M4 | 4 | Chart timeframe 4 minutes |
| M5 | 5 | Chart timeframe 5 minutes |
| M6 | 6 | Chart timeframe 6 minutes |
| M7 | 7 | Chart timeframe 7 minutes |
| M8 | 8 | Chart timeframe 8 minutes |
| M9 | 9 | Chart timeframe 9 minutes |
| M10 | 10 | Chart timeframe 10 minutes |
| M15 | 11 | Chart timeframe 15 minutes |
| M20 | 12 | Chart timeframe 20 minutes |
| M30 | 13 | Chart timeframe 30 minutes |
| M45 | 14 | Chart timeframe 45 minutes |
| H1 | 15 | Chart timeframe 1 hour |
| H2 | 16 | Chart timeframe 2 hours |
| H3 | 17 | Chart timeframe 3 hours |
| H4 | 18 | Chart timeframe 4 hours |
| H6 | 19 | Chart timeframe 6 hours |
| H8 | 20 | Chart timeframe 8 hours |
| H12 | 21 | Chart timeframe 12 hours |
| D1 | 22 | Chart timeframe 1 day |
| D2 | 23 | Chart timeframe 2 days |
| D3 | 24 | Chart timeframe 3 days |
| W1 | 25 | Chart timeframe 1 week |
| MN1 | 26 | Chart timeframe 1 month |
ProtoTimeInForce
| Name | Value | Description |
|---|---|---|
| GOOD_TILL_DATE | 1 | Order remains active until a specified date and time |
| GOOD_TILL_CANCEL | 2 | Order remains active until explicitly cancelled |
| IMMEDIATE_OR_CANCEL | 3 | Executes immediately, partially or completely, and cancels any unfilled portion |
| FILL_OR_KILL | 4 | Executes immediately and completely or not at all |
| MARKET_ON_OPEN | 5 | Executes at the market's opening price |
ProtoTotalMarginCalculationType
| Name | Value | Description |
|---|---|---|
| MAX | 0 | Takes the maximum margin requirement from all positions |
| SUM | 1 | Adds up the margin requirements from all positions |
| NET | 2 | Calculates margin based on net exposure across all positions |
ProtoTradeData
Represents a trade position related to specific order or position
| Field | Type | Label | Description |
|---|---|---|---|
| symbolId | int64 | Required | The unique identifier of the Symbol in specific server environment within cTrader platform |
| volume | int64 | Required | Volume in cents |
| tradeSide | ProtoTradeSide | Required | Buy, Sell |
| openTimestamp | int64 | Optional | UNIX timestamp in milliseconds when Position was opened or Order was created |
| closeTimestamp | int64 | Optional | UNIX timestamp in milliseconds when Position was closed |
| label | string | Optional | Text label specified during Order request. Used by cAlgo bots to identify its own orders. max length 100 |
| comment | string | Optional | Comment specified during Order request. max length 512 |
| channel | string | Optional | Channel specified during Order request. max length 100. For Open API client has prefix "OpenAPI_" |
| measurementUnits | string | Optional | Measurement units for Symbol |
| lotSize | int64 | Optional | Lot size of the Symbol (in cents) |
| spreadBetting | bool | Optional | TRUE for Spread Betting entities |
| stake | int64 | Optional | Stake for Spread Betting |
| desiredVWAP | double | Optional | Price desired by the client as an execution price. Used if checkTolerance = TRUE and for Book B |
| guaranteedStopLoss | bool | Optional | If TRUE then Position/Order Stop Loss is Guaranteed Stop Loss (GSL). Required for the Limited Risk accounts (ProtoTrader.isLimitedRisk=true). |
ProtoTrader
| Field | Type | Label | Description |
|---|---|---|---|
| balance | int64 | Required | Account balance as an integer in the deposit currency. To get the real amount, divide by 10^moneyDigits (e.g. balance = 105000 with moneyDigits = 2 means 1050.00). The currency code is returned as depositCurrency by getAccountGroupInformation. |
| accountType | ProtoAccountType | Optional | How positions on the same symbol are managed: HEDGED (open opposite long/short positions at the same time), NETTED (all positions on a symbol merge into one), SPREAD_BETTING (trade on price movement via stakes instead of volume). |
| registrationTimestamp | int64 | Optional | When the account was created, as a Unix timestamp in milliseconds (UTC). |
| depositAssetId | int64 | Optional | Numeric ID of the account's deposit currency. The human-readable currency code (e.g. "USD") is returned as depositCurrency by getAccountGroupInformation. |
| swapFree | bool | Optional | If TRUE, the account is swap-free: a fixed administration fee is charged on positions held overnight instead of standard swaps. |
| nonWithdrawableBonus | int64 | Optional | Credit (bonus) available to the account, as an integer in the deposit currency (divide by 10^moneyDigits). It can be used for trading but cannot be withdrawn. |
| leverageInCents | uint32 | Optional | Current account leverage multiplied by 100. Divide by 100 to get the ratio (e.g. 500 means 1:5 leverage). 0 means leverage is not set. |
| totalMarginCalculationType | ProtoTotalMarginCalculationType | Optional | How the account's total margin is calculated across positions on the same symbol: MAX (largest single requirement), SUM (add all requirements), NET (based on net long/short exposure). |
| maxLeverage | uint32 | Optional | Highest leverage the account is allowed to use, multiplied by 100. Divide by 100 to get the ratio (e.g. 3000 means 1:30). |
| isLimitedRisk | bool | Optional | If TRUE, every position on the account must use a Guaranteed Stop Loss (limited-risk account). |
| limitedRiskMarginCalculationStrategy | ProtoLimitedRiskMarginCalculationStrategy | Optional | For limited-risk accounts, how margin is calculated: ACCORDING_TO_LEVERAGE (from leverage only), ACCORDING_TO_GSL (from the Guaranteed Stop Loss distance only), ACCORDING_TO_GSL_AND_LEVERAGE (the larger of the two). |
| moneyDigits | uint32 | Optional | Number of decimal places used by all monetary fields on this account (balance, usedMargin, nonWithdrawableBonus). Divide those integer values by 10^moneyDigits to get the real amount. Typically 2. |
| fairStopOut | bool | Optional | Stop-out behaviour: if TRUE, a position is closed in full when stop out is triggered; if FALSE, only the part needed to restore the margin level is closed (smart, partial stop out). |
| usedMargin | int64 | Optional | Margin currently locked by open positions, as an integer in the deposit currency (divide by 10^moneyDigits). |
| accountLifetimeType | ProtoAccountLifetimeType | Optional | Account expiration policy: UNLIMITED (never expires), LIMITED_INACTIVITY (expires after a period of inactivity), LIMITED_CREATION (expires a fixed time after creation), LIMITED_CREATION_FREE (same as LIMITED_CREATION, for prop-firm accounts with deposit/withdrawal restrictions). |
ProtoTradeSide
| Name | Value | Description |
|---|---|---|
| BUY | 1 | Long position - trader profits when price increases |
| SELL | 2 | Short position - trader profits when price decreases |
ProtoTradingMode
| Name | Value | Description |
|---|---|---|
| ENABLED | 0 | Full Access. The symbol can be freely traded. |
| DISABLED_WITHOUT_PENDINGS_EXECUTION | 1 | Close Only. It is impossible to open new positions for this symbol. Any previously open positions can still be closed. |
| DISABLED_WITH_PENDINGS_EXECUTION | 2 | The symbol cannot be traded but any pending orders will still be executed. |
| CLOSE_ONLY_MODE | 3 | Fully Disallowed. The symbol cannot be traded; pending orders are automatically canceled. |
ProtoTrendbar
| Field | Type | Label | Description |
|---|---|---|---|
| volume | int64 | Required | Bar volume in ticks |
| period | ProtoTrendbarPeriod | Optional | Bar period. Default is set for handling .Net protobuf generator bug |
| low | int64 | Optional | Lowest price for the period. Specified in 1/100000 of unit of a price. 107716 means 1.07716, 47452000 means 474.52. |
| deltaOpen | uint64 | Optional | Delta between open and low price. Open = low + deltaOpen. Specified in 1/100000 of unit of a price. 107716 means 1.07716, 47452000 means 474.52. |
| deltaClose | uint64 | Optional | Delta between close and low price. Close = low + deltaClose. Specified in 1/100000 of unit of a price. 107716 means 1.07716, 47452000 means 474.52. |
| deltaHigh | uint64 | Optional | Delta between high and low price. High = low + deltaHigh. Specified in 1/100000 of unit of a price. 107716 means 1.07716, 47452000 means 474.52. |
| utcTimestampInMinutes | uint32 | Optional | UNIX timestamp of the bar, in minutes. Equal to the timestamp of the opening of the bar (e.g. if first tick for H1 came at 12:24:12, then utcTimestampInMinutes = 12:00:00 for respective date) |
| utcLastUpdateTimestamp | uint64 | Optional | UNIX timestamp of the last update time in milliseconds. Present only in live bars subscription. Absent for historical bars. |
ProtoTrendbarPeriod
| Name | Value | Description |
|---|---|---|
| M1 | 1 | 1 minute chart period |
| M2 | 2 | 2 minute chart period |
| M3 | 3 | 3 minute chart period |
| M4 | 4 | 4 minute chart period |
| M5 | 5 | 5 minute chart period |
| M10 | 6 | 10 minute chart period |
| M15 | 7 | 15 minute chart period |
| M30 | 8 | 30 minute chart period |
| H1 | 9 | 1 hour chart period |
| H4 | 10 | 4 hour chart period |
| H12 | 11 | 12 hour chart period |
| D1 | 12 | 1 day chart period |
| W1 | 13 | 1 week chart period |
| MN1 | 14 | 1 month chart period |
ProtoTrendbarType
| Name | Value | Description |
|---|---|---|
| REGULAR_OHLC | 0 | Regular trend bar type |
| HEIKIN_ASHI | 1 | Heikin-Ashi trend bar type |