![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
What RiskGuard::check needs besides the order and the portfolio. More...
#include <algotradelib/src/strategy/risk.hpp>
Public Attributes | |
| std::chrono::system_clock::time_point | now_ {} |
| The current instant; RiskLimits::rate_window_ counts back from it. | |
| MarketPhase | phase_ {MarketPhase::UNKNOWN} |
| The market phase the order would be sent in. | |
| std::optional< Decimal64 > | reference_price_ |
| A price to value a market order, which carries none. | |
| std::vector< InstrumentBasis > | exposure_basis_ |
| The currency and mark of every instrument held or working, plus the order's. | |
| std::optional< Currency > | order_currency_ |
| The currency the order is priced in, from its reference data. | |
| std::optional< Money > | run_cash_ |
| The run's cash less what its open buys reserve, read by a budgeted buy (RiskLimits::run_budget_). | |
| std::optional< Decimal64 > | run_holding_ |
| The run's own shares of the order's instrument less its open sells, read by a budgeted sell. | |
What RiskGuard::check needs besides the order and the portfolio.
| std::vector<InstrumentBasis> algotradelib::strategy::GuardInputs::exposure_basis_ |
The currency and mark of every instrument held or working, plus the order's.
Needed only by RiskLimits::max_gross_exposure_. A missing entry, or two entries for one instrument, refuses with GuardReason::VALUE_NOT_KNOWN. The runner fills it from reference data.
Definition at line 534 of file risk.hpp.
Referenced by algotradelib::strategy::RiskGuard::evaluate().
| std::chrono::system_clock::time_point algotradelib::strategy::GuardInputs::now_ {} |
The current instant; RiskLimits::rate_window_ counts back from it.
Definition at line 522 of file risk.hpp.
Referenced by algotradelib::strategy::RiskGuard::evaluate().
| std::optional<Currency> algotradelib::strategy::GuardInputs::order_currency_ |
The currency the order is priced in, from its reference data.
Needed by the buying-power check (absent refuses with INSUFFICIENT_BUYING_POWER) and by the gross-exposure ceiling and a run budget's buy (absent refuses with VALUE_NOT_KNOWN).
Definition at line 541 of file risk.hpp.
Referenced by algotradelib::strategy::RiskGuard::evaluate().
| MarketPhase algotradelib::strategy::GuardInputs::phase_ {MarketPhase::UNKNOWN} |
The market phase the order would be sent in.
Definition at line 524 of file risk.hpp.
Referenced by algotradelib::strategy::RiskGuard::evaluate().
| std::optional<Decimal64> algotradelib::strategy::GuardInputs::reference_price_ |
A price to value a market order, which carries none.
Definition at line 526 of file risk.hpp.
Referenced by algotradelib::strategy::RiskGuard::evaluate().
| std::optional<Money> algotradelib::strategy::GuardInputs::run_cash_ |
The run's cash less what its open buys reserve, read by a budgeted buy (RiskLimits::run_budget_).
The guard takes the buy's own estimated fee off it. The runner fills it; absent, or in another currency than the budget, refuses a budgeted buy with GuardReason::RUN_LEDGER_UNSETTLED.
| std::optional<Decimal64> algotradelib::strategy::GuardInputs::run_holding_ |
The run's own shares of the order's instrument less its open sells, read by a budgeted sell.
The runner fills it; absent refuses a budgeted sell with GuardReason::RUN_LEDGER_UNSETTLED.