Table of Contents

Prices, Volumes & Data Types

◀ WebSocket API (V2)

Prices and Decimals are Represented as Strings

Two wrapper types carry exact numbers as strings:

message Price   { string value = 1; }   // e.g. "4200.50"
message Decimal { string value = 1; }   // e.g. "1.50"

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

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.)

If you expect ES to look like 5954.75 instead of 595475, choose Real.

Set PriceFormat on LoginRequest to choose how Price strings are formatted:

PriceFormat Description Example (ES)
PRICE_FORMAT_REAL Human-readable decimal placement used by most trading UIs.
5954.75
PRICE_FORMAT_DECIMAL Raw exchange representation, without UI-friendly decimal placement.
595475
PRICE_FORMAT_CLEARING_DECIMAL Typically used for data imports and exports only.
595475

See System Price Format for more information.