![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
One commission rate, the market and venue it applies to, and the dates it applies on. More...
#include <algotradelib/src/core/types.hpp>
Public Member Functions | |
| bool | normalized () const noexcept |
| Tests whether the rate's market is a normalized Country. | |
| RateApplicability | applies_on (const Date &date) const |
| Tests whether the rate applies on a date. | |
| bool | excluded_on (const Date &date) const |
| Tests whether a readable bound puts a date outside the rate's window. | |
Public Attributes | |
| Country | country_ {Country::KR} |
| The market the rate applies to; meaningless when other_ is set. | |
| Code< 16 > | other_ |
| The broker's market code, when the library does not normalize that market. | |
| VenueKey | venue_ |
| The venue the rate applies to. | |
| Decimal64 | rate_ |
| The broker's commission, as a fraction of traded value (0.00015, not 0.015). | |
| std::optional< Decimal64 > | institution_rate_ |
| The institution fee (유관기관제비용), as a fraction of traded value, if stated separately. | |
| std::optional< Date > | from_ |
| The first date the rate applies on; empty is open-ended unless from_unreadable_ is set. | |
| std::optional< Date > | until_ |
| The last date the rate applies on; empty is open-ended unless until_unreadable_ is set. | |
| bool | from_unreadable_ {false} |
| Whether the source stated a start date that could not be read (so from_ is empty). | |
| bool | until_unreadable_ {false} |
| Whether the source stated an end date that could not be read (so until_ is empty). | |
One commission rate, the market and venue it applies to, and the dates it applies on.
Rates are fractions of traded value (0.00015, not 0.015). An absent date bound is open-ended in that direction; a bound that was present but unreadable sets from_unreadable_ or until_unreadable_, and then applies_on answers UNREADABLE rather than treating the row as open-ended. No per-order minimum or transaction tax is modelled here; a backtest states a sale tax with backtest::NextBarFillModel::with_sell_tax.
|
inline |
|
inline |
Tests whether a readable bound puts a date outside the rate's window.
| date | The date. |
Definition at line 1525 of file types.hpp.
Referenced by applies_on().
|
inlinenoexcept |
| Country algotradelib::CommissionRate::country_ {Country::KR} |
| std::optional<Date> algotradelib::CommissionRate::from_ |
The first date the rate applies on; empty is open-ended unless from_unreadable_ is set.
Definition at line 1479 of file types.hpp.
Referenced by excluded_on().
| bool algotradelib::CommissionRate::from_unreadable_ {false} |
Whether the source stated a start date that could not be read (so from_ is empty).
The row is kept, but applies_on answers UNREADABLE for any date the readable bounds do not exclude.
Definition at line 1488 of file types.hpp.
Referenced by applies_on().
| std::optional<Decimal64> algotradelib::CommissionRate::institution_rate_ |
The institution fee (유관기관제비용), as a fraction of traded value, if stated separately.
Empty means the source gave one combined rate and said nothing about its parts (every Toss row); a report then treats rate_ as inclusive. A present zero is a stated zero; a positive value is charged in addition to rate_.
| Code<16> algotradelib::CommissionRate::other_ |
The broker's market code, when the library does not normalize that market.
Empty for a normalized market. A broker row whose market code cannot be stored here is skipped and counted in CommissionSchedule::dropped_.
Definition at line 1458 of file types.hpp.
Referenced by normalized().
| Decimal64 algotradelib::CommissionRate::rate_ |
| std::optional<Date> algotradelib::CommissionRate::until_ |
The last date the rate applies on; empty is open-ended unless until_unreadable_ is set.
Definition at line 1481 of file types.hpp.
Referenced by excluded_on().
| bool algotradelib::CommissionRate::until_unreadable_ {false} |
Whether the source stated an end date that could not be read (so until_ is empty).
The row is kept, but applies_on answers UNREADABLE for any date the readable bounds do not exclude.
Definition at line 1495 of file types.hpp.
Referenced by applies_on().
| VenueKey algotradelib::CommissionRate::venue_ |
The venue the rate applies to.
VenueKey::any() on every rate a broker publishes; no broker publishes per-venue rates, so a caller states KRX and NXT rates from the fee page.