add lastUpdate to candle and max

This commit is contained in:
zhangkun9038@dingtalk.com 2024-12-18 12:25:43 +08:00
parent 06a3db9d19
commit 9e9ff51894
2 changed files with 24 additions and 22 deletions

View File

@ -19,19 +19,20 @@ import (
) )
type Candle struct { type Candle struct {
Id string `json:"_id"` Id string `json:"_id"`
core *Core core *Core
InstID string InstID string
Period string Period string
Data []interface{} Data []interface{}
From string From string
Timestamp time.Time Timestamp time.Time
Open float64 LastUpdate time.Time `json:"lastUpdate"`
High float64 Open float64
Low float64 High float64
Close float64 Low float64
VolCcy float64 Close float64
Confirm bool VolCcy float64
Confirm bool
} }
type Sample interface { type Sample interface {
SetToKey(cr *Core) ([]interface{}, error) SetToKey(cr *Core) ([]interface{}, error)

19
maX.go
View File

@ -18,15 +18,16 @@ type MaXList struct {
} }
type MaX struct { type MaX struct {
InstID string `json:"instID"` InstID string `json:"instID"`
Period string `json:"period"` Period string `json:"period"`
Timestamp time.Time `json:"timestamp"` Timestamp time.Time `json:"timestamp"`
KeyName string `json:"keyName"` LastUpdate time.Time `json:"lastUpdate"`
Data []interface{} `json:"data"` KeyName string `json:"keyName"`
Count int `json:"count,number"` Data []interface{} `json:"data"`
Ts int64 `json:"ts,number"` Count int `json:"count,number"`
AvgVal float64 `json:"avgVal,number"` Ts int64 `json:"ts,number"`
From string `json:"from,string"` AvgVal float64 `json:"avgVal,number"`
From string `json:"from,string"`
} }
type WillMX struct { type WillMX struct {