candle ad timestap
This commit is contained in:
parent
1f703ce25c
commit
06a3db9d19
@ -178,12 +178,17 @@ func IsModOf(curInt int64, duration time.Duration) bool {
|
|||||||
func (core *Core) SaveCandle(instId string, period string, rsp *CandleData, dura time.Duration, withWs bool) {
|
func (core *Core) SaveCandle(instId string, period string, rsp *CandleData, dura time.Duration, withWs bool) {
|
||||||
leng := len(rsp.Data)
|
leng := len(rsp.Data)
|
||||||
for _, v := range rsp.Data {
|
for _, v := range rsp.Data {
|
||||||
|
|
||||||
candle := Candle{
|
candle := Candle{
|
||||||
InstID: instId,
|
InstID: instId,
|
||||||
Period: period,
|
Period: period,
|
||||||
Data: v,
|
Data: v,
|
||||||
From: "rest",
|
From: "rest",
|
||||||
}
|
}
|
||||||
|
data := candle.Data
|
||||||
|
tsi, _ := strconv.ParseInt(data[0].(string), 10, 64)
|
||||||
|
tm, _ := Int64ToTime(tsi)
|
||||||
|
candle.Timestamp = tm
|
||||||
//存到elasticSearch
|
//存到elasticSearch
|
||||||
candle.PushToWriteLogChan(core)
|
candle.PushToWriteLogChan(core)
|
||||||
//保存rest得到的candle
|
//保存rest得到的candle
|
||||||
|
Loading…
x
Reference in New Issue
Block a user