hs

package module
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: MIT Imports: 10 Imported by: 32

README

hs

hs golang utils lib

Documentation

Index

Constants

View Source
const (
	GateIO = "gate"
	MXC    = "mxc"
	OKEx   = "okex"
	Huobi  = "huobi"
)

Variables

This section is empty.

Functions

func ConnectMongo added in v0.6.0

func ConnectMongo(ctx context.Context, conf MongoConf) (*mongo.Database, error)

func IsDuplicateError added in v0.6.0

func IsDuplicateError(err error) bool

func MergeTick added in v0.10.10

func MergeTick(o1, h1, l1, c1, v1, o2, h2, l2, c2, v2 float64) (open, high, low, close, volume float64)

func NewZapLogger added in v0.12.0

func NewZapLogger(level string, outputPaths, errorPaths []string) (*zap.Logger, error)

func ParseJsonConfig

func ParseJsonConfig(filename string, config interface{}) error

Types

type BroadcastConf added in v0.7.7

type BroadcastConf = broadcast.Config

type Candle added in v0.7.5

type Candle struct {
	Capacity  int
	Timestamp []int64 // unix timestamp in seconds
	Open      []float64
	High      []float64
	Low       []float64
	Close     []float64
	Volume    []float64
}

func NewCandle added in v0.7.5

func NewCandle(capacity int) Candle

func (*Candle) Add added in v0.7.5

func (c *Candle) Add(other Candle)

func (*Candle) Append added in v0.7.5

func (c *Candle) Append(ticker Ticker)

func (Candle) Length added in v0.7.5

func (c Candle) Length() int

func (*Candle) Truncate added in v0.7.13

func (c *Candle) Truncate()

type ExchangeConf added in v0.5.1

type ExchangeConf struct {
	Name    string // see const below
	Label   string
	Symbols []string
	Key     string
	Secret  string
	Host    string
}

type Grid added in v0.5.8

type Grid struct {
	Id         int
	Price      decimal.Decimal
	AmountBuy  decimal.Decimal
	AmountSell decimal.Decimal
	TotalBuy   decimal.Decimal
	Order      uint64
}

type GridStrategyConf added in v0.5.8

type GridStrategyConf struct {
	MaxPrice float64
	MinPrice float64
	Number   int
	Total    float64
}

type HistoryConf added in v0.6.1

type HistoryConf struct {
	Prefix   string
	Interval string
}

type LogConf added in v0.12.1

type LogConf struct {
	Level   string
	Outputs []string
	Errors  []string
}

type MongoConf added in v0.5.0

type MongoConf struct {
	// mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]
	URI         string `json:"uri"`
	Database    string `json:"database"`
	MaxPoolSize uint64 `json:"maxPoolSize"`
	MinPoolSize uint64 `json:"minPoolSize"`
	AppName     string `json:"appName"`
}

type MySQLConf added in v0.5.0

type MySQLConf struct {
	URI string `json:"uri"`
}

type RestGridStrategyConf added in v0.5.8

type RestGridStrategyConf struct {
	MaxPrice  float64
	MinPrice  float64
	Number    int
	Total     float64
	Rebalance bool
	Interval  string // sleep interval
}

type SQLiteConf added in v0.5.8

type SQLiteConf struct {
	Location string
}

type Ticker added in v0.7.5

type Ticker struct {
	Timestamp int64 // unix timestamp in seconds
	Open      float64
	High      float64
	Low       float64
	Close     float64
	Volume    float64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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