![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
The commission rates a broker published for an account, or a caller stated. More...
#include <algotradelib/src/core/types.hpp>
Classes | |
| struct | RateSelection |
| The result of rate_for: a rate, or why there is none. More... | |
Public Member Functions | |
| RateSelection | rate_for (Country country, const VenueKey &asserted, const Date &date) const |
| Finds the rate in force for a market and venue on a date. | |
| bool | any_dated_rate_for (Country country) const |
| Tests whether any rate for a market has a date bound, readable or not. | |
| RateSelection | rate_for (Country country, const Date &date) const |
| Finds the venue-neutral rate in force for a market on a date. | |
Public Attributes | |
| std::vector< CommissionRate > | rates_ |
| The rate rows. | |
| std::chrono::system_clock::time_point | received_at_ {} |
| When the schedule was received, on this machine's clock. | |
| CommissionOrigin | origin_ {CommissionOrigin::BROKER_PUBLISHED} |
| Whether a broker published the rates or a caller stated them. | |
| std::string | tariff_ |
| Which tariff the rates are, in the source's own words. | |
| std::size_t | dropped_ {0} |
| How many broker rows were skipped because their market code could not be stored. | |
| std::size_t | unreadable_bounds_ {0} |
| How many rows have a date bound that could not be read. | |
The commission rates a broker published for an account, or a caller stated.
An empty schedule from a broker that publishes rates is a real answer: the account has none.
|
inline |
|
inline |
|
inline |
Finds the rate in force for a market and venue on a date.
First the rows keyed to asserted's venue are searched, then the venue-neutral ones; within each pass the first applicable row wins. If a row reached before any match has an unreadable window, the search stops and reports bounds_unreadable_. Asking with VenueKey::any() reads neutral rows only, so a schedule with only KRX and NXT rows answers nothing.
| country | The market. |
| asserted | The venue the fill happened at, or VenueKey::any(). |
| date | The trading date. |
Definition at line 1592 of file types.hpp.
Referenced by algotradelib::backtest::commission_model_from(), and rate_for().
| std::size_t algotradelib::CommissionSchedule::dropped_ {0} |
| CommissionOrigin algotradelib::CommissionSchedule::origin_ {CommissionOrigin::BROKER_PUBLISHED} |
Whether a broker published the rates or a caller stated them.
Definition at line 1541 of file types.hpp.
Referenced by algotradelib::backtest::commission_model_from(), and algotradelib::backtest::CommissionPolicy::scheduled().
| std::vector<CommissionRate> algotradelib::CommissionSchedule::rates_ |
The rate rows.
Definition at line 1537 of file types.hpp.
Referenced by any_dated_rate_for(), and rate_for().
| std::chrono::system_clock::time_point algotradelib::CommissionSchedule::received_at_ {} |
| std::string algotradelib::CommissionSchedule::tariff_ |
Which tariff the rates are, in the source's own words.
Required for a caller-stated schedule: a backtest's cost model refuses one without it, because fee pages differ by account channel (온라인 영업점 개설 계좌, 온라인 뱅키스 계좌, 영업점매매), which no API states. A broker-published schedule carries the broker's own name.
Definition at line 1549 of file types.hpp.
Referenced by algotradelib::backtest::CommissionPolicy::scheduled().
| std::size_t algotradelib::CommissionSchedule::unreadable_bounds_ {0} |
How many rows have a date bound that could not be read.
Nonzero means some rows' windows are unknown, so a lookup they could affect returns no rate (RateSelection::bounds_unreadable_). Unlike dropped_, these rows are kept.