ITCHCPP 1.6.0
High-Performance NASDAQ TotalView-ITCH 5.0 Parser & Market-Data Platform
Loading...
Searching...
No Matches
price.hpp File Reference

Strongly typed, fixed-point price representation for ITCH price fields. More...

#include <cstdint>
#include <format>
#include <string>
#include <type_traits>
+ Include dependency graph for price.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  itch::BasicPrice< RawType, Decimals >
 A strongly typed fixed-point price carrying its own decimal scale. More...
 
struct  std::formatter< itch::BasicPrice< RawType, Decimals > >
 Formats a price with its scale's number of decimals, e.g. "150.0000". More...
 

Namespaces

namespace  itch
 

Typedefs

using itch::StandardPrice = BasicPrice< std::uint32_t, 4 >
 Price scale for every ITCH price field except MWCB decline levels.
 
using itch::MwcbPrice = BasicPrice< std::uint64_t, 8 >
 Price scale for MWCB decline-level prices (8 implied decimals).
 

Functions

constexpr auto itch::make_price (std::uint32_t raw_value) noexcept -> StandardPrice
 Wraps a raw 4-decimal price value in the typed StandardPrice.
 
constexpr auto itch::make_mwcb_price (std::uint64_t raw_value) noexcept -> MwcbPrice
 Wraps a raw 8-decimal MWCB price value in the typed MwcbPrice.
 

Detailed Description

Strongly typed, fixed-point price representation for ITCH price fields.

Wraps the raw on-wire integer price in a type that carries its own decimal scale, so standard 4-decimal prices and MWCB 8-decimal decline-level prices cannot be mixed, compared, or formatted with the wrong divisor by accident.

Author
Bertin Balouki SIMYELI

Definition in file price.hpp.