BetaTrader
A HFT Eco-System
Loading...
Searching...
No Matches
common::Trade Class Reference

Represents a single trade execution in the system. More...

#include <Trade.h>

Collaboration diagram for common::Trade:
Collaboration graph

Public Member Functions

 Trade (TradeID tradeId, Instrument symbol, OrderID buyOrderId, OrderID sellOrderId, const Quantity qty, const Price price, const Timestamp ts)
 Constructs a new Trade object.
 
const OrderIDgetBuyOrderId () const
 Gets the buy order's unique identifier.
 
const InstrumentgetOrderSymbol () const
 Gets the financial instrument symbol.
 
Price getPrice () const
 Gets the trade price.
 
Quantity getQuantity () const
 Gets the trade quantity.
 
const OrderIDgetSellOrderId () const
 Gets the sell order's unique identifier.
 
Timestamp getTimestamp () const
 Gets the trade timestamp.
 
const TradeIDgetTradeId () const
 Gets the trade's unique identifier.
 

Private Attributes

OrderID mBuyOrderId
 The ID of the buy order involved in the trade.
 
Instrument mOrderSymbol
 Financial instrument symbol.
 
Price mPrice
 The price at which the trade was executed.
 
Quantity mQuantity
 The quantity of the trade.
 
OrderID mSellOrderId
 
Timestamp mTimestamp
 The timestamp of when the trade occurred.
 
TradeID mTradeId
 Unique identifier for the trade.
 

Detailed Description

Represents a single trade execution in the system.

This class is a data model that encapsulates all the properties of a trade, including its ID, symbol, buy/sell order IDs, quantity, price, and timestamp.

Constructor & Destructor Documentation

◆ Trade()

common::Trade::Trade ( TradeID  tradeId,
Instrument  symbol,
OrderID  buyOrderId,
OrderID  sellOrderId,
const Quantity  qty,
const Price  price,
const Timestamp  ts 
)
inline

Constructs a new Trade object.

Parameters
tradeIdThe unique identifier for the trade.
symbolThe financial instrument symbol.
buyOrderIdThe ID of the buy order involved in the trade.
sellOrderIdThe ID of the sell order involved in the trade.
qtyThe quantity of the trade.
priceThe price at which the trade was executed.
tsThe timestamp of when the trade occurred.

Member Function Documentation

◆ getBuyOrderId()

const OrderID & common::Trade::getBuyOrderId ( ) const
inline

Gets the buy order's unique identifier.

Here is the caller graph for this function:

◆ getOrderSymbol()

const Instrument & common::Trade::getOrderSymbol ( ) const
inline

Gets the financial instrument symbol.

Here is the caller graph for this function:

◆ getPrice()

Price common::Trade::getPrice ( ) const
inline

Gets the trade price.

Here is the caller graph for this function:

◆ getQuantity()

Quantity common::Trade::getQuantity ( ) const
inline

Gets the trade quantity.

Here is the caller graph for this function:

◆ getSellOrderId()

const OrderID & common::Trade::getSellOrderId ( ) const
inline

Gets the sell order's unique identifier.

Here is the caller graph for this function:

◆ getTimestamp()

Timestamp common::Trade::getTimestamp ( ) const
inline

Gets the trade timestamp.

Here is the caller graph for this function:

◆ getTradeId()

const TradeID & common::Trade::getTradeId ( ) const
inline

Gets the trade's unique identifier.

Here is the caller graph for this function:

Member Data Documentation

◆ mBuyOrderId

OrderID common::Trade::mBuyOrderId
private

The ID of the buy order involved in the trade.

◆ mOrderSymbol

Instrument common::Trade::mOrderSymbol
private

Financial instrument symbol.

◆ mPrice

Price common::Trade::mPrice
private

The price at which the trade was executed.

◆ mQuantity

Quantity common::Trade::mQuantity
private

The quantity of the trade.

◆ mSellOrderId

OrderID common::Trade::mSellOrderId
private

The ID of the sell order involved in the trade.

◆ mTimestamp

Timestamp common::Trade::mTimestamp
private

The timestamp of when the trade occurred.

◆ mTradeId

TradeID common::Trade::mTradeId
private

Unique identifier for the trade.


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