Message: Order

File: WebAPI/order_2.proto

Description

Trade routing order. It is used as a new order request and as a part of order status updates.

Used in

CompoundOrderEntry, NewOrder, OrderStatus

Fields

account_id

Type: sint32

Description: ID of an account that is/ was used to place an order.

Source: trading_account_2.Account.account_id.

when_utc_time (deprecated)

Type: sint64

Description: Client side time when an order was submitted (UTC). Note: Use when_utc_timestamp field instead.

when_utc_timestamp

Type: google.protobuf.Timestamp

Description: Client side time when an order was submitted (UTC). If specified by the user, it’s used instead of when_utc_time field (at least one of these fields has to be specified).

contract_id

Type: uint32

Description: Server side contract ID of the order.

Source: metadata_2.ContractMetadata.contract_id.

cl_order_id

Type: string

Description: Client order identifier. It must be unique within a single trading day for day orders and across days for multi-day orders. Maximum allowed length is 64 bytes. In OrderStatus messages it contains cl_order_id of the last accepted order request in the order chain, which may be a cancel request.

order_type

Type: uint32

Description: Order type. This field is associated with OrderType enum type.

exec_instructions

Type: uint32

Description: List of applicable execution instructions. This field is associated with ExecInstruction enum type.

duration

Type: uint32

Description: Order duration. This field is associated with Duration enum type.

good_thru_date

Type: sint64

Description: Date for GTD (local to exchange, date only value in time format) when the order should expire.

side

Type: uint32

Description: Order side. This field is associated with Side enum type. This field is required for all order types except for ORDER_TYPE_CROSS. For orders with ORDER_TYPE_CROSS order type this field is not relevant and ignored. See CrossOrderParameters.side_allocation field instead.

scaled_limit_price

Type: sint64

Description: Limit price of the order (required for Limit and Stop-limit orders).

scaled_stop_price

Type: sint64

Description: Stop price of the order (required for Stop and Stop-limit orders).

uint32_qty (deprecated)

Type: uint32

Description: Note: Use qty field instead.

uint32_visible_qty (deprecated)

Type: uint32

Description: Note: Use visible_qty field instead.

uint32_min_visible_qty (deprecated)

Type: uint32

Description: Note: Use min_visible_qty field instead.

qty

Type: cqg.Decimal

Description: Total positive size of the order.

visible_qty

Type: cqg.Decimal

Description: Visible size of the order for Icebergs.

min_visible_qty

Type: cqg.Decimal

Description: Minimum visible positive size of the order used for iceberg orders with ‘random visible size’, must be < visible_qty.

is_manual (deprecated)

Type: bool

Description: True if this is a manual order (order placed by the user direct action), automated otherwise. Deprecated, use OrderRequest.is_automated to set a request source, or TransactionStatus.is_automated to read the value for an order.

is_close (deprecated)

Type: bool

Description: True if the order is used for closing/ reducing a position, opening/ increasing otherwise (omit this field if there is no need to be explicit). Deprecated, refer to open_close_instruction.

is_aggressive

Type: bool

Description: True if the order is aggressive (Fixed Income specific order modifier).

scaled_trail_offset

Type: sint64

Description: Maximum offset between market and limit prices or market and stop prices for trail orders.

trailing_peg

Type: uint32

Description: Trailing peg to follow specific side of the market (for limit orders only). This field is associated with TrailingPeg enum type. Note: Order request is rejected if this field is set for stop or stop-limit order.

uint32_trigger_qty (deprecated)

Type: uint32

Description: Note: Use trigger_qty instead.

trigger_qty

Type: cqg.Decimal

Description: Trigger quantity (threshold) as additional stop order activation condition.

activation_utc_time (deprecated)

Type: sint64

Description: Time when the order should be submitted to the execution system as assigned by client (UTC). Note: Use activation_utc_timestamp field instead.

activation_utc_timestamp

Type: google.protobuf.Timestamp

Description: Time when the order should be submitted to the execution system as assigned by client (UTC). If specified by the user, it’s used instead of activation_utc_time field.

suspension_utc_time (deprecated)

Type: sint64

Description: Time when the order should be suspended (parked) (UTC). Note: Use suspension_utc_timestamp field instead.

suspension_utc_timestamp

Type: google.protobuf.Timestamp

Description: Time when the the order should be suspended (parked) (UTC). If specified by the user, it’s used instead of suspension_utc_time field.

user_attributes

Type: user_attribute_2.UserAttribute

Description: User specific attributes. Only printable ASCII characters are allowed in “name” and “value” fields including 0-9A-Za-z, punctuation. (ASCII character set used by the “C” locale with codes greater than 0x1f (US), except 0x7f (DEL).) Violation of the fields formatting leads to rejection of requests that contain UserAttribute. Note that despite punctuation is allowed, it can cause issues with 3rd party tools and formats like CSV. Order comment is provided for an order via UserAttribute with “name” set to “comment” and “value” set to the order comment. Depending on the order route, a limit on the order comment length can be imposed. If that limit is exceeded, the order comment is skipped, but order is not rejected.

extra_attributes

Type: shared_1.NamedValue

Description: List of order extra attributes. Such attributes are used for Pre-Trade Mid-Market Mark, Algo Strategies and other purposes.

algo_strategy

Type: string

Description: Case-sensitive identifier (abbreviation) of algorithm used to execute the order (e.g., VWAP, TWAP, etc.).

good_thru_utc_time (deprecated)

Type: sint64

Description: Date and time for GTT order (UTC) when the order should expire. Note: Use good_thru_utc_timestamp field instead.

good_thru_utc_timestamp

Type: google.protobuf.Timestamp

Description: Date and time for GTT order (UTC) when the order should expire. If specified by the user, it’s used instead of good_thru_utc_time field.

is_user_attribute_checked

Type: bool

Default: true

Description: Flag used by the client for marking the user attributes checked/unchecked.

strategy_trading_parameters

Type: strategy_2.StrategyTradingParameters

Description: Strategy trading parameters, applicable only if contract_id designates a synthetic, user defined or native strategy. If the parameter is not applicable for the order the default value is used.

open_close_instruction

Type: uint32

Description: Specifies what the order is intended to do: open or close (reduce) a position. One of OpenCloseInstruction enum. Applicable only if ContractMetadata.open_close_type is either OPEN_CLOSE_TYPE_OPTIONAL or OPEN_CLOSE_TYPE_REQUIRED.

speculation_type

Type: uint32

Description: Speculation type of the order. One of SpeculationType enum.

contributor_id

Type: string

Description: Optional OTC contributor involved into the order processing.

execution_source_code

Type: string

Description: FIA Execution Source Code value for the placement. Overrides the value CQG would otherwise automatically assign to the operation based on trader-account configuration. Refer to https://www.fia.org/articles/fia-and-fia-tech-release-guidelines-simplified-execution-source-code. Possible values:

      W - Desk

      Y - Electronic (Default)

      C - Vendor-provided Platform billed by Executing Broker

      G - Sponsored Access via Exchange API or FIX provided by Executing Broker

      H - Premium Algorithmic Trading Provider billed by Executing Broker

      D - Other, including Other-provided Screen

cross_order_parameters

Type: CrossOrderParameters

Description: Cross order parameters. It must be specified if order_type is ORDER_TYPE_CROSS.

external_account_number

Type: string

Description: Unique identifier of account within the exchange’s Member to place an order on it. This account can be external for CQG. Placing order on such an account may require providing additional exchange-specific information via Order.extra_attributes field. See order_2.ExternalAccount.external_account_number and trading_account_2.Account.allow_external_accounts.

is_care_order

Type: bool

Description: Specifies that the order is Care order.

allocated_accounts

Type: AllocatedAccount

Description: List of allocated accounts. Allows to allocate quantity between different accounts. It must be specified to place an allocation order.

Enum Side

Values

      SIDE_BUY = 1

     Describes the purchasing side of a trade.

      SIDE_SELL = 2

     Describes the selling side of a trade.

Enum OrderType

Values

      ORDER_TYPE_MKT = 1

     Market order, buy or sell by the best available opposite price.

      ORDER_TYPE_LMT = 2

     Limit order, buy or sell by price that is the same or better than specified limit price.

      ORDER_TYPE_STP = 3

     Stop order, Order becomes a Market when market reaches order’s stop price (which is on opposite side of market).

      ORDER_TYPE_STL = 4

     Stop-limit order, Order becomes a Limit when the market reaches the order’s stop price.

      ORDER_TYPE_CROSS = 5

     Cross order type. See also CrossOrderParameters message.

Enum ExecInstruction

Values

      EXEC_INSTRUCTION_NONE = 12

     None (this means “plain order without any exec instructions”). This value shall not be explicitly provided in OrderRequest.

      EXEC_INSTRUCTION_AON = 1

     All or None (fill order only completely).

      EXEC_INSTRUCTION_ICEBERG = 2

     Iceberg (show only part of order size).

      EXEC_INSTRUCTION_QT = 3

     Quantity triggered (aka DOM Triggered, honor additional quantity threshold for triggering).

      EXEC_INSTRUCTION_TRAIL = 4

     Trailing order (price of the order is following market one direction by specific offset).

      EXEC_INSTRUCTION_FUNARI = 5

     Funari (Limit order becomes a Market on Close).

      EXEC_INSTRUCTION_MIT = 6

     Market if Touched (Limit order becomes a Market when market reaches order’s limit price).

      EXEC_INSTRUCTION_MLM = 7

     Market Limit Market is a limit order that is used to place a buy order above the best offer to fill by the best offer or a sell order below the best bid to fill by the best bid.

      EXEC_INSTRUCTION_POSTONLY = 8

     Post-only order. Ensures the limit order will be added to the order book and not match with a pre-existing order.

      EXEC_INSTRUCTION_MTL = 10

     Market with leftover as Limit (market order then unexecuted quantity becomes limit order at last price).

      EXEC_INSTRUCTION_AUCTION = 11

     An auction order is an order to buy or sell in the market at the Calculated Opening Price (COP). Unmatched auction orders are converted to limit orders on the market open.

      EXEC_INSTRUCTION_ATANYPRICE = 13

     At Any Price Orders are US-Style Market Orders.

      EXEC_INSTRUCTION_LMT_PRARGD = 14

     Limit order with prearranged transaction flag (IntentToCross) set.

      EXEC_INSTRUCTION_ICO = 15

     Internal Cross Only. This order type is used by OTC to pull up to order size quantity from the exchange on the opposite side.

      EXEC_INSTRUCTION_CRFQ_LMT = 16

     Complex Order Request for Quote (LMT).

      EXEC_INSTRUCTION_CRFQ_MKT = 17

     Complex Order Request for Quote (MKT).

Enum Duration

Values

      DURATION_DAY = 1

     Day order. The order is working through the current trading day only.

      DURATION_GTC = 2

     Good Til Canceled. The order is working until canceled or until the contract is no longer available for trading.

      DURATION_GTD = 3

     Good Til Date. The order is working through the specified trade date (good_thru_date) for the contract. Note: Exchange must have a trading session for the contract for the specified trade date.

      DURATION_GTT = 4

     Good Til Time. The order is working until the specified time.

      DURATION_FAK = 5

     Fill and Kill. Immediately fill as many as possible and cancel the rest.

      DURATION_FOK = 6

     Fill Or Kill. Immediately fill this order completely or cancel.

      DURATION_ATO = 7

     At The Open. Buy or sell at the very beginning of the trading day.

      DURATION_ATC = 8

     At The Close. Buy or sell at the close of the market, or as near to the closing price as possible.

      DURATION_GFA = 9

     Good for auction. Order only valid for the next auction.

Enum TrailingPeg

Values

      TRAILING_PEG_BESTBID = 1

     Trail the best bid.

      TRAILING_PEG_BESTASK = 2

     Trail the best ask.

      TRAILING_PEG_LASTTRADE = 3

     Trail the last trade.

Enum OpenCloseInstruction

Description: Specifies what the order is intended to do: open (or extend) a position on the same side as the order or close (or reduce) an opposite position. Applicable only if ContractMetadata.open_close_type is either OPEN_CLOSE_TYPE_OPTIONAL or OPEN_CLOSE_TYPE_REQUIRED.

Values

      OPEN_CLOSE_INSTRUCTION_OPEN = 1

     Opening a new today position.

      OPEN_CLOSE_INSTRUCTION_CLOSE = 2

     Closing or reducing (today only if ContractMetadata.position_tracking is LONG_SHORT_WITH_EXPLICIT_CLOSE, today or yesterday if LONG_SHORT_WITH_IMPLIED_CLOSE).

      OPEN_CLOSE_INSTRUCTION_CLOSE_YESTERDAY = 3

     Closing or reducing a yesterday position (if ContractMetadata.position_tracking is LONG_SHORT_WITH_EXPLICIT_CLOSE).