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

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.

Detailed Description

What RiskGuard::check needs besides the order and the portfolio.

Definition at line 520 of file risk.hpp.

Member Data Documentation

◆ exposure_basis_

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().

◆ now_

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().

◆ order_currency_

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().

◆ phase_

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().

◆ reference_price_

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().

◆ run_cash_

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.

Definition at line 548 of file risk.hpp.

◆ run_holding_

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.

Definition at line 554 of file risk.hpp.


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