ATS
An algorithmic trading system completely written in C++
Classes | Enumerations | Functions
ats Namespace Reference

Namespace for the algorithmic trading system. More...

Classes

class  BinanceExchangeManager
 The BinanceExchangeManager class is a class that defines the interface for managing orders on the Binance exchange. More...
 
class  ExchangeManager
 The ExchangeManager class is an abstract class that defines the interface for managing orders on an exchange. More...
 
struct  Klines
 The Klines stores kline data for a specific symbol. More...
 
class  MarketData
 Handles the streaming of market data for the trading system. More...
 
struct  Order
 The Order struct represents an order to be placed on an exchange. More...
 
struct  OrderBook
 The OrderBook struct represents the orderbook. More...
 
class  OrderManager
 A class for managing orders. More...
 
struct  Position
 Represents a position with its quantity and price. More...
 
class  PositionManager
 Manages the positions and the PnL of a trading system. More...
 
class  RiskManager
 A class that handles risk management. More...
 
class  Strategy
 Defines an abstract interface for trading strategies. More...
 
class  Trade
 Class representing a trade executed on an exchange. More...
 

Enumerations

enum  OrderType {
  LIMIT , MARKET , STOP_LOSS , STOP_LOSS_LIMIT ,
  TAKE_PROFIT , TAKE_PROFIT_LIMIT , LIMIT_MAKER , OTCOUNT
}
 Enum for different types of orders. More...
 
enum  Side { BUY , SELL , SCOUNT }
 Enum for buy/sell side of an order. More...
 

Functions

std::string OrderTypeToString (OrderType t)
 Converts OrderType enum value to string. More...
 
OrderType stringToOrderType (const std::string &s)
 Converts a string to an OrderType enum value. More...
 
std::string SideToString (Side t)
 Converts Side enum value to string. More...
 
Side stringToSide (const std::string &s)
 Converts a string to a Side enum value. More...
 

Detailed Description

Namespace for the algorithmic trading system.

This namespace contains all the classes and functions for the algorithmic trading system. It includes classes for managing orders, trades, accounts, and exchanges, as well as functions for analyzing market data, making trading decisions, and executing trades.

The system is designed to be extensible, with different types of exchanges and strategies able to be added through inheritance and polymorphism. The core functionality of the system is provided by the ExchangeManager and StrategyManager classes, which coordinate the interactions between exchanges, accounts, orders, and trades.

The system uses the JSONCPP library for parsing and manipulating JSON data, and currently supports the Binance exchange. It also includes a simulation mode for testing strategies and algorithms without risking real funds using the Binance testnet.

Enumeration Type Documentation

◆ OrderType

Enum for different types of orders.

Enumerator
LIMIT 

Limit order

MARKET 

Market order

STOP_LOSS 

Stop loss order

STOP_LOSS_LIMIT 

Stop loss limit order

TAKE_PROFIT 

Take profit order

TAKE_PROFIT_LIMIT 

Take profit limit order

LIMIT_MAKER 

Limit maker order

OTCOUNT 

Number of order types

◆ Side

enum ats::Side

Enum for buy/sell side of an order.

Enumerator
BUY 

Buy side of an order

SELL 

Sell side of an order

SCOUNT 

Number of sides

Function Documentation

◆ OrderTypeToString()

std::string ats::OrderTypeToString ( OrderType  t)

Converts OrderType enum value to string.

Parameters
tThe OrderType enum value to convert.
Returns
A string representation of the OrderType value.

◆ SideToString()

std::string ats::SideToString ( Side  t)

Converts Side enum value to string.

Parameters
tThe Side enum value to convert.
Returns
A string representation of the Side value.

◆ stringToOrderType()

OrderType ats::stringToOrderType ( const std::string &  s)

Converts a string to an OrderType enum value.

Parameters
sThe string to convert.
Returns
The corresponding OrderType enum value.

◆ stringToSide()

Side ats::stringToSide ( const std::string &  s)

Converts a string to a Side enum value.

Parameters
sThe string to convert.
Returns
The corresponding Side enum value.