mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-27 09:15:15 +00:00
csvsource: fix okex timestamp parsing (it's milliseconds)
This commit is contained in:
parent
ee4455fa85
commit
a4f220749a
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user