Documentation ¶
Index ¶
- Variables
- type Bot
- func (b *Bot) BuyIfDecreaseByPercent(symbolPriceChan <-chan string, symbolPriceCloseChan chan<- struct{}, ...) error
- func (b *Bot) GetAccountBalance(holdingSymbol string) (money.Bimoney, error)
- func (b *Bot) GetCurrentCryptoPrice(symbol string) (<-chan string, chan<- struct{}, error)
- func (b *Bot) SellIfIncreaseByPercent(symbolPriceChan <-chan string, symbolPriceCloseChan chan<- struct{}, ...) error
- type BuyConfig
- type Config
- type SellConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var (
InsufficientFunds = errors.New("account has insufficient balance for requested action")
)
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct { Config Config // contains filtered or unexported fields }
func (*Bot) BuyIfDecreaseByPercent ¶
func (*Bot) GetAccountBalance ¶
func (*Bot) GetCurrentCryptoPrice ¶
func (*Bot) SellIfIncreaseByPercent ¶
func (b *Bot) SellIfIncreaseByPercent(symbolPriceChan <-chan string, symbolPriceCloseChan chan<- struct{}, sellCfg SellConfig) error
type BuyConfig ¶
type BuyConfig struct { BuySymbol string `json:"buy_symbol"` BuyWithHoldingSymbol string `json:"buy_with_holding_symbol"` TargetPriceToBuyAt string `json:"target_price_to_buy_at"` PercentageDiff int `json:"percentage_diff"` BuyForPercentOfHoldings uint `json:"buy_for_percent_of_holdings"` BuyQuantity string `json:"buy_quantity"` }
type Config ¶
type Config struct { APIKey string `json:"api_key"` APISecret string `json:"api_secret"` Sell []SellConfig `json:"Sell"` Buy []BuyConfig `json:"Buy"` }
type SellConfig ¶
type SellConfig struct { SellHoldingSymbol string `json:"sell_holding_symbol"` SellForSymbol string `json:"sell_for_symbol"` TargetPriceToSellAt string `json:"target_price_to_sell_at"` PercentageDiff uint `json:"percentage_diff"` SellPercentOfHoldings uint `json:"sell_percent_of_holdings"` SellQuantityOfHoldings string `json:"sell_quantity"` }
Click to show internal directories.
Click to hide internal directories.