![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
How a backtest charges commission: one stated model, or a schedule resolved per execution. More...
#include <algotradelib/src/backtest/cost.hpp>
Public Member Functions | |
| CommissionPolicy ()=default | |
| Constructs a policy that charges nothing (the report says so). | |
| bool | is_scheduled () const noexcept |
| Tests whether the policy resolves a schedule. | |
| const VenueKey & | asserted_venue () const noexcept |
| Returns the asserted venue. | |
| std::string_view | tariff () const noexcept |
| Returns the schedule's tariff name. | |
| Result< CommissionCharge > | charge (const Decimal64 &quantity, const Decimal64 &price, const Date &date, Country country) const |
| Computes the commission on one execution. | |
Static Public Member Functions | |
| static CommissionPolicy | stated (CommissionModel model) |
| Makes a policy that charges one model on every execution. | |
| static Result< CommissionPolicy > | scheduled (CommissionSchedule schedule, VenueKey asserted, Country dating_market) |
| Makes a policy that picks a rate from a schedule for each execution. | |
How a backtest charges commission: one stated model, or a schedule resolved per execution.
stated charges one CommissionModel throughout. scheduled picks the rate for each execution by its market, its local trading date and the venue the caller asserts (a replay cannot know where an order executed, so the report lists the venue as an assumption). A rate that cannot be resolved is an error, and the replay halts rather than skipping or zero-costing the fill.
|
default |
Constructs a policy that charges nothing (the report says so).
Referenced by scheduled(), and stated().
|
inlinenoexcept |
Returns the asserted venue.
|
inline |
Computes the commission on one execution.
A scheduled policy charges no minimum (a schedule states none).
| quantity | The quantity. |
| price | The price. |
| date | The market-local trading date of the execution (see SessionWindow::local_date). |
| country | The instrument's market. |
|
inlinenoexcept |
|
inlinestatic |
Makes a policy that picks a rate from a schedule for each execution.
| schedule | The rates. A caller-stated schedule must name its tariff_. |
| asserted | The venue fills are assumed to happen at; not Venue::COMBINED, which is routing rather than a venue. |
| dating_market | The market whose local trading day the replay's dates are; a dated rate for another market is refused when charged. |
|
inlinestatic |
|
inlinenoexcept |