algorithms

package
v1.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuyDecisionTree

func BuyDecisionTree(
	configData *types.Config,
	marketData *types.Market,
	sessionData *types.Session) (is bool, buyQuantityFiat float64)

BuyDecisionTree BUY decision routine

func ParseSymbolFiat added in v1.6.4

func ParseSymbolFiat(sessionData *types.Session) (symbolFiat string, err error)

ParseSymbolFiat parse and selects the symbol fiat coin to be used from sessionData.Symbol

func SellDecisionTree

func SellDecisionTree(
	configData *types.Config,
	marketData *types.Market,
	sessionData *types.Session) (is bool, order types.Order)

SellDecisionTree SELL decision routine

func UpdatePendingOrders

func UpdatePendingOrders(
	configData *types.Config,
	sessionData *types.Session)

UpdatePendingOrders Routine to fill rogue and not up-to-date orders in the db and update

func WsBookTicker

func WsBookTicker(
	viperData *types.ViperData,
	configData *types.Config,
	marketData *types.Market,
	sessionData *types.Session,
	wg *sync.WaitGroup)

WsBookTicker Pushes any update to the best bid or asks price or quantity in real-time for a specified symbol

func WsKline

func WsKline(
	configData *types.Config,
	marketData *types.Market,
	sessionData *types.Session,
	wg *sync.WaitGroup)

WsKline The Kline/Candlestick Stream push updates to the current klines/candlestick every second.

func WsUserDataServe

func WsUserDataServe(
	configData *types.Config,
	sessionData *types.Session,
	wg *sync.WaitGroup)

WsUserDataServe Websocket routine to retrieve realtime user data

Types

type Channel

type Channel struct {
	// contains filtered or unexported fields
}

Channel control goroutine channel operations

func (Channel) SetTrue

func (c Channel) SetTrue(sessionData *types.Session)

SetTrue set all goroutines to stop

func (Channel) Stop

func (c Channel) Stop(
	channel chan struct{},
	wg *sync.WaitGroup,
	configData *types.Config,
	sessionData *types.Session)

Stop a websocket channel and decrease waiting group

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL