OrderNew
Enter a new Order into the system.
- Section: Transactions
- Related Message: OrderNewReply
Metadata
- Message Type: TransactionMessage
- Message Number: 1001
Inherited fields
| Name | Type | Size (bytes) | Description |
|---|---|---|---|
| MessageType | Integer (unsigned) | 2 | The unique identifier of this message. |
| ClientId | Integer (unsigned) | 4 | The unique identifier of a session with the server, returned in a successful LoginReply message. |
| RequestId | Integer (unsigned) | 4 | Within each session each message must be uniquely identified by this field. It must be monotonically increasing for the duration of the session. |
Fields
| Name | Type | Size (bytes) | Description |
|---|---|---|---|
| ClOrdID | String | 60 | Client OrderId for FIX Orders. |
| InstrumentMarket | Foreign key to InstrumentMarket | 8 | The Id of the InstrumentMarket for which the Order is being entered. |
| User | Foreign key to User | 8 | If the Order is being entered on behalf of another User, this is the Id for that User. Otherwise set to 0. |
| Side | One of OrderSide | 1 | Whether this is a Buy (0) or a Sell (1). |
| Type | Set of OrderType | 4 | |
| Price | Integer (signed) | 8 | The price for the Order. It is entered as an integer with the decimal places implied. The number of decimals is given by the PriceDecimals of the InstrumentMarket for the Order. |
| TotalQuantity | Integer (signed) | 8 | The total quantity for the Order. This is the absolute size of the Order inclusive of any hidden quantity. It is entered as an integer with the decimal places implied. The number of decimals is given by the QuantityDecimals of the InstrumentMarket for the Order. |
| HiddenQuantity | Integer (signed) | 8 | The hidden quantity for the Order. This is the part of the total quantity that is initially hidden from the market. The number of decimals is given by the QuantityDecimals of the InstrumentMarket for the Order. |
| Account | Foreign key to Account | 8 | The Account for an Order is optional and may be specified either as an Id if Accounts are being maintained in the Matching Engine (using this field) or as a text code. This field is used if Account is specified as an Id, or set to 0 if not used. |
| AccountCode | String | 40 | The Account for an Order may be specified as a plain-text code using this field. If the field Account is non-zero then AccountCode will be ignored. |
| Tag | String | 50 | If the Instrument for which the Order is being entered is a Tagged Instrument, Tag is the plain-text code that uniquely identifies the specific instance of the Instrument to be bought or sold. |
| SettlementClass | Foreign key to SettlementClass | 8 | For a multi-class Order, this is the Settlement Class for the Order. |
| SecurityLotLabel | String | 20 | For a multi-class sell Order, this is the security label for the Order. |
| SecurityLotId | Integer (unsigned) | 8 | For a multi-class sell Order, this is the security id for the Order. |
| Priority | Integer (unsigned) | 2 | For a multi-class sell Order, this is the settlement priority for the Order. |
| ExpiryDate | Integer (signed) | 4 | The expiry date of the Order as an integer in the form YYYYMMDD. If there is no expiry date for the Order (for a Session, Day or Good Till Time Order), set to 0.Only applies to Good Till Date orders. |
| ExpiryTime | Integer (signed) | 4 | The expiry time of the Order as an integer in the form HHMMSS. Expiry time is always relative to the current trading day. If there is no expiry time for the Order, set to 0.Only applies to Good Till Time orders. |
| LiveFor | Integer (unsigned) | 4 | If non-zero may be a number of seconds for which the order will remain live, must be less than number of seconds left in trading day. |
| PegRef | One of PegRef | 1 | The reference for a peg order. Can be Bid, Mid or Ask |
| PegOffset | Integer (signed) | 8 | Price offset from the peg reference |
| MinimumFill | Integer (signed) | 8 | Minimum Fill Quantity for this order. Can fill with multiple smaller orders. |
| TestOnly | Integer (unsigned) | 1 | If set, validates the order and returns error OrderTestOnly if OK. |
Permissions
Submit New Order
{
instrumentmarket: "test-im",
side: OrderSide.Buy,
type: OrderType.Limit + OrderType.GoodtillCancelled,
price: 100,
totalquantity: 1,
}
Permission Checks
| PermissionAction | Table | Scope | Index |
|---|---|---|---|
| View | InstrumentMarket | Instance | 0 |
| View | Market | Instance | 0 |
| Enter | InstrumentMarket | Instance | 0 |
| View | Market | Instance | 0 |
| AllowBuyOrSell | Market | Instance | 0 |
Test file: OrderNew
Submit New Order on Behalf of another User
{
instrumentmarket: "test-im",
side: OrderSide.Buy,
type: OrderType.Limit + OrderType.GoodtillCancelled,
price: 100,
totalquantity: 1,
onbehalfof_user: "test-user",
}
Permission Checks
| PermissionAction | Table | Scope | Index |
|---|---|---|---|
| EnterOnBehalfOf | User | Instance | 2 |
| View | InstrumentMarket | Instance | 0 |
| View | Market | Instance | 0 |
| Enter | InstrumentMarket | Instance | 0 |
| View | Market | Instance | 0 |
| AllowBuyOrSell | Market | Instance | 0 |
Test file: OrderNew_onBehalf