developers:websocket:pricing

Differences

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

Link to this comparison view

Next revision
Previous revision
developers:websocket:pricing [2025/03/14 22:17] – created chaddevelopers:websocket:pricing [2025/03/14 22:39] (current) – [Converting Price Differences to Cash Value] chad
Line 1: Line 1:
 ====== Pricing and Data Types ====== ====== Pricing and Data Types ======
  
-The WebSocket API represents prices using the **Price** and **Decimal** types. Both of these types wrap a string value for precision and consistency across different programming languages.+The WebSocket API represents market prices using the **Price** type, and cash values in the **Decimal** type. Both of these types wrap a string value for precision and consistency across different programming languages. 
 + 
 +<bootnote> 
 +Clients should parse **Price** and **Decimal** values into their programming language’s native **decimal** if available. 
 +</bootnote>
  
-Clients should always parse **Price** and **Decimal** values into their programming language’s native **decimal** type for calculations. 
  
 ===== Price and Decimal Types ===== ===== Price and Decimal Types =====
  
-The **Price** type is used for market prices, while the **Decimal** type is used for generic decimal values in messages. Both follow the same structure:+The **Price** type is used for market prices, while the **Decimal** type is used for cash values in messages. Both follow the same structure:
  
   * **Price** – Represents a price in the market (e.g., bid/ask prices, last traded price).   * **Price** – Represents a price in the market (e.g., bid/ask prices, last traded price).
Line 13: Line 16:
  
 Example representation: Example representation:
-   +  
-  Price = `"4200.50"` +<code>  
-  Decimal = `"5.25"`+Price = "4200.50" 
 +Decimal = "5.25" 
 +</code>
  
-In all cases, clients should parse these values into **decimal** for calculations. 
  
 ===== Proto Converter Tools ===== ===== Proto Converter Tools =====
Line 30: Line 34:
 | **.Net** | [[https://github.com/CTS-Futures/t4-api-tools|ProtoConverters.cs]] | | **.Net** | [[https://github.com/CTS-Futures/t4-api-tools|ProtoConverters.cs]] |
  
 +
 +
 +===== Understanding Price Representation =====
 +
 +The WebSocket API provides prices exactly as published by the exchange, using a **decimal format**. However, understanding price movement requires knowledge of **minimum price increments** and **point value calculations**.
 +
 +===== Minimum Price Increment =====
 +
 +Markets do not trade at arbitrary price levels; instead, they move in predefined steps known as the **Minimum Price Increment**. This defines the smallest amount by which a price can change.
 +
 +For example, if a market has a **MinPriceIncrement** of **25**, price levels would move as follows:
 +
 +  * **4000.00**
 +  * **4025.00**
 +  * **4050.00**
 +  * **4075.00**
 +  * **4100.00**
 +
 +This ensures that all price movements align with the market’s allowed increments.
 +
 +*Reference:* The **MinPriceIncrement** field is found in the **MarketDetails** message.
 +
 +===== Converting Price Differences to Cash Value =====
 +
 +To determine the cash value of a price movement, use the **Point Value**. This represents the dollar value of a single price unit.
 +
 +Formula:
 +
 +''(Price2 - Price1) × PointValue = Cash Equivalent''
 +
 +
 +Example:
 +
 +<code>
 +  Price1 = 4200.00**
 +  Price2 = 4225.00**
 +  Point Value = 0.5**
 +
 +  (4225.00 - 4200.00) × 0.5 = 12.5
 +</code>
 +
 +This means a move from **4200.00 to 4225.00** corresponds to **$12.50 per contract**.
 +
 +*Reference:* The **PointValue** field is found in the **MarketDetails** message.
  • developers/websocket/pricing.1741990668.txt.gz
  • Last modified: 2025/03/15 02:36
  • (external edit)