|
crypto_trader
Cryptocurrency Trading Bot API Documentation
|
Implements a "Buy and Hold" strategy with dynamic adjustments based on price movements. More...
#include <hodl.h>


Public Member Functions | |
| HodlStrategy (const HodlStrategyConfig &config, traders::EventPositionManager &positionManager) | |
| Constructs a HodlStrategy. | |
| ~HodlStrategy () | |
| Destructor for HodlStrategy. | |
| void | handleNewData (const nlohmann::json &data) override |
| Handles new market data received by the strategy. | |
| void | on_trade (const common::Trade &trade) override |
| Callback method invoked when a trade is executed. | |
| void | on_position_update (const std::string &symbol, double new_position) override |
| Callback method invoked when a position update occurs. | |
| Public Member Functions inherited from crypto_trader::protocols::Strategy | |
| Strategy (const common::Emit &emit) | |
| Constructs a Strategy object. | |
| virtual | ~Strategy ()=0 |
| Destructor for the Strategy interface. | |
| Public Member Functions inherited from crypto_trader::protocols::Observer | |
| virtual | ~Observer ()=default |
Additional Inherited Members | |
| Protected Attributes inherited from crypto_trader::protocols::Strategy | |
| common::Emit | d_emit |
| Function to emit trading actions. | |
Implements a "Buy and Hold" strategy with dynamic adjustments based on price movements.
This strategy aims to buy on dips and potentially sell on significant gains.
| crypto_trader::strategies::HodlStrategy::HodlStrategy | ( | const HodlStrategyConfig & | config, |
| traders::EventPositionManager & | positionManager ) |
Constructs a HodlStrategy.
| config | The configuration for the strategy. |
| positionManager | A reference to the EventPositionManager for tracking positions. |
| crypto_trader::strategies::HodlStrategy::~HodlStrategy | ( | ) |
Destructor for HodlStrategy.
|
overridevirtual |
Handles new market data received by the strategy.
| data | The new market data, typically in JSON format. |
Implements crypto_trader::protocols::Strategy.
|
overridevirtual |
Callback method invoked when a position update occurs.
| symbol | The trading symbol. |
| new_position | The updated position quantity for the symbol. |
Implements crypto_trader::protocols::Observer.
|
overridevirtual |
Callback method invoked when a trade is executed.
| trade | The details of the executed trade. |
Implements crypto_trader::protocols::Observer.