![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
The fees a run budget estimates for an order (RiskLimits::run_fees_). More...
#include <algotradelib/src/strategy/risk.hpp>
Public Member Functions | |
| std::optional< Decimal64 > | estimate_commission (const Decimal64 &value) const |
| Estimates the commission on one order. | |
| std::optional< Decimal64 > | estimate_tax (const Decimal64 &value, OrderSide side) const |
| Estimates the tax on one order. | |
Public Attributes | |
| Decimal64 | commission_rate_ {Decimal64::parse("0")} |
| The fraction of traded value charged on buys and sells (0.00015, not 0.015). | |
| Decimal64 | commission_minimum_ {Decimal64::parse("0")} |
| The least commission on one order. | |
| std::optional< Decimal64 > | institution_rate_ |
| A fraction of traded value charged on top of the commission (an institution fee), if any. | |
| std::optional< Decimal64 > | sell_tax_rate_ |
| The fraction of a sell's value charged as tax, if any. | |
The fees a run budget estimates for an order (RiskLimits::run_fees_).
The same shapes as the backtest's CommissionModel, institution rate and SellTax, stated here because a budget needs them before any fill. They apply per order: the minimum and the rounding apply once to the order's traded value, however many fills make it up. Each charge rounds up to a whole currency unit (an exact zero stays zero), so it is never below a charge truncated to whole units; for a currency with cents the commission and the institution fee, each rounded up, can over-reserve up to two units an order. Per-share fees have no shape here. Default-constructed, it states no fees at all.
|
inline |
Estimates the commission on one order.
| value | The order's traded value. |
|
inline |
Estimates the tax on one order.
| value | The order's traded value. |
| side | The order's side. |
| Decimal64 algotradelib::strategy::RunFees::commission_minimum_ {Decimal64::parse("0")} |
The least commission on one order.
Definition at line 324 of file risk.hpp.
Referenced by estimate_commission().
| Decimal64 algotradelib::strategy::RunFees::commission_rate_ {Decimal64::parse("0")} |
The fraction of traded value charged on buys and sells (0.00015, not 0.015).
Definition at line 322 of file risk.hpp.
Referenced by estimate_commission().
| std::optional<Decimal64> algotradelib::strategy::RunFees::institution_rate_ |
A fraction of traded value charged on top of the commission (an institution fee), if any.
Definition at line 326 of file risk.hpp.
Referenced by estimate_commission().
| std::optional<Decimal64> algotradelib::strategy::RunFees::sell_tax_rate_ |
The fraction of a sell's value charged as tax, if any.
Definition at line 328 of file risk.hpp.
Referenced by estimate_tax().