![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
Infers a broker's SellableConvention from successive portfolios. More...
#include <algotradelib/src/strategy/sellable_convention.hpp>
Public Member Functions | |
| void | observe (const Portfolio< Broker > &portfolio) |
| Records one polled portfolio, comparing it with the previous one. | |
| void | forget (const InstrumentId &instrument) |
| Discards the last recorded reading for an instrument, so the next one is not compared across a gap. | |
| SellableEvidence | evidence (const InstrumentId &instrument) const |
| Returns the evidence for one instrument. | |
| SellableEvidence | overall () const |
| Returns the evidence summed over every instrument. | |
| SellableConvention | verdict () const |
| Returns the broker's convention as observed so far. | |
| const std::vector< std::pair< InstrumentId, SellableEvidence > > & | per_instrument () const noexcept |
| Returns the evidence per instrument. | |
Infers a broker's SellableConvention from successive portfolios.
Call observe with each polled portfolio. An observation is recorded only when, between two polls, an instrument's holding is unchanged, the resting sell quantity the broker reported grew, and the gap between held and sellable moved by exactly that amount (NET_OF_RESTING) or not at all (GROSS_OF_RESTING); anything else is discarded. Positions whose sellable basis is not enforceable, or which carry no sellable figure, are skipped, so with a broker that does not publish the figure the verdict stays UNDETERMINED.
| Broker | The broker tag of the portfolio. |
Definition at line 104 of file sellable_convention.hpp.
|
inline |
Returns the evidence for one instrument.
| instrument | The instrument. |
Definition at line 166 of file sellable_convention.hpp.
|
inline |
Discards the last recorded reading for an instrument, so the next one is not compared across a gap.
| instrument | The instrument. |
Definition at line 152 of file sellable_convention.hpp.
Referenced by observe().
|
inline |
Records one polled portfolio, comparing it with the previous one.
| portfolio | The portfolio. |
Definition at line 110 of file sellable_convention.hpp.
|
inline |
Returns the evidence summed over every instrument.
Definition at line 177 of file sellable_convention.hpp.
Referenced by verdict().
|
inlinenoexcept |
Returns the evidence per instrument.
Definition at line 196 of file sellable_convention.hpp.
|
inline |
Returns the broker's convention as observed so far.
Definition at line 190 of file sellable_convention.hpp.