algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
us.hpp
1#pragma once
2
3#include "../../core/instrument.hpp"
4
5namespace algotradelib {
6namespace us {
7
19 PriceRule rule;
21 rule.source_ =
22 "US Regulation NMS Rule 612 minimum increments, $0.01 from $1 and $0.0001 below (library-maintained; the 2024 "
23 "half-penny tier not checked)";
24 rule.bands_ = {
27 };
28 return rule;
29}
30
31} // namespace us
32} // namespace algotradelib
static Decimal64 parse(std::string_view input)
Parses a decimal string exactly (no binary floating point).
Definition types.hpp:468
The US equity price grid that the Alpaca adapter attaches to instruments, in brokers/common/us....
Definition us.hpp:6
PriceRule equity_price_rule()
Returns the US equity price grid: $0.01 at or above $1, $0.0001 below (Regulation NMS Rule 612).
Definition us.hpp:18
The library: broker-neutral types (core), and the modules below.
The price grid (tick sizes) an instrument's order prices must sit on.
std::string source_
Where the table came from and its revision, or why there is none.
std::vector< TickBand > bands_
The bands, ascending by from_; empty unless kind_ is STATED.
@ STATED
bands_ describe the market's grid.
Kind kind_
The kind of rule; UNKNOWN by default, so an unset rule refuses to round.
One band of a price grid: the tick size from a price upward, until the next band.