crypto_trader
Cryptocurrency Trading Bot API Documentation
Loading...
Searching...
No Matches
crypto_trader::common Namespace Reference

Classes

class  Accounting
 Manages the accounting of trading activities, tracking positions and PnL. More...
struct  Action
struct  Event
class  MarketDataCoinbase
class  Math
 Provides static utility methods for safe floating-point comparisons. More...
struct  MonitorConfig
struct  Position
 Represents a single position (lot) within a larger holding. More...
struct  SymbolPositions
 Aggregates all positions and financial data for a specific trading symbol. More...
struct  Trade
struct  TradeResult

Concepts

concept  Serializeable
concept  MarketData
concept  SerializeableData
concept  TimestampLike

Typedefs

using json = nlohmann::json
typedef std::function< void(const Action &)> Emit

Enumerations

enum class  EventType { ORDER_SUBMITTED , ORDER_FILLED , ORDER_CANCELLED , POSITION_UPDATE }
enum class  ReadFileOptions { ALL_CONTENTS , LAST_LINE }
enum class  Side { e_BUY = 0 , e_SELL = 1 }

Functions

int readFile (std::string *fileContents, const std::string &filepath, const ReadFileOptions &readFileOptions)
int readJsonFile (json *parsedJson, const std::string &filepath)
nlohmann::json value_or (const nlohmann::json &json, const std::string &key, const nlohmann::json &def)
int64_t getCurrentTimestampMs ()
template<common::MarketData T>
T::Timestamp getCurrentTimestampMs ()
int64_t parseISO8601ToMillis (const std::string &iso8601)
std::ostream & operator<< (std::ostream &os, Side s)

Typedef Documentation

◆ Emit

typedef std::function<void(const Action&)> crypto_trader::common::Emit

◆ json

using crypto_trader::common::json = nlohmann::json

Enumeration Type Documentation

◆ EventType

Enumerator
ORDER_SUBMITTED 
ORDER_FILLED 
ORDER_CANCELLED 
POSITION_UPDATE 

◆ ReadFileOptions

Enumerator
ALL_CONTENTS 
LAST_LINE 

◆ Side

enum class crypto_trader::common::Side
strong
Enumerator
e_BUY 
e_SELL 

Function Documentation

◆ getCurrentTimestampMs() [1/2]

int64_t crypto_trader::common::getCurrentTimestampMs ( )
inline

◆ getCurrentTimestampMs() [2/2]

template<common::MarketData T>
T::Timestamp crypto_trader::common::getCurrentTimestampMs ( )

◆ operator<<()

std::ostream & crypto_trader::common::operator<< ( std::ostream & os,
Side s )
inline

◆ parseISO8601ToMillis()

int64_t crypto_trader::common::parseISO8601ToMillis ( const std::string & iso8601)
inline

◆ readFile()

int crypto_trader::common::readFile ( std::string * fileContents,
const std::string & filepath,
const ReadFileOptions & readFileOptions )

◆ readJsonFile()

int crypto_trader::common::readJsonFile ( json * parsedJson,
const std::string & filepath )

◆ value_or()

nlohmann::json crypto_trader::common::value_or ( const nlohmann::json & json,
const std::string & key,
const nlohmann::json & def )
inline