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

What a sellable quantity covers, and how RiskGuard must treat resting sells against it. More...

#include <algotradelib/src/core/types.hpp>

Public Types

enum class  Coverage { UNESTABLISHED , WHOLE_HOLDING , PARTIAL }
 Whether the figure covers the whole holding. More...
enum class  RestingTreatment { UNESTABLISHED , DEDUCT }
 How RiskGuard treats resting sell orders against the figure. More...

Public Member Functions

constexpr bool is_enforceable () const noexcept
 Tests whether RiskGuard may check a sell against a figure with this basis.

Public Attributes

Coverage coverage_ = Coverage::UNESTABLISHED
 What the figure covers; unestablished by default.
RestingTreatment resting_ = RestingTreatment::UNESTABLISHED
 How resting sells are treated; unestablished by default.
bool verified_ = false
 Whether the basis was confirmed from a real broker response, rather than stated as a policy.

Detailed Description

What a sellable quantity covers, and how RiskGuard must treat resting sells against it.

Both parts default to UNESTABLISHED, and RiskGuard refuses a checked sell against a figure whose basis is not enforceable. An adapter that fills sellable_quantity_ must state this too.

Definition at line 918 of file types.hpp.

Member Enumeration Documentation

◆ Coverage

Whether the figure covers the whole holding.

Enumerator
UNESTABLISHED 

Not established; RiskGuard refuses.

WHOLE_HOLDING 

Every share held of the instrument, whatever venue or lot.

PARTIAL 

Only part of the holding, such as one venue's shares; RiskGuard refuses, reporting SELLABLE_BASIS_UNESTABLISHED.

Definition at line 920 of file types.hpp.

◆ RestingTreatment

How RiskGuard treats resting sell orders against the figure.

Enumerator
UNESTABLISHED 

Not stated; RiskGuard refuses.

DEDUCT 

Subtract every resting sell from the figure.

Safe whatever the broker does: if the broker already deducted them, sells are over-refused, never doubled.

Definition at line 933 of file types.hpp.

Member Function Documentation

◆ is_enforceable()

bool algotradelib::SellableBasis::is_enforceable ( ) const
inlineconstexprnoexcept

Tests whether RiskGuard may check a sell against a figure with this basis.

Returns
true if the coverage is WHOLE_HOLDING and the treatment is stated.

Definition at line 960 of file types.hpp.

Member Data Documentation

◆ coverage_

Coverage algotradelib::SellableBasis::coverage_ = Coverage::UNESTABLISHED

What the figure covers; unestablished by default.

Definition at line 946 of file types.hpp.

Referenced by is_enforceable(), and algotradelib::strategy::Portfolio< Broker >::sellable_reading_for().

◆ resting_

RestingTreatment algotradelib::SellableBasis::resting_ = RestingTreatment::UNESTABLISHED

How resting sells are treated; unestablished by default.

Definition at line 948 of file types.hpp.

Referenced by is_enforceable(), and algotradelib::strategy::Portfolio< Broker >::sellable_reading_for().

◆ verified_

bool algotradelib::SellableBasis::verified_ = false

Whether the basis was confirmed from a real broker response, rather than stated as a policy.

Nothing in the library sets it to true today.

Definition at line 954 of file types.hpp.


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