simple

package
v0.0.0-...-4b5a006 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBGetLastProfit

func DBGetLastProfit(db *sql.DB) (float32, error)

func DBInsertReceipt

func DBInsertReceipt(receipt *Receipt, db *sql.DB) error

func DBOpen

func DBOpen(symbol string) (*sql.DB, error)

func Start

func Start(configPath string, keys map[string]string)

Types

type BotConfig

type BotConfig struct {
	Base                 string `json:"base"`
	Quote                string `json:"quote"`
	PercentChangeBuy     string `json:"percentChangeBuy"`
	PercentChangeSell    string `json:"percentChangeSell"`
	TradingBalance       string `json:"tradingBalance"`
	ServerBaseEndpoint   string `json:"serverBaseEndpoint"`
	WsServerBaseEndpoint string `json:"wsServerBaseEndpoint"`
	Testnet              bool   `json:"testnet"`
	LogDB                bool   `json:"logDB"`
	DecisionIntervalMs   int    `json:"decisionintervalMs"`
	FirstTx              Tx     `json:"firstTx"`
}

type Receipt

type Receipt struct {
	TxType    Tx
	Quantity  float32
	Price     float32
	Profit    float32
	Timestamp int64
}

type State

type State struct {
	Symbol         string
	SymbolStepSize string
	LastBuyPrice   float64
	LastSellPrice  float64
	TradingBalance float64
	LastTx         Tx
}

type Tx

type Tx string
const (
	TxFirst Tx = "first"
	TxSell  Tx = "sell"
	TxBuy   Tx = "buy"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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