crypto_trader
Cryptocurrency Trading Bot API Documentation
Loading...
Searching...
No Matches
crypto_trader::strategies::HodlStrategyConfig Class Reference

Configuration parameters for the HodlStrategy. More...

#include <hodl.h>

Collaboration diagram for crypto_trader::strategies::HodlStrategyConfig:
Collaboration graph

Public Types

enum  InitStrategy { e_BUY_IMMEDIATELY = 0 , e_SET_BASIS_PRICE = 1 }
 Defines the initial strategy behavior. More...

Public Member Functions

HodlStrategyConfigsetInitStrategy (const InitStrategy &initStrat)
 Sets the initial strategy behavior.
HodlStrategyConfigsetPercentUp (float percentUp)
 Sets the percentage increase for selling.
HodlStrategyConfigsetPercentDown (float percentDown)
 Sets the percentage decrease for buying.
HodlStrategyConfigsetEmit (const common::Emit &emit)
 Sets the emission callback function.
HodlStrategyConfigsetBuyAmount (double buyAmount)
 Sets the amount to use for buy orders.
const InitStrategyinitStrategy () const
 Gets the initial strategy behavior.
float percentUp () const
 Gets the percentage increase for selling.
float percentDown () const
 Gets the percentage decrease for buying.
const common::Emitemit () const
 Gets the emission callback function.
double buyAmount () const
 Gets the amount to use for buy orders.

Detailed Description

Configuration parameters for the HodlStrategy.

Member Enumeration Documentation

◆ InitStrategy

Defines the initial strategy behavior.

Enumerator
e_BUY_IMMEDIATELY 

Buy immediately when the strategy starts.

e_SET_BASIS_PRICE 

Set current price as basis and wait for dip.

Member Function Documentation

◆ buyAmount()

double crypto_trader::strategies::HodlStrategyConfig::buyAmount ( ) const
inline

Gets the amount to use for buy orders.

Returns
The buy amount.

◆ emit()

const common::Emit & crypto_trader::strategies::HodlStrategyConfig::emit ( ) const
inline

Gets the emission callback function.

Returns
The emission callback.

◆ initStrategy()

const HodlStrategyConfig::InitStrategy & crypto_trader::strategies::HodlStrategyConfig::initStrategy ( ) const
inline

Gets the initial strategy behavior.

Returns
The initial strategy.

◆ percentDown()

float crypto_trader::strategies::HodlStrategyConfig::percentDown ( ) const
inline

Gets the percentage decrease for buying.

Returns
The percentage down.

◆ percentUp()

float crypto_trader::strategies::HodlStrategyConfig::percentUp ( ) const
inline

Gets the percentage increase for selling.

Returns
The percentage up.

◆ setBuyAmount()

HodlStrategyConfig & crypto_trader::strategies::HodlStrategyConfig::setBuyAmount ( double buyAmount)
inline

Sets the amount to use for buy orders.

Parameters
buyAmountThe buy amount in base currency.
Returns
A reference to the updated configuration object.

◆ setEmit()

HodlStrategyConfig & crypto_trader::strategies::HodlStrategyConfig::setEmit ( const common::Emit & emit)
inline

Sets the emission callback function.

Parameters
emitThe callback function for emitting actions.
Returns
A reference to the updated configuration object.

◆ setInitStrategy()

HodlStrategyConfig & crypto_trader::strategies::HodlStrategyConfig::setInitStrategy ( const InitStrategy & initStrat)
inline

Sets the initial strategy behavior.

Parameters
initStratThe initial strategy to set.
Returns
A reference to the updated configuration object.

◆ setPercentDown()

HodlStrategyConfig & crypto_trader::strategies::HodlStrategyConfig::setPercentDown ( float percentDown)
inline

Sets the percentage decrease for buying.

Parameters
percentDownThe percentage (e.g., 5.0 for 5%).
Returns
A reference to the updated configuration object.

◆ setPercentUp()

HodlStrategyConfig & crypto_trader::strategies::HodlStrategyConfig::setPercentUp ( float percentUp)
inline

Sets the percentage increase for selling.

Parameters
percentUpThe percentage (e.g., 5.0 for 5%).
Returns
A reference to the updated configuration object.

The documentation for this class was generated from the following file:
  • /home/runner/work/crypto_trader/crypto_trader/strategies/hodl.h