algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::runner::DryRunReport< BrokerTag > Struct Template Reference

What one runner pass decided and did, sorted by outcome (returned by Runner::feed). More...

#include <algotradelib/src/runner/runner.hpp>

Public Member Functions

bool quiet () const noexcept
 Tests whether the pass did nothing at all.

Public Attributes

std::vector< strategy::PlannedOrder > would_place_
 Orders that passed every check and were sent (in a dry run, would have been).
std::vector< OrderRef< BrokerTag > > would_cancel_
 Cancellations the broker accepted.
std::vector< strategy::Rejection > rejected_
 Instructions not placed: reconciliation could not build them, the broker refused them (BROKER_REFUSED), or the binding refused to send them (BINDING_REFUSED).
std::vector< strategy::GuardRejection > refused_
 Instructions the risk guard refused (a limit or a hold).
std::vector< WithheldOrder > withheld_
 Orders held back because an earlier order on the instrument has an unknown outcome (RECONCILE_REQUIRED) or, in a serialized runner, is not yet accounted for (AWAITING_CONFIRMATION); a serialized runner keeps the target and plans it again at a later holdings read.
std::vector< WithheldPlan< BrokerTag > > withheld_plans_
 Whole plans (cancellations and placements) held back before any part was sent; see WithheldPlanReason.
std::vector< strategy::PlannedOrder > indeterminate_
 Orders whose outcome is unknown (SendOutcome::INDETERMINATE, which at KIS, Toss and Kiwoom includes most of the broker's own refusals); the instrument now needs reconciling.
std::vector< RejectedCancel< BrokerTag > > rejected_cancel_
 Cancellations that were refused, by the broker or the binding.
std::vector< OrderRef< BrokerTag > > indeterminate_cancel_
 Cancellations with an unknown outcome; the order may or may not still rest.
std::vector< OrderRef< BrokerTag > > unresolved_cancel_
 Cancellations naming an order the portfolio does not list; not sent.
std::vector< WithheldOrder > unavailable_
 Orders not sent because local machinery was unavailable (SendOutcome::UNAVAILABLE, such as a failed journal write); the runner stops sending.
std::vector< OrderRef< BrokerTag > > unavailable_cancel_
 Cancellations not sent because local machinery was unavailable.
std::vector< RefusedCancel< BrokerTag > > refused_cancel_
 Cancellations refused by a hold that blocks withdrawals (OPERATOR, STOPPING; see strategy::halt_blocks).
std::vector< std::string > log_
 Lines the strategy logged during the pass.

Detailed Description

template<typename BrokerTag>
struct algotradelib::runner::DryRunReport< BrokerTag >

What one runner pass decided and did, sorted by outcome (returned by Runner::feed).

The buckets list outcomes of orders, cancellations and plans, not one entry per instruction: a target already met adds nothing, and one target can produce several orders and cancellations.

Template Parameters
BrokerTagThe broker tag.

Definition at line 192 of file runner.hpp.

Member Function Documentation

◆ quiet()

template<typename BrokerTag>
bool algotradelib::runner::DryRunReport< BrokerTag >::quiet ( ) const
inlinenoexcept

Tests whether the pass did nothing at all.

Returns
true if every bucket except log_ is empty.

Definition at line 260 of file runner.hpp.

Member Data Documentation

◆ indeterminate_

template<typename BrokerTag>
std::vector<strategy::PlannedOrder> algotradelib::runner::DryRunReport< BrokerTag >::indeterminate_

Orders whose outcome is unknown (SendOutcome::INDETERMINATE, which at KIS, Toss and Kiwoom includes most of the broker's own refusals); the instrument now needs reconciling.

Definition at line 227 of file runner.hpp.

Referenced by quiet().

◆ indeterminate_cancel_

template<typename BrokerTag>
std::vector<OrderRef<BrokerTag> > algotradelib::runner::DryRunReport< BrokerTag >::indeterminate_cancel_

Cancellations with an unknown outcome; the order may or may not still rest.

Definition at line 235 of file runner.hpp.

Referenced by quiet().

◆ log_

template<typename BrokerTag>
std::vector<std::string> algotradelib::runner::DryRunReport< BrokerTag >::log_

Lines the strategy logged during the pass.

Definition at line 254 of file runner.hpp.

◆ refused_

template<typename BrokerTag>
std::vector<strategy::GuardRejection> algotradelib::runner::DryRunReport< BrokerTag >::refused_

Instructions the risk guard refused (a limit or a hold).

Definition at line 210 of file runner.hpp.

Referenced by quiet().

◆ refused_cancel_

template<typename BrokerTag>
std::vector<RefusedCancel<BrokerTag> > algotradelib::runner::DryRunReport< BrokerTag >::refused_cancel_

Cancellations refused by a hold that blocks withdrawals (OPERATOR, STOPPING; see strategy::halt_blocks).

A hold that only means data is missing (such as PORTFOLIO_STALE) does not refuse a named cancellation; LOCAL_FAILURE puts it in unavailable_cancel_ instead.

Definition at line 252 of file runner.hpp.

Referenced by quiet().

◆ rejected_

template<typename BrokerTag>
std::vector<strategy::Rejection> algotradelib::runner::DryRunReport< BrokerTag >::rejected_

Instructions not placed: reconciliation could not build them, the broker refused them (BROKER_REFUSED), or the binding refused to send them (BINDING_REFUSED).

In each case the order does not exist and nothing needs reconciling.

Definition at line 208 of file runner.hpp.

Referenced by quiet().

◆ rejected_cancel_

template<typename BrokerTag>
std::vector<RejectedCancel<BrokerTag> > algotradelib::runner::DryRunReport< BrokerTag >::rejected_cancel_

Cancellations that were refused, by the broker or the binding.

The order may still be working, or may have just filled (a common reason to refuse).

Definition at line 233 of file runner.hpp.

Referenced by quiet().

◆ unavailable_

template<typename BrokerTag>
std::vector<WithheldOrder> algotradelib::runner::DryRunReport< BrokerTag >::unavailable_

Orders not sent because local machinery was unavailable (SendOutcome::UNAVAILABLE, such as a failed journal write); the runner stops sending.

Definition at line 242 of file runner.hpp.

Referenced by quiet().

◆ unavailable_cancel_

template<typename BrokerTag>
std::vector<OrderRef<BrokerTag> > algotradelib::runner::DryRunReport< BrokerTag >::unavailable_cancel_

Cancellations not sent because local machinery was unavailable.

Definition at line 244 of file runner.hpp.

Referenced by quiet().

◆ unresolved_cancel_

template<typename BrokerTag>
std::vector<OrderRef<BrokerTag> > algotradelib::runner::DryRunReport< BrokerTag >::unresolved_cancel_

Cancellations naming an order the portfolio does not list; not sent.

Definition at line 237 of file runner.hpp.

Referenced by quiet().

◆ withheld_

template<typename BrokerTag>
std::vector<WithheldOrder> algotradelib::runner::DryRunReport< BrokerTag >::withheld_

Orders held back because an earlier order on the instrument has an unknown outcome (RECONCILE_REQUIRED) or, in a serialized runner, is not yet accounted for (AWAITING_CONFIRMATION); a serialized runner keeps the target and plans it again at a later holdings read.

Definition at line 217 of file runner.hpp.

Referenced by quiet().

◆ withheld_plans_

template<typename BrokerTag>
std::vector<WithheldPlan<BrokerTag> > algotradelib::runner::DryRunReport< BrokerTag >::withheld_plans_

Whole plans (cancellations and placements) held back before any part was sent; see WithheldPlanReason.

Definition at line 222 of file runner.hpp.

Referenced by quiet().

◆ would_cancel_

template<typename BrokerTag>
std::vector<OrderRef<BrokerTag> > algotradelib::runner::DryRunReport< BrokerTag >::would_cancel_

Cancellations the broker accepted.

Accepted is not done: cancellation is asynchronous, so the order may still be working (or fill) until a listing says otherwise. Every other cancellation outcome has its own bucket.

Definition at line 201 of file runner.hpp.

Referenced by quiet().

◆ would_place_

template<typename BrokerTag>
std::vector<strategy::PlannedOrder> algotradelib::runner::DryRunReport< BrokerTag >::would_place_

Orders that passed every check and were sent (in a dry run, would have been).

Definition at line 194 of file runner.hpp.

Referenced by quiet().


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