db

package
v0.0.0-...-089aa6e Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Client *gorm.DB

Functions

func Init

func Init(client *gorm.DB)

Types

type Fund

type Fund struct {
	ID        uint
	TotalFund decimal.Decimal
	Strategy  string `gorm:"uniqueindex;type:varchar(50);"`
}

Fund 资金记录

type KLine

type KLine struct {
	ID        int64
	Symbol    string `gorm:"index:idx_symbol_time"`
	OpenTime  time.Time
	CloseTime time.Time `gorm:"index:idx_symbol_time"`
	Open      decimal.Decimal
	Close     decimal.Decimal
	High      decimal.Decimal
	Low       decimal.Decimal
	Vol       decimal.Decimal
	Amount    decimal.Decimal
	Num       decimal.Decimal
	BuyVolume decimal.Decimal
	BuyAmount decimal.Decimal
}

KLine 分钟K线

type Order

type Order struct {
	ID          uint
	OrderId     string
	Side        Side
	Vol         decimal.Decimal
	Price       decimal.Decimal
	Amount      decimal.Decimal
	Symbol      string
	TimeInForce string
	Type        PriceType
	Timestamp   time.Time
	Strategy    string
	CurrentFund decimal.Decimal
	Commission  decimal.Decimal
}

Order 订单记录

type PriceType

type PriceType string
const (
	LIMIT  PriceType = "LIMIT"
	MARKET PriceType = "MARKET"
)

type Side

type Side string
const (
	BUY  Side = "BUY"
	SELL Side = "SELL"
)

Jump to

Keyboard shortcuts

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