cTrader ProtoOANewOrderReq
Sends a new order. The definition allows it only where the access token has trade permission for the account.
Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.
This is a message of the cTrader Open API, not an HTTP endpoint. It has no method and no path: it is sent over an open TCP or WebSocket connection, as Protocol Buffers or as JSON.
This message places a real order when the connection is to the live host. The server answers an accepted or filled order with ProtoOAExecutionEvent, and the definition describes ProtoOAOrderErrorEvent as what is sent when an order request meets an error. No JSON sample is given here. A required field of this message is an enumeration, and Spotware's page on sending and receiving JSON does not say how an enumeration value is written in JSON.
The message
- Name
- ProtoOANewOrderReq
- Direction
- Request, sent by the client
- Payload type
- PROTO_OA_NEW_ORDER_REQ, number 2106. This number is what identifies the message on the wire.
- Answered by
Fields
| Name | Type | Description |
|---|---|---|
| payloadType | ProtoOAPayloadType | Identifies the message. Its default in the definition is PROTO_OA_NEW_ORDER_REQ, which is number 2106. |
| ctidTraderAccountIdrequired | int64 | The account the message is about, by its cTrader account id. Responses and events carry the same id, which is how a program holding several accounts on one connection tells them apart. |
| symbolIdrequired | int64 | The symbol, by its id on the cTrader platform. Ids come from the symbol list. |
| orderTyperequired | ProtoOAOrderType | The kind of order, as a value of ProtoOAOrderType: MARKET, LIMIT, STOP, MARKET_RANGE or STOP_LIMIT. |
| tradeSiderequired | ProtoOATradeSide | The direction, as a value of ProtoOATradeSide: BUY or SELL. |
| volumerequired | int64 | The size. In hundredths of a unit, so 1000 means 10.00 units. |
| limitPrice | double | The limit price. The definition says it can be given for a LIMIT order only. |
| stopPrice | double | The stop price. The definition says it can be given for STOP and STOP_LIMIT orders only. |
| timeInForce | ProtoOATimeInForce | How long the order stands or how it must fill, as a value of ProtoOATimeInForce: GOOD_TILL_DATE, GOOD_TILL_CANCEL, IMMEDIATE_OR_CANCEL, FILL_OR_KILL or MARKET_ON_OPEN. Default: GOOD_TILL_CANCEL. |
| expirationTimestamp | int64 | When the order expires, as Unix time in milliseconds. To be set for good till date orders. |
| stopLoss | double | The stop loss as an absolute price, for example 1.23456. The definition says it is not supported for market orders. |
| takeProfit | double | The take profit as an absolute price, for example 1.23456. The definition says it is not supported for market orders. |
| comment | string | A comment of your own. At most 512 characters. |
| baseSlippagePrice | double | The price that the slippage of a MARKET_RANGE order is measured from. |
| slippageInPoints | int32 | The slippage distance for MARKET_RANGE and STOP_LIMIT orders. |
| label | string | A label of your own. At most 100 characters. |
| positionId | int64 | An existing position, where the order is meant to change it. |
| clientOrderId | string | An id of your own for the order, which the definition likens to ClOrdID in FIX. At most 50 characters. |
| relativeStopLoss | int64 | The stop loss as a distance from the entry price instead of an absolute price, in 1/100000 of a price unit. For a buy it is taken off the entry price, for a sell it is added. |
| relativeTakeProfit | int64 | The take profit as a distance from the entry price instead of an absolute price, in 1/100000 of a price unit. For a buy it is added to the entry price, for a sell it is taken off. |
| guaranteedStopLoss | bool | True makes the stop loss a guaranteed one. The definition says it has to be true for limited risk accounts. |
| trailingStopLoss | bool | True makes the stop loss a trailing one. |
| stopTriggerMethod | ProtoOAOrderTriggerMethod | What triggers a STOP or STOP_LIMIT order, as a value of ProtoOAOrderTriggerMethod. Default: TRADE. |
Limits that apply at cTrader Open API
| Limit | Value | Scope | Source |
|---|---|---|---|
| Requests a second, not historical data | 50 | Per connection, requests that are not for historical data | help.ctrader.comchecked |
| Requests a second, historical data | 5 | Per connection, historical data requests only | help.ctrader.comchecked |