![]() |
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 106 of file sellable_convention.hpp.
|
inline |
Returns the evidence for one instrument.
| instrument | The instrument. |
Definition at line 168 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 154 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 112 of file sellable_convention.hpp.
|
inline |
Returns the evidence summed over every instrument.
Definition at line 179 of file sellable_convention.hpp.
Referenced by verdict().
|
inlinenoexcept |
Returns the evidence per instrument.
Definition at line 200 of file sellable_convention.hpp.
|
inline |
Returns the broker's convention as observed so far.
Definition at line 192 of file sellable_convention.hpp.