grid

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

Documentation

Index

Constants

View Source
const (
	ClientId = "ws-grid-v0.1.0"
)
View Source
const CollName = "grid_status"

Variables

This section is empty.

Functions

This section is empty.

Types

type WsGrid

type WsGrid struct {
	ExchangeName string              `bson:"exchange"`
	Label        string              `bson:"label"`
	Pair         string              `bson:"pair"`
	APIKeyPair   exchange.APIKeyPair `bson:"-"`

	ExClient   exchange.Exchange `bson:"-"`
	MongClient *mongo.Database   `bson:"-"`
	GormClient *gorm.DB          `bson:"-"`

	Percentage      float64 `bson:"-"`
	Fund            float64 `bson:"-"`
	MaxGrid         int     `bson:"-"`
	PricePrecision  int     `bson:"-"`
	AmountPrecision int     `bson:"-"`

	Base          float64 `bson:"base"`
	Position      int     `bson:"position"`
	UpTimes       int     `bson:"upTimes"`
	DownTimes     int     `bson:"downTimes"`
	TopOrderId    uint64  `bson:"topOrderId"`
	BottomOrderId uint64  `bson:"bottomOrderId"`
}

func (*WsGrid) CancelOrders

func (g *WsGrid) CancelOrders()

func (*WsGrid) Init

func (g *WsGrid) Init(ctx context.Context) error

func (*WsGrid) OrderUpdateHandler

func (g *WsGrid) OrderUpdateHandler(resp interface{})

Response handler

func (*WsGrid) PlaceOrders

func (g *WsGrid) PlaceOrders(ctx context.Context, last float64)

func (*WsGrid) Run

func (g *WsGrid) Run(ctx context.Context) error

func (*WsGrid) Shutdown

func (g *WsGrid) Shutdown(ctx context.Context) error

func (*WsGrid) Truncate

func (g *WsGrid) Truncate(value float64, precision int) float64

Jump to

Keyboard shortcuts

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