model

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Kline

type Kline struct {
	KlineType   KlineType
	StartTime   int64           //周期的开始时间
	EndTime     int64           //周期的结束时间
	Amount      decimal.Decimal //成交额
	Volume      decimal.Decimal //成交量
	Open        decimal.Decimal //开盘价
	High        decimal.Decimal //高
	Low         decimal.Decimal //低
	Close       decimal.Decimal //收盘价
	Range       string          //涨跌幅
	InitMatchID int64
}

func (*Kline) CastToMysqlData

func (k *Kline) CastToMysqlData(symbolInfo *define.SymbolInfo) *model.Kline

func (*Kline) CastToRedisData added in v1.2.0

func (k *Kline) CastToRedisData(symbolInfo *define.SymbolInfo, matchID int64) *RedisModel

func (*Kline) CastToWsData

func (k *Kline) CastToWsData(symbolInfo *define.SymbolInfo) commonWs.Kline

func (*Kline) Copy added in v1.2.0

func (k *Kline) Copy() Kline

type KlineType

type KlineType pb.KlineType
const (
	Min1 KlineType = iota + 1
	Min5
	Min10
	Min15
	Min30
	Hour1
	Hour4
	Day1
	Week1
	Month1
)

func (KlineType) GetCycle

func (kt KlineType) GetCycle() int32

func (KlineType) String

func (kt KlineType) String() string

type MatchData

type MatchData struct {
	MessageID  pulsar.MessageID `json:"_"`
	MatchTime  int64            //撮合时间
	MatchID    int64            //撮合ID
	Volume     decimal.Decimal  //成交额
	Amount     decimal.Decimal  //成交量
	StartPrice decimal.Decimal  //本次撮合开始的价格
	EndPrice   decimal.Decimal  //本次撮合结束的价格
	Low        decimal.Decimal  //本次撮合的最高价
	High       decimal.Decimal  //本次撮合的最低价
}

type RedisModel added in v1.2.0

type RedisModel struct {
	model.Kline
	MatchID int64 `json:"match_id"`
}

type StoreKline

type StoreKline struct {
	Klines    []*Kline
	MessageID pulsar.MessageID
	IsHistory bool
	MatchID   int64
}

Jump to

Keyboard shortcuts

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