尝试在报错时补齐缺少的candle序列
This commit is contained in:
parent
373359dde0
commit
3905624278
@ -462,6 +462,9 @@ func MakeMaX(cr *core.Core, cl *core.Candle, count int) (error, int) {
|
||||
// cdl, err := cr.GetLastCandleListOfCoin(cl.InstID, cl.Period, count, lastTime)
|
||||
cdl, err := GetRangeCandleSortedSet(cr, setName, count, lastTime)
|
||||
if err != nil {
|
||||
to, _ := cr.PeriodToMinutes(cl.Period)
|
||||
to = tsi + to*ToInt64(count)
|
||||
InvokeCandle(cr, cl.InstID, cl.Period, tsi, to)
|
||||
return err, 0
|
||||
}
|
||||
|
||||
|
@ -93,6 +93,8 @@ func ToInt64(val interface{}) int64 {
|
||||
vali, _ = strconv.ParseInt(val.(string), 10, 64)
|
||||
} else if reflect.TypeOf(val).Name() == "float64" {
|
||||
vali = int64(val.(float64))
|
||||
} else if reflect.TypeOf(val).Name() == "int" {
|
||||
vali = int64(val.(int))
|
||||
}
|
||||
return vali
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user