csvsource: fix okex timestamp parsing (it's milliseconds)

This commit is contained in:
c9s 2023-12-14 16:00:46 +08:00
parent ee4455fa85
commit a4f220749a
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -158,21 +158,25 @@ func OKExCSVTickDecoder(row []string, index int) (*CsvTick, error) {
if err != nil {
return nil, ErrInvalidPriceFormat
}
qty, err := fixedpoint.NewFromString(row[2])
if err != nil {
return nil, ErrInvalidVolumeFormat
}
side := types.SideTypeBuy
isBuyerMaker := false
if row[1] == "sell" {
side = types.SideTypeSell
isBuyerMaker = true
}
n, err := strconv.ParseFloat(row[4], 64) // startTime
if err != nil {
return nil, ErrInvalidTimeFormat
}
ts := time.Unix(int64(n), 0)
ts := time.UnixMilli(int64(n))
return &CsvTick{
TradeID: uint64(id),
Exchange: types.ExchangeOKEx,