WU Trading Library 0.2.0
A backtesting and trading strategy library
Loading...
Searching...
No Matches
WU_Portfolio Struct Reference

Base for a portfolio, which defines the minimal interface for updating the portfolio with signals, calculating the current value of the portfolio, and calculating the profit and loss (PnL), as well as a method to free the portfolio's resources. More...

#include <portfolios.h>

Data Fields

void(* update )(struct WU_Portfolio_ *portfolio, const WU_Signal *signals)
double(* value )(const struct WU_Portfolio_ *portfolio)
double(* pnl )(const struct WU_Portfolio_ *portfolio)
void(* delete )(struct WU_Portfolio_ *portfolio)

Detailed Description

Base for a portfolio, which defines the minimal interface for updating the portfolio with signals, calculating the current value of the portfolio, and calculating the profit and loss (PnL), as well as a method to free the portfolio's resources.

The delete method should be called by the runner taking ownership of the portfolio. It is expected that specific portfolio implementations will extend this base structure and implement the defined methods.

Definition at line 18 of file portfolios.h.

Field Documentation

◆ delete

void(* WU_Portfolio::delete) (struct WU_Portfolio_ *portfolio)

Definition at line 22 of file portfolios.h.

◆ pnl

double(* WU_Portfolio::pnl) (const struct WU_Portfolio_ *portfolio)

Definition at line 21 of file portfolios.h.

◆ update

void(* WU_Portfolio::update) (struct WU_Portfolio_ *portfolio, const WU_Signal *signals)

Definition at line 19 of file portfolios.h.

◆ value

double(* WU_Portfolio::value) (const struct WU_Portfolio_ *portfolio)

Definition at line 20 of file portfolios.h.


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