|
crypto_trader
Cryptocurrency Trading Bot API Documentation
|
Abstract base class defining the interface for trade execution. More...
#include <executor.h>


Public Member Functions | |
| virtual | ~Executor ()=default |
| Destructor for the Executor interface. | |
| virtual common::TradeResult | buy (const std::string_view &product, double quantity)=0 |
| Executes a buy order for a specified product and quantity. | |
| virtual common::TradeResult | sell (const std::string_view &product, double quantity)=0 |
| Executes a sell order for a specified product and quantity. | |
| virtual double | getBalance (const std::string_view ¤cy) const =0 |
| Retrieves the current balance of a specified currency. | |
| virtual std::optional< double > | getPosition (const std::string_view &product) const =0 |
| Retrieves the current position (holdings) for a given product. | |
| virtual void | processTickerData (const std::string_view &product, double price, const T::Timestamp ×tamp)=0 |
| Processes new ticker data to update the executor's internal state. | |
Abstract base class defining the interface for trade execution.
| T | The MarketData type that the executor processes. |
|
virtualdefault |
Destructor for the Executor interface.
|
pure virtual |
Executes a buy order for a specified product and quantity.
| product | The symbol of the product to buy (e.g., "BTC-USD"). |
| quantity | The amount of the product to buy. |
Implemented in crypto_trader::executors::PaperTradingExecutor< T >, and crypto_trader::executors::RealTradingExecutor< T >.
|
pure virtual |
Retrieves the current balance of a specified currency.
| currency | The symbol of the currency (e.g., "USD", "BTC"). |
Implemented in crypto_trader::executors::PaperTradingExecutor< T >, and crypto_trader::executors::RealTradingExecutor< T >.
|
pure virtual |
Retrieves the current position (holdings) for a given product.
| product | The symbol of the product (e.g., "BTC-USD"). |
Implemented in crypto_trader::executors::PaperTradingExecutor< T >, and crypto_trader::executors::RealTradingExecutor< T >.
|
pure virtual |
Processes new ticker data to update the executor's internal state.
| product | The symbol of the product for the ticker. |
| price | The latest price of the product. |
| timestamp | The timestamp of the ticker data. |
Implemented in crypto_trader::executors::PaperTradingExecutor< T >, and crypto_trader::executors::RealTradingExecutor< T >.
|
pure virtual |
Executes a sell order for a specified product and quantity.
| product | The symbol of the product to sell (e.g., "BTC-USD"). |
| quantity | The amount of the product to sell. |
Implemented in crypto_trader::executors::PaperTradingExecutor< T >, and crypto_trader::executors::RealTradingExecutor< T >.