![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
Which venue a commission rate applies to: any venue, a normalized Venue, or a raw code. More...
#include <algotradelib/src/core/types.hpp>
Public Member Functions | |
| VenueKey ()=default | |
| Constructs the key for any venue. | |
| VenueKeyKind | kind () const noexcept |
| Returns the key's kind. | |
| bool | is_any () const noexcept |
| Tests whether the key is for any venue. | |
| Venue | venue () const noexcept |
| Returns the normalized venue. | |
| const Code< 8 > & | raw_code () const noexcept |
| Returns the raw venue code. | |
| bool | matches (const VenueKey &asserted) const noexcept |
| Tests whether two keys name the same venue, exactly in kind and value. | |
Static Public Member Functions | |
| static VenueKey | any () noexcept |
| Returns the key for any venue. | |
| static std::optional< VenueKey > | normalized (Venue venue) |
| Makes a key for a normalized venue. | |
| static std::optional< VenueKey > | raw (std::string_view code) |
| Makes a key for a venue code the library does not normalize. | |
Friends | |
| bool | operator== (const VenueKey &lhs, const VenueKey &rhs) noexcept |
| Compares kind and value; same as matches. | |
| bool | operator!= (const VenueKey &lhs, const VenueKey &rhs) noexcept |
| Compares two keys for inequality. | |
Which venue a commission rate applies to: any venue, a normalized Venue, or a raw code.
The three kinds never match each other: a RAW key never equals a NORMALIZED one even if the text looks the same. A backtest refuses Venue::COMBINED as the venue a fill happened at, since it names consolidated routing (KIS SOR), not where an order matched.
|
default |
Constructs the key for any venue.
Referenced by any(), matches(), normalized(), operator!=, operator==, and raw().
|
inlinestaticnoexcept |
Returns the key for any venue.
Definition at line 1253 of file types.hpp.
Referenced by algotradelib::CommissionSchedule::rate_for().
|
inlinenoexcept |
|
inlinenoexcept |
Returns the key's kind.
Definition at line 1290 of file types.hpp.
Referenced by algotradelib::backtest::CommissionPolicy::scheduled().
|
inlinenoexcept |
Tests whether two keys name the same venue, exactly in kind and value.
No fallback: an ANY key matches only ANY. Falling back to a neutral rate is done by CommissionSchedule::rate_for.
| asserted | The key to compare with. |
|
inlinestatic |
|
inlinenoexcept |
|
inlinenoexcept |
Returns the normalized venue.
Definition at line 1302 of file types.hpp.
Referenced by normalized(), and algotradelib::backtest::CommissionPolicy::scheduled().