crypto_trader
Cryptocurrency Trading Bot API Documentation
Loading...
Searching...
No Matches
crypto_trader::common::SymbolPositions Struct Reference

Aggregates all positions and financial data for a specific trading symbol. More...

#include <Accounting.h>

Collaboration diagram for crypto_trader::common::SymbolPositions:
Collaboration graph

Public Attributes

std::string d_symbol
 The trading symbol (e.g., "BTC-USD").
double d_totalQty = 0.0
 Total quantity of the asset held.
double d_averagePrice = 0.0
 Weighted average price of all held lots.
std::list< Positiond_positions_in_time
 List of individual lots, ordered by time or FIFO/LIFO.
bool d_fifo
 True if positions are managed using FIFO, false for LIFO.
double d_realizedPnl
 Realized Profit and Loss from closed positions.
int64_t d_timestamp
 Timestamp of the last change.
nlohmann::json d_metadata

Detailed Description

Aggregates all positions and financial data for a specific trading symbol.

Member Data Documentation

◆ d_averagePrice

double crypto_trader::common::SymbolPositions::d_averagePrice = 0.0

Weighted average price of all held lots.

◆ d_fifo

bool crypto_trader::common::SymbolPositions::d_fifo
Initial value:
=
true

True if positions are managed using FIFO, false for LIFO.

◆ d_metadata

nlohmann::json crypto_trader::common::SymbolPositions::d_metadata

◆ d_positions_in_time

std::list<Position> crypto_trader::common::SymbolPositions::d_positions_in_time
Initial value:
=
{}

List of individual lots, ordered by time or FIFO/LIFO.

◆ d_realizedPnl

double crypto_trader::common::SymbolPositions::d_realizedPnl
Initial value:
=
0.0

Realized Profit and Loss from closed positions.

◆ d_symbol

std::string crypto_trader::common::SymbolPositions::d_symbol

The trading symbol (e.g., "BTC-USD").

◆ d_timestamp

int64_t crypto_trader::common::SymbolPositions::d_timestamp

Timestamp of the last change.

◆ d_totalQty

double crypto_trader::common::SymbolPositions::d_totalQty = 0.0

Total quantity of the asset held.


The documentation for this struct was generated from the following file:
  • /home/runner/work/crypto_trader/crypto_trader/common/Accounting.h