CBOE Emulator  1.0
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
OrderEntry::SystemAccount< Handler > Struct Template Reference

A subclass of the LOB::Account that manages client state on the market server. More...

#include <system_account.hpp>

Inheritance diagram for OrderEntry::SystemAccount< Handler >:
OrderEntry::LOB::Account

Public Member Functions

 SystemAccount ()
 Initialize a new system account.
 
 SystemAccount (const std::string &username_, const std::string &password_)
 Initialize a new system account with given handler. More...
 
 SystemAccount (Handler *handler_)
 Initialize a new system account with given handler. More...
 
void limit_fill (LOB::Order *limit, LOB::Order *market) override
 Fill a limit order. More...
 
void limit_partial (LOB::Order *limit, LOB::Order *market) override
 Partially fill a limit order. More...
 
void market_fill (LOB::Order *limit, LOB::Order *market) override
 Fill a market order. More...
 
void market_partial (LOB::Order *limit, LOB::Order *market) override
 Partially fill a market order. More...
 
void limit (Order *order)
 Place a limit order. More...
 
void cancel (Order *order)
 Cancel a limit order. More...
 
void fill (Side side, Quantity quantity, Price price)
 Fill a market order on given side with quantity and price. More...
 

Static Public Member Functions

static const std::string table_header ()
 Return the header for the account table. More...
 

Public Attributes

std::string username = ""
 the user name for the account
 
std::string password = ""
 the password for the account
 
Handler * handler = nullptr
 the connection for this account
 
bool is_connected = false
 whether the account is currently logged in
 
Shares shares = 0
 the number of shares owned by the account
 
Capital capital = 0
 the total capital the account has (funds)
 
std::set< Order * > orders = {}
 the set of active orders for the account
 

Friends

std::ostream & operator<< (std::ostream &stream, const SystemAccount &account)
 Write the data from the account to a stream. More...
 

Detailed Description

template<typename Handler>
struct OrderEntry::SystemAccount< Handler >

A subclass of the LOB::Account that manages client state on the market server.

Template Parameters
Handlera callback handler type for passing trade event data to

Constructor & Destructor Documentation

◆ SystemAccount() [1/2]

template<typename Handler >
OrderEntry::SystemAccount< Handler >::SystemAccount ( const std::string &  username_,
const std::string &  password_ 
)
inline

Initialize a new system account with given handler.

Parameters
username_the username for the account
password_the password for the account

◆ SystemAccount() [2/2]

template<typename Handler >
OrderEntry::SystemAccount< Handler >::SystemAccount ( Handler *  handler_)
inlineexplicit

Initialize a new system account with given handler.

Parameters
handler_a pointer to the handler for the system account

Member Function Documentation

◆ cancel()

void OrderEntry::LOB::Account::cancel ( Order order)
inlineinherited

Cancel a limit order.

Parameters
orderthe order to cancel

◆ fill()

void OrderEntry::LOB::Account::fill ( Side  side,
Quantity  quantity,
Price  price 
)
inlineinherited

Fill a market order on given side with quantity and price.

Parameters
sidethe side of the trade
quantitythe quantity of the trade
pricethe price the trade occurred at

◆ limit()

void OrderEntry::LOB::Account::limit ( Order order)
inlineinherited

Place a limit order.

Parameters
orderthe limit order to place

◆ limit_fill()

template<typename Handler >
void OrderEntry::SystemAccount< Handler >::limit_fill ( LOB::Order limit,
LOB::Order market 
)
inlineoverridevirtual

Fill a limit order.

Parameters
limitthe limit order that is being filled
marketthe market order that fills the limit order

Reimplemented from OrderEntry::LOB::Account.

◆ limit_partial()

template<typename Handler >
void OrderEntry::SystemAccount< Handler >::limit_partial ( LOB::Order limit,
LOB::Order market 
)
inlineoverridevirtual

Partially fill a limit order.

Parameters
limitthe limit order that is being partially filled
marketthe market order that partially fills the limit order

Reimplemented from OrderEntry::LOB::Account.

◆ market_fill()

template<typename Handler >
void OrderEntry::SystemAccount< Handler >::market_fill ( LOB::Order limit,
LOB::Order market 
)
inlineoverridevirtual

Fill a market order.

Parameters
limitthe limit order that fills the market order
marketthe market order being filled

Reimplemented from OrderEntry::LOB::Account.

◆ market_partial()

template<typename Handler >
void OrderEntry::SystemAccount< Handler >::market_partial ( LOB::Order limit,
LOB::Order market 
)
inlineoverridevirtual

Partially fill a market order.

Parameters
limitthe limit order that partially fills the market order
marketthe market order being partially filled

Reimplemented from OrderEntry::LOB::Account.

◆ table_header()

template<typename Handler >
static const std::string OrderEntry::SystemAccount< Handler >::table_header ( )
inlinestatic

Return the header for the account table.

Returns
the header value for the system account table

Friends And Related Function Documentation

◆ operator<<

template<typename Handler >
std::ostream& operator<< ( std::ostream &  stream,
const SystemAccount< Handler > &  account 
)
friend

Write the data from the account to a stream.

Parameters
streamthe stream to write the data to
accountthe account to write to the stream
Returns
the stream with data from the account written to it

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