Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Quote Feed ====== The Quote Feed provides real-time market data in two formats: **Market by Price (MBP)** and **Market by Order (MBO)**. * **Market by Price (MBP)** – Aggregates orders at each price level, showing the **best bid/offer (BBO)** or a **depth of market (DOM)** view, typically up to 10 levels. * **Market by Order (MBO)** – Provides a full order book, showing each **individual order** at its exact price level. The available depth and data type depend on the **subscription request** and the **user’s market data setup**. ===== Market by Price (MBP) ===== MBP provides an **aggregated** view of the market. It groups orders at each price level, showing either: * **Top of Book (BBO)** – The best bid and offer. * **Depth of Market (DOM)** – Typically the **10 best bid/offer levels**. ==== MBP Subscripotion ==== A MBP subscription is configured with DepthBuffer and DepthLevel options. === DepthBuffer === ^ **Value** ^ **Description** ^ | NoSubscription | Used to unsubscribe the market quote feed. | | Slow | A buffered feed that provides a reduced rate of updates. | | SlowTrade | Same as Slow, but will deliver every trade. | | Smart | A minimally buffered feed that is guaranteed to provide every change to best bid/offer. | | SmartTrade | Same as Smart, but will deliver every trade. | <bootnote> ***Smart*** is typically what a trading client front end would use. </bootnote> <bootnote> The "Trade" buffers are needed when displaying a trade ticker or Time and Sales display, or updating a chart. </bootnote> === Depth Levels === ^ **Value** ^ **Description** ^ | Undefined | Used during unsubscription. | | BestOnly | Only the best bid and offer will be provided. (Also called Top of Book, TOB.) | | Normal | The full depth (as provided by the exchange) will be provided (typically top 10 bids and offers.) | ==== MBP Subscription Example ==== To receive MBP data, clients send a **MarketDepthSubscribe** message. <code> MarketDepthSubscribe { ExchangeId = "CME", ContractId = "ESM25", MarketId = "XCME_C ES (M25)", Buffer = DepthBuffer.Smart, DepthLevels = DepthLevels.Normal } </code> ==== Unsubscribing ==== To stop receiving MBP data, clients send a **MarketDepthSubscribe** message. <code> MarketDepthSubscribe { ExchangeId = "CME", ContractId = "ESM25", MarketId = "XCME_C ES (M25)", Buffer = DepthBuffer.NoSubscription, DepthLevels = DepthLevels.Undefined } </code> ==== MBP Message Handling ==== After subscribing, the following messages are received: * **MarketDefinition** – Sent once per market, unless already received via another feed. * **MarketSnapshot** – Provides a full market state on initial subscription. * **MarketDepth** – Sends incremental changes to depth. Example MBP message handling: <code c#> private void HandleMarketMessage(ServerMessage serverMessage) { switch (serverMessage.PayloadCase) { case ServerMessage.PayloadOneofCase.MarketDefinition: ProcessMarketDefinition(serverMessage.MarketDefinition); break; case ServerMessage.PayloadOneofCase.MarketSnapshot: ProcessMarketSnapshot(serverMessage.MarketSnapshot); break; case ServerMessage.PayloadOneofCase.MarketDepth: ProcessMarketDepth(serverMessage.MarketDepth); break; default: _logger.LogWarning("Unhandled Market Message: {PayloadCase}", serverMessage.PayloadCase); break; } } </code> ===== Market by Order (MBO) ===== MBO provides a **detailed view** of the market by reporting **every individual order** in the book. Unlike MBP, which aggregates orders at price levels, MBO allows clients to track order-level movements. MBO also allows clients to determine their **position in queue** in the market. MBO data includes: * **MarketByOrderSnapshot** – Full snapshot of the current order book state. * **MarketByOrderUpdate** – Incremental updates to the order book. ==== MBO Subscription Example ==== To receive MBO data, clients send a **MarketByOrderSubscribe** message. <code> MarketByOrderSubscribe { exchange_id = "CME", contract_id = "ESM25", market_id = "XCME_C ES (M25)", subscribe = true } </code> ==== Unsubscribing ==== To stop receiving MBO data, clients send a **MarketByOrderSubscribe** message. <code> MarketByOrderSubscribe { exchange_id = "CME", contract_id = "ESM25", market_id = "XCME_C ES (M25)", subscribe = false } </code> ==== MBO Message Handling ==== After subscribing, the following messages are received: * **MarketDefinition** – Sent once per market, unless already received. * **MarketSnapshot** – A full order book snapshot. * **MarketOrderUpdate** – Incremental order updates. Example MBO message handling: <code c#> private void HandleMBOMessage(ServerMessage serverMessage) { switch (serverMessage.PayloadCase) { case ServerMessage.PayloadOneofCase.MarketByOrderSubscribeReject: ProcessMarketByOrderSubscribeReject(serverMessage.MarketByOrderSubscribeReject); break; case ServerMessage.PayloadOneofCase.MarketDefinition: ProcessMarketDefinition(serverMessage.MarketDefinition); break; case ServerMessage.PayloadOneofCase.MarketSnapshot: ProcessMarketSnapshot(serverMessage.MarketSnapshot); break; case ServerMessage.PayloadOneofCase.MarketOrderUpdate: ProcessMarketOrderUpdate(serverMessage.MarketOrderUpdate); break; default: _logger.LogWarning("Unhandled MBO Message: {PayloadCase}", serverMessage.PayloadCase); break; } } </code> ===== Delayed vs. Non-Delayed Data ===== Clients may receive **delayed market data** if: * They have an expired simulator account. * Their market data setup only permits delayed data. A **flag on the messages** indicates whether the data is delayed. Clients should check this flag before displaying market data. ^ **Field** ^ **Description** ^ | Delayed | `true` if the market data is delayed, `false` if real-time. | If delayed data is received, clients should notify users that the feed is not real-time. <bootnote> T4 does not support delayed MBO data at this time. </bootnote> ===== Secondary Market Data ===== In addition to quotes, a market data feed subscription will include secondary market data: ^ **Message** ^ **Description** ^ | MarketDepthTrade | If a `Trade` feed is subscribed, the trade ticker is sent as a feed of MarketDepthTrade messages. | | MarketHighLow | Publishes updates to the high and low prices reached by the market. | | MarketPriceLimits | Publishes the price limits (bands or collars) set by the exchange for the market. | | MarketSettlement | Contains the latest market settlement, held settlment, open interest, cleared volume and VWAP information as published by the exchange. | developers/websocket/quotes.txt Last modified: 2025/03/17 16:51by chad