ATS
An algorithmic trading system completely written in C++
Public Member Functions | Public Attributes | List of all members
ats::Position Struct Reference

Represents a position with its quantity and price. More...

#include <PositionManager.h>

Public Member Functions

 Position ()
 Default constructor that initializes the quantity and price to 0.
 
 Position (double q, double p)
 Constructor that initializes the quantity and price to the given values. More...
 
double total ()
 Calculates the total value of the position. More...
 

Public Attributes

double quantity
 Quantity of the position.
 
double price
 Price of the position.
 

Detailed Description

Represents a position with its quantity and price.

Constructor & Destructor Documentation

◆ Position()

ats::Position::Position ( double  q,
double  p 
)
inline

Constructor that initializes the quantity and price to the given values.

Parameters
qQuantity of the asset
pPrice of the asset

Member Function Documentation

◆ total()

double ats::Position::total ( )
inline

Calculates the total value of the position.

Returns
The total value of the position (quantity * price).

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