gridh

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Quote decimal.Decimal // quote currency, USDT
	Long  decimal.Decimal // long etf, btc3l
	Short decimal.Decimal // short etf btc3s
	Fee   decimal.Decimal // fee reserve
}

type Config

type Config struct {
	Exchange hs.ExchangeConf
	Mongo    hs.MongoConf
	Strategy StrategyConf
}

type GridStatus

type GridStatus struct {
	Id         int
	Base       bool
	Symbol     string
	Total      string
	Price      string
	AmountBuy  string `bson:"amountBuy"`
	AmountSell string `bson:"amountSell"`
	Order      uint64
}

type StrategyConf

type StrategyConf struct {
	Number    int     // number of grid
	Total     float64 // total fund
	Spread    float64 // 0.01 = 1%
	Rebalance bool
	Interval  string // sleep interval
}

type Trader

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

A grid strategy with hedging using REST API

func New

func New(configFilename string) *Trader

func (*Trader) Close

func (t *Trader) Close(ctx context.Context)

func (*Trader) Init

func (t *Trader) Init(ctx context.Context)

func (*Trader) Print

func (t *Trader) Print(ctx context.Context) error

func (*Trader) Trade

func (t *Trader) Trade(ctx context.Context) error

Jump to

Keyboard shortcuts

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