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. ====== Prices, Volumes & Data Types ====== [[developers:apiv2|◀ WebSocket API (V2)]] ===== Prices and Decimals are Represented as Strings ===== Two wrapper types carry exact numbers as strings: * [[https://github.com/CTS-Futures/t4-api-tools/blob/main/proto/t4/v2/common/price.proto#L12|Price]] * [[https://github.com/CTS-Futures/t4-api-tools/blob/main/proto/t4/v2/common/price.proto#L6|Decimal]] <code> message Price { string value = 1; } // e.g. "4200.50" message Decimal { string value = 1; } // e.g. "1.50" </code> T4 uses text to avoid binary floating-point rounding. **Parse them into your language's native decimal type**, not a ''double''. ''Price'' is used for market/order prices; ''Decimal'' is used for order volumes and cash values. ===== Volumes ===== * **Order routing** — volumes (''volume'', ''max_show'', ''max_volume'', fill volumes) are ''Decimal''. This allows the API to support fractional exchange quantities (e.g. Kalshi). * **Market data** — depth and trade volumes are plain integers (''int32''). ===== System Price format ===== T4 publishes prices in different formats. The setting controls how prices are formatted in the trading and all other platform API's (chart's, etc.) <note>If you expect ES to look like ''5954.75'' instead of ''595475'', choose **Real**.</note> Set [[https://github.com/CTS-Futures/t4-api-tools/blob/main/proto/t4/v2/common/enums.proto#L35|PriceFormat]] on [[https://github.com/CTS-Futures/t4-api-tools/blob/main/proto/t4/v2/auth/auth.proto#L9|LoginRequest]] to choose how ''Price'' strings are formatted: <WRAP 75%> ^ PriceFormat ^ Description ^ Example (ES) ^ | ''PRICE_FORMAT_REAL'' | Human-readable decimal placement used by most trading UIs. | <code>5954.75</code> | | ''PRICE_FORMAT_DECIMAL'' | Raw exchange representation, without UI-friendly decimal placement. | <code>595475</code> | | ''PRICE_FORMAT_CLEARING_DECIMAL'' | Typically used for data imports and exports only. | <code>595475</code> | </WRAP> See [[developers:systempricing|System Price Format]] for more information. developers/apiv2/pricing.txt Last modified: 2026/09/07 22:23by chad