trade

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balance

type Balance struct {
	Asset  string          `json:"asset"`
	Free   decimal.Decimal `json:"free"`
	Locked decimal.Decimal `json:"locked"`
}

type IExchange

type IExchange interface {
	AccountBalance() ([]Balance, error)
	AccountSymbolBalance(symbol string) (decimal.Decimal, error)
	BalanceToUSD(bal *Balance) (decimal.Decimal, error)
	GetRate(symbol ...string) (decimal.Decimal, error)
	BuyAll(symbol ...string) *Status
	SellAll(symbol ...string) *Status
	GetOrder(id int64, symbol ...string) (*Order, error)
	CancelOrder(id int64, symbol ...string) error
	GetKlines(opts ...draw.KlinesOpts) (*draw.Klines, error)
	SetScale(scale string)
	SetSymbol(symbol string)
}

type Opts added in v0.1.0

type Opts struct {
	Symbol string
	Scale  string
}

type Order

type Order struct {
	Symbol           string
	OrderID          int64
	Price            decimal.Decimal
	OrigQuantity     decimal.Decimal
	ExecutedQuantity decimal.Decimal
	Status           string
	Side             string
}

type Status

type Status struct {
	Order *Order
	Done  bool
	Err   error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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