developers:websocket:quotes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
developers:websocket:quotes [2025/03/15 14:07] – created chaddevelopers:websocket:quotes [2025/03/17 16:51] (current) chad
Line 15: Line 15:
   * **Depth of Market (DOM)** – Typically the **10 best bid/offer levels**.   * **Depth of Market (DOM)** – Typically the **10 best bid/offer levels**.
  
-==== MBP Data Structure ====+==== MBP Subscripotion ====
  
-MBP data is structured in **MarketDepthBuffer** and **MarketDepthLevel** messages.+MBP subscription is configured with DepthBuffer and DepthLevel options.
  
-^ **Field** ^ **Description** ^ +=== DepthBuffer ===
-| MarketId | The identifier for the market. | +
-| Levels   | A list of price levels. Each level represents an aggregate of orders. |+
  
-MarketDepthLevel fields:+^ **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.) |
  
-^ **Field** ^ **Description** ^ 
-| Price     | The price level for the bids/offers. | 
-| BidVolume | The total volume available at this bid price. | 
-| AskVolume | The total volume available at this ask price. | 
  
 ==== MBP Subscription Example ==== ==== MBP Subscription Example ====
Line 36: Line 51:
 <code> <code>
 MarketDepthSubscribe { MarketDepthSubscribe {
 +   ExchangeId = "CME",
 +   ContractId = "ESM25",
    MarketId = "XCME_C ES (M25)",    MarketId = "XCME_C ES (M25)",
-   SubscriptionType MarketDepthSubscriptionType.Normal+   Buffer DepthBuffer.Smart
-   DepthLevels = 10+   DepthLevels = DepthLevels.Normal
 } }
 </code> </code>
Line 44: Line 61:
 ==== Unsubscribing ==== ==== Unsubscribing ====
  
-To stop receiving MBP data, clients send a **MarketDepthUnsubscribe** message.+To stop receiving MBP data, clients send a **MarketDepthSubscribe** message.
  
 <code> <code>
-MarketDepthUnsubscribe +MarketDepthSubscribe { 
-   MarketId = "XCME_C ES (M25)"+   ExchangeId = "CME", 
 +   ContractId = "ESM25", 
 +   MarketId = "XCME_C ES (M25)"
 +   Buffer = DepthBuffer.NoSubscription, 
 +   DepthLevels = DepthLevels.Undefined
 } }
 </code> </code>
 +
  
 ==== MBP Message Handling ==== ==== MBP Message Handling ====
Line 58: Line 80:
   * **MarketDefinition** – Sent once per market, unless already received via another feed.   * **MarketDefinition** – Sent once per market, unless already received via another feed.
   * **MarketSnapshot** – Provides a full market state on initial subscription.   * **MarketSnapshot** – Provides a full market state on initial subscription.
-  * **MarketDepthUpdate** – Sends incremental changes to depth.+  * **MarketDepth** – Sends incremental changes to depth.
  
 Example MBP message handling: Example MBP message handling:
  
-<code>+<code c#>
 private void HandleMarketMessage(ServerMessage serverMessage) private void HandleMarketMessage(ServerMessage serverMessage)
 { {
Line 69: Line 91:
         case ServerMessage.PayloadOneofCase.MarketDefinition:         case ServerMessage.PayloadOneofCase.MarketDefinition:
             ProcessMarketDefinition(serverMessage.MarketDefinition);             ProcessMarketDefinition(serverMessage.MarketDefinition);
-            _logger.LogInformation("Received market definition: {MarketId}", serverMessage.MarketDefinition.MarketId); 
             break;             break;
  
         case ServerMessage.PayloadOneofCase.MarketSnapshot:         case ServerMessage.PayloadOneofCase.MarketSnapshot:
             ProcessMarketSnapshot(serverMessage.MarketSnapshot);             ProcessMarketSnapshot(serverMessage.MarketSnapshot);
-            _logger.LogInformation("Received market snapshot: {MarketId}", serverMessage.MarketSnapshot.MarketId); 
             break;             break;
  
-        case ServerMessage.PayloadOneofCase.MarketDepthUpdate+        case ServerMessage.PayloadOneofCase.MarketDepth
-            ProcessMarketDepthUpdate(serverMessage.MarketDepthUpdate); +            ProcessMarketDepth(serverMessage.MarketDepth);
-            _logger.LogInformation("Received depth update for market: {MarketId}", serverMessage.MarketDepthUpdate.MarketId);+
             break;             break;
  
Line 88: Line 107:
 } }
 </code> </code>
 +
  
 ===== Market by Order (MBO) ===== ===== 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 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: MBO data includes:
  
-  * **Full Order Book Snapshot** – Sent when first subscribing+  * **MarketByOrderSnapshot** – Full snapshot of the current order book state
-  * **Incremental Updates** – Sent in real-time as new orders enter or exit the book.+  * **MarketByOrderUpdate** – Incremental updates to the order book. 
  
 ==== MBO Subscription Example ==== ==== MBO Subscription Example ====
  
-Example **MarketDepthSubscribe** message for MBO:+To receive MBO data, clients send a **MarketByOrderSubscribe** message.
  
 <code> <code>
-MarketDepthSubscribe +MarketByOrderSubscribe 
-   MarketId = "XCME_C ES (M25)", +   exchange_id = "CME", 
-   SubscriptionType MarketDepthSubscriptionType.ByOrder+   contract_id = "ESM25", 
 +   market_id = "XCME_C ES (M25)", 
 +   subscribe true
 } }
 </code> </code>
Line 111: Line 134:
 ==== Unsubscribing ==== ==== Unsubscribing ====
  
-Example **MarketDepthUnsubscribe** message:+To stop receiving MBO data, clients send a **MarketByOrderSubscribe** message.
  
 <code> <code>
-MarketDepthUnsubscribe +MarketByOrderSubscribe 
-   MarketId = "XCME_C ES (M25)"+   exchange_id = "CME", 
 +   contract_id = "ESM25", 
 +   market_id = "XCME_C ES (M25)"
 +   subscribe = false
 } }
 </code> </code>
 +
  
 ==== MBO Message Handling ==== ==== MBO Message Handling ====
Line 129: Line 156:
 Example MBO message handling: Example MBO message handling:
  
-<code>+<code c#>
 private void HandleMBOMessage(ServerMessage serverMessage) private void HandleMBOMessage(ServerMessage serverMessage)
 { {
     switch (serverMessage.PayloadCase)     switch (serverMessage.PayloadCase)
     {     {
 +        case ServerMessage.PayloadOneofCase.MarketByOrderSubscribeReject:
 +            ProcessMarketByOrderSubscribeReject(serverMessage.MarketByOrderSubscribeReject);
 +            break;
 +            
         case ServerMessage.PayloadOneofCase.MarketDefinition:         case ServerMessage.PayloadOneofCase.MarketDefinition:
             ProcessMarketDefinition(serverMessage.MarketDefinition);             ProcessMarketDefinition(serverMessage.MarketDefinition);
-            _logger.LogInformation("Received market definition: {MarketId}", serverMessage.MarketDefinition.MarketId); 
             break;             break;
  
         case ServerMessage.PayloadOneofCase.MarketSnapshot:         case ServerMessage.PayloadOneofCase.MarketSnapshot:
             ProcessMarketSnapshot(serverMessage.MarketSnapshot);             ProcessMarketSnapshot(serverMessage.MarketSnapshot);
-            _logger.LogInformation("Received MBO snapshot: {MarketId}", serverMessage.MarketSnapshot.MarketId); 
             break;             break;
  
         case ServerMessage.PayloadOneofCase.MarketOrderUpdate:         case ServerMessage.PayloadOneofCase.MarketOrderUpdate:
             ProcessMarketOrderUpdate(serverMessage.MarketOrderUpdate);             ProcessMarketOrderUpdate(serverMessage.MarketOrderUpdate);
-            _logger.LogInformation("Received MBO order update: {MarketId}", serverMessage.MarketOrderUpdate.MarketId); 
             break;             break;
  
Line 155: Line 183:
 } }
 </code> </code>
 +
  
 ===== Delayed vs. Non-Delayed Data ===== ===== Delayed vs. Non-Delayed Data =====
Line 161: Line 190:
  
   * They have an expired simulator account.   * They have an expired simulator account.
-  * Their market data entitlements do not allow real-time access.+  * 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. A **flag on the messages** indicates whether the data is delayed. Clients should check this flag before displaying market data.
- 
-Example **MarketDefinition** field: 
  
 ^ **Field** ^ **Description** ^ ^ **Field** ^ **Description** ^
-IsDelayed | `true` if the market data is delayed, `false` if real-time. |+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. 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.1742047638.txt.gz
  • Last modified: 2025/03/15 14:07
  • by chad