node

package
v0.14.17 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Users   []User
	Mongo   MongoConf
	MySQL   MySQLConf
	History History
	Grid    GridConf
}

type GridConf

type GridConf struct {
	Interval   string
	Percentage float64
	Fund       float64
	MaxGrid    int
}

type History

type History struct {
	Prefix   string
	Interval string `json:"interval"`
}

type MongoConf

type MongoConf struct {
	URI         string `json:"uri"`
	Database    string `json:"database"`
	MaxPoolSize uint64 `json:"maxPoolSize"`
	MinPoolSize uint64 `json:"minPoolSize"`
	AppName     string `json:"appName"`
}

type MySQLConf

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

type Node

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

func New

func New(configFilename string) *Node

func (*Node) Close

func (n *Node) Close()

func (*Node) Grid

func (n *Node) Grid(ctx context.Context) error

func (*Node) Init

func (n *Node) Init(ctx context.Context)

func (*Node) Profit

func (n *Node) Profit(ctx context.Context, label, start, end string) error

func (*Node) PullCandle

func (n *Node) PullCandle(ctx context.Context) error

func (*Node) Snapshot

func (n *Node) Snapshot(ctx context.Context, label string) error

type User

type User struct {
	Exchange string
	Label    string
	Pair     string // 交易对

	PricePrecision  int     `json:"pricePrecision"`
	AmountPrecision int     `json:"amountPrecision"`
	MinAmount       float64 `json:"minAmount"`

	APIKeyPair exchange.APIKeyPair `json:"APIKeyPair"`
}

type WsNode

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

func (*WsNode) Close

func (n *WsNode) Close()

func (*WsNode) Grid

func (n *WsNode) Grid(ctx context.Context) error

func (*WsNode) Init

func (n *WsNode) Init(ctx context.Context, cfg Config)

func (*WsNode) Snapshot

func (n *WsNode) Snapshot(ctx context.Context, label string) error

func (*WsNode) SubBalanceForEx

func (n *WsNode) SubBalanceForEx(ctx context.Context, ex exchange.Exchange, updateCh chan exchange.Balance)

func (*WsNode) SubscribeBalance

func (n *WsNode) SubscribeBalance(ctx context.Context, label string) error

Jump to

Keyboard shortcuts

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