![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
A flat commission: a rate on traded value, with an optional per-execution minimum. More...
#include <algotradelib/src/backtest/cost.hpp>
Public Member Functions | |
| std::optional< Decimal64 > | on (const Decimal64 &quantity, const Decimal64 &price) const |
| Computes the commission on one execution. | |
Static Public Member Functions | |
| static CommissionModel | none () |
| Returns a model that charges nothing (the report says so). | |
| static CommissionModel | of (Decimal64 rate, Decimal64 minimum=Decimal64::parse("0")) |
| Returns a rate-based model. | |
Public Attributes | |
| Decimal64 | rate_ {Decimal64::parse("0")} |
| The fraction of traded value charged per execution (0.00015, not 0.015). | |
| Decimal64 | minimum_ {Decimal64::parse("0")} |
| The smallest commission on any execution. | |
| bool | from_broker_ {false} |
| Whether the rate came from a broker's published schedule; commission_model_from sets it from the schedule's origin_. | |
A flat commission: a rate on traded value, with an optional per-execution minimum.
Charged on buys and sells alike; it carries no tax (see NextBarFillModel::with_sell_tax).
|
inlinestatic |
Returns a model that charges nothing (the report says so).
Definition at line 67 of file cost.hpp.
Referenced by algotradelib::backtest::NextBarFillModel::NextBarFillModel().
|
inlinestatic |
Returns a rate-based model.
| rate | The fraction of traded value charged. |
| minimum | The smallest commission per execution. |
Definition at line 75 of file cost.hpp.
Referenced by algotradelib::backtest::commission_model_from().
| bool algotradelib::backtest::CommissionModel::from_broker_ {false} |
Whether the rate came from a broker's published schedule; commission_model_from sets it from the schedule's origin_.
| Decimal64 algotradelib::backtest::CommissionModel::minimum_ {Decimal64::parse("0")} |
| Decimal64 algotradelib::backtest::CommissionModel::rate_ {Decimal64::parse("0")} |