algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::backtest::AppliedRate Struct Reference

The commission rate that charged an execution, as the backtest report lists it. More...

#include <algotradelib/src/backtest/cost.hpp>

Collaboration diagram for algotradelib::backtest::AppliedRate:

Public Attributes

Country country_ {Country::KR}
 The market the rate was selected for.
VenueKey venue_
 The venue the rate was keyed to.
Decimal64 rate_
 The broker's commission, as a fraction of traded value.
std::optional< Decimal64 > institution_rate_
 The institution fee rate; empty if the source gave one combined rate.
Decimal64 minimum_ {Decimal64::parse("0")}
 The per-execution minimum on the broker's commission; zero if none.
std::optional< Date > from_
 The first date of the rate's window; empty if open-ended.
std::optional< Date > until_
 The last date of the rate's window; empty if open-ended.
CommissionOrigin origin_ {CommissionOrigin::CALLER_STATED}
 Whether a broker published the rate or a caller stated it.
std::size_t executions_ {0}
 How many executions the rate charged, counted in the report's table.

Friends

bool operator== (const AppliedRate &lhs, const AppliedRate &rhs)
 Compares every field except executions_.

Detailed Description

The commission rate that charged an execution, as the backtest report lists it.

Definition at line 124 of file cost.hpp.

◆ operator==

bool operator== ( const AppliedRate & lhs,
const AppliedRate & rhs )
friend

Compares every field except executions_.

Parameters
lhsThe first rate.
rhsThe second rate.
Returns
true if they describe the same rate.

Definition at line 154 of file cost.hpp.

Member Data Documentation

◆ country_

Country algotradelib::backtest::AppliedRate::country_ {Country::KR}

The market the rate was selected for.

Definition at line 126 of file cost.hpp.

Referenced by algotradelib::backtest::CommissionPolicy::charge(), and operator==.

◆ executions_

std::size_t algotradelib::backtest::AppliedRate::executions_ {0}

How many executions the rate charged, counted in the report's table.

Zero on the copy attached to a single execution. Not compared by operator==.

Definition at line 146 of file cost.hpp.

◆ from_

std::optional<Date> algotradelib::backtest::AppliedRate::from_

The first date of the rate's window; empty if open-ended.

Definition at line 136 of file cost.hpp.

Referenced by algotradelib::backtest::CommissionPolicy::charge(), and operator==.

◆ institution_rate_

std::optional<Decimal64> algotradelib::backtest::AppliedRate::institution_rate_

The institution fee rate; empty if the source gave one combined rate.

Definition at line 132 of file cost.hpp.

Referenced by algotradelib::backtest::CommissionPolicy::charge(), and operator==.

◆ minimum_

Decimal64 algotradelib::backtest::AppliedRate::minimum_ {Decimal64::parse("0")}

The per-execution minimum on the broker's commission; zero if none.

Definition at line 134 of file cost.hpp.

Referenced by algotradelib::backtest::CommissionPolicy::charge(), and operator==.

◆ origin_

CommissionOrigin algotradelib::backtest::AppliedRate::origin_ {CommissionOrigin::CALLER_STATED}

Whether a broker published the rate or a caller stated it.

Definition at line 140 of file cost.hpp.

Referenced by algotradelib::backtest::CommissionPolicy::charge(), and operator==.

◆ rate_

Decimal64 algotradelib::backtest::AppliedRate::rate_

The broker's commission, as a fraction of traded value.

Definition at line 130 of file cost.hpp.

Referenced by algotradelib::backtest::CommissionPolicy::charge(), and operator==.

◆ until_

std::optional<Date> algotradelib::backtest::AppliedRate::until_

The last date of the rate's window; empty if open-ended.

Definition at line 138 of file cost.hpp.

Referenced by algotradelib::backtest::CommissionPolicy::charge(), and operator==.

◆ venue_

VenueKey algotradelib::backtest::AppliedRate::venue_

The venue the rate was keyed to.

Definition at line 128 of file cost.hpp.

Referenced by algotradelib::backtest::CommissionPolicy::charge(), and operator==.


The documentation for this struct was generated from the following file: