BetaTrader
A HFT Eco-System
Loading...
Searching...
No Matches
trading_core Namespace Reference

Classes

class  CancelOrder
 A command to cancel an existing order in the trading engine. More...
 
class  Command
 An internal representation of a request, converted from an FIX message into this object for faster processing. More...
 
class  ExecutionPublisher
 A utility class for publishing execution reports, trades, and rejections. More...
 
class  MarketDataPublisher
 
class  Matcher
 The matching engine that pairs buy and sell orders. More...
 
class  ModifyOrder
 A command to modify an existing order in the trading engine. More...
 
class  NewOrder
 A command to submit a new order to the trading engine. More...
 
class  OrderBook
 Represents the order book for a single financial instrument. More...
 
class  OrderIDGenerator
 A thread-safe, database-aware generator for unique order IDs. More...
 
class  OrderManager
 Manages all the orders in the system. More...
 
class  Partition
 Encapsulates all components needed to process commands for a symbol. More...
 
class  RiskManager
 Performs risk validation and updates after trade execution. More...
 
class  TradeIDGenerator
 A thread-safe, database-aware generator for unique trade IDs. More...
 
class  TradingCore
 High-level manager for partitions and command dispatch. More...
 
class  WorkerThread
 Background worker which processes batched commands. More...
 

Enumerations

enum class  CommandType : uint8_t {
  NewOrder ,
  CancelOrder ,
  ModifyOrder ,
  COUNT
}
 Represents the different types of commands that can be processed by the trading engine. More...
 

Functions

template<typename TMap >
bool checkForSelfMatch (const common::Order &order, const TMap *oppositeMap)
 
CommandType from_string (std::string_view name)
 Converts a string to its corresponding CommandType enum.
 
std::string to_string (CommandType type)
 Converts a CommandType enum to its string representation.
 

Variables

constexpr std::array< std::string_view, static_cast< size_t >(CommandType::COUNT)> command_type_names = {"NewOrder", "CancelOrder", "ModifyOrder"}
 An array of string representations for the CommandType enum.
 
constexpr double MAX_PRICE_DEVIATION = 0.10
 

Enumeration Type Documentation

◆ CommandType

enum class trading_core::CommandType : uint8_t
strong

Represents the different types of commands that can be processed by the trading engine.

Enumerator
NewOrder 

A command to create a new order.

CancelOrder 

A command to cancel an existing order.

ModifyOrder 

A command to modify an existing order.

COUNT 

Helper to get the number of command types.

Function Documentation

◆ checkForSelfMatch()

template<typename TMap >
bool trading_core::checkForSelfMatch ( const common::Order order,
const TMap *  oppositeMap 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ from_string()

CommandType trading_core::from_string ( std::string_view  name)
inline

Converts a string to its corresponding CommandType enum.

Parameters
nameThe string representation of the CommandType.
Returns
The CommandType enum.
Exceptions
std::invalid_argumentif the string is not a valid command type.

◆ to_string()

std::string trading_core::to_string ( CommandType  type)
inline

Converts a CommandType enum to its string representation.

Parameters
typeThe CommandType to convert.
Returns
The string representation of the CommandType.
Here is the caller graph for this function:

Variable Documentation

◆ command_type_names

constexpr std::array<std::string_view, static_cast<size_t>(CommandType::COUNT)> trading_core::command_type_names = {"NewOrder", "CancelOrder", "ModifyOrder"}
constexpr

An array of string representations for the CommandType enum.

◆ MAX_PRICE_DEVIATION

constexpr double trading_core::MAX_PRICE_DEVIATION = 0.10
constexpr