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

One position row in a holdings snapshot. More...

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

Collaboration diagram for algotradelib::HoldingPosition:

Public Attributes

InstrumentId instrument_
 The instrument held (brokers report holdings without a trading venue).
std::string name_
 The instrument's name as the broker spells it.
Decimal64 quantity_
 The quantity in this row.
std::optional< Decimal64 > sellable_quantity_
 How much the broker says may be sold now.
std::optional< SellableBasis > sellable_basis_
 What this row's sellable_quantity_ covers, when the figure came from a per-instrument inquiry rather than the holdings read.
Decimal64 average_purchase_price_
 The broker's average purchase price.
Decimal64 last_price_
 The price the broker valued the position at.
Money purchase_value_
 The cost basis, as the broker computed it.
Money market_value_
 The market value, as the broker computed it.
Money unrealized_profit_loss_
 The unrealized profit or loss, as the broker reported it.
Decimal64 unrealized_return_
 The broker's return figure, as a fraction (0.05 is 5%).

Detailed Description

One position row in a holdings snapshot.

Definition at line 1017 of file types.hpp.

Member Data Documentation

◆ average_purchase_price_

Decimal64 algotradelib::HoldingPosition::average_purchase_price_

The broker's average purchase price.

Definition at line 1043 of file types.hpp.

◆ instrument_

InstrumentId algotradelib::HoldingPosition::instrument_

The instrument held (brokers report holdings without a trading venue).

Definition at line 1019 of file types.hpp.

◆ last_price_

Decimal64 algotradelib::HoldingPosition::last_price_

The price the broker valued the position at.

Definition at line 1045 of file types.hpp.

◆ market_value_

Money algotradelib::HoldingPosition::market_value_

The market value, as the broker computed it.

Definition at line 1049 of file types.hpp.

◆ name_

std::string algotradelib::HoldingPosition::name_

The instrument's name as the broker spells it.

Definition at line 1021 of file types.hpp.

◆ purchase_value_

Money algotradelib::HoldingPosition::purchase_value_

The cost basis, as the broker computed it.

Definition at line 1047 of file types.hpp.

◆ quantity_

Decimal64 algotradelib::HoldingPosition::quantity_

The quantity in this row.

One instrument may span several rows; size a holding with Portfolio::net_quantity_of.

Definition at line 1027 of file types.hpp.

◆ sellable_basis_

std::optional<SellableBasis> algotradelib::HoldingPosition::sellable_basis_

What this row's sellable_quantity_ covers, when the figure came from a per-instrument inquiry rather than the holdings read.

Empty in the ordinary case, where HoldingsSnapshot::sellable_basis_ applies.

Definition at line 1041 of file types.hpp.

◆ sellable_quantity_

std::optional<Decimal64> algotradelib::HoldingPosition::sellable_quantity_

How much the broker says may be sold now.

Empty if the broker did not say, which is not zero. What it covers is the row's sellable_basis_, or else the snapshot's HoldingsSnapshot::sellable_basis_.

Definition at line 1034 of file types.hpp.

◆ unrealized_profit_loss_

Money algotradelib::HoldingPosition::unrealized_profit_loss_

The unrealized profit or loss, as the broker reported it.

Definition at line 1051 of file types.hpp.

◆ unrealized_return_

Decimal64 algotradelib::HoldingPosition::unrealized_return_

The broker's return figure, as a fraction (0.05 is 5%).

Definition at line 1053 of file types.hpp.


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