crypto_trader
Cryptocurrency Trading Bot API Documentation
Loading...
Searching...
No Matches
crypto_trader::protocols::Strategy Class Referenceabstract

Abstract base class defining the interface for a trading strategy. More...

#include <strategy.h>

Inheritance diagram for crypto_trader::protocols::Strategy:
Inheritance graph
Collaboration diagram for crypto_trader::protocols::Strategy:
Collaboration graph

Public Member Functions

 Strategy (const common::Emit &emit)
 Constructs a Strategy object.
virtual ~Strategy ()=0
 Destructor for the Strategy interface.
virtual void handleNewData (const nlohmann::json &data)=0
 Handles new market data received by the strategy.

Protected Attributes

common::Emit d_emit
 Function to emit trading actions.

Detailed Description

Abstract base class defining the interface for a trading strategy.

Strategies analyze market data and emit trading actions.

Constructor & Destructor Documentation

◆ Strategy()

crypto_trader::protocols::Strategy::Strategy ( const common::Emit & emit)

Constructs a Strategy object.

Parameters
emitA function callback used by the strategy to emit actions.

◆ ~Strategy()

crypto_trader::protocols::Strategy::~Strategy ( )
pure virtual

Destructor for the Strategy interface.

Member Function Documentation

◆ handleNewData()

virtual void crypto_trader::protocols::Strategy::handleNewData ( const nlohmann::json & data)
pure virtual

Handles new market data received by the strategy.

Parameters
dataThe new market data, typically in JSON format.

Implemented in crypto_trader::strategies::HodlStrategy.

Member Data Documentation

◆ d_emit

common::Emit crypto_trader::protocols::Strategy::d_emit
protected

Function to emit trading actions.


The documentation for this class was generated from the following files:
  • /home/runner/work/crypto_trader/crypto_trader/protocols/strategy.h
  • /home/runner/work/crypto_trader/crypto_trader/protocols/strategy.cpp