mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +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 {
|
if err != nil {
|
||||||
return nil, ErrInvalidPriceFormat
|
return nil, ErrInvalidPriceFormat
|
||||||
}
|
}
|
||||||
|
|
||||||
qty, err := fixedpoint.NewFromString(row[2])
|
qty, err := fixedpoint.NewFromString(row[2])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidVolumeFormat
|
return nil, ErrInvalidVolumeFormat
|
||||||
}
|
}
|
||||||
|
|
||||||
side := types.SideTypeBuy
|
side := types.SideTypeBuy
|
||||||
isBuyerMaker := false
|
isBuyerMaker := false
|
||||||
if row[1] == "sell" {
|
if row[1] == "sell" {
|
||||||
side = types.SideTypeSell
|
side = types.SideTypeSell
|
||||||
isBuyerMaker = true
|
isBuyerMaker = true
|
||||||
}
|
}
|
||||||
|
|
||||||
n, err := strconv.ParseFloat(row[4], 64) // startTime
|
n, err := strconv.ParseFloat(row[4], 64) // startTime
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrInvalidTimeFormat
|
return nil, ErrInvalidTimeFormat
|
||||||
}
|
}
|
||||||
ts := time.Unix(int64(n), 0)
|
|
||||||
|
ts := time.UnixMilli(int64(n))
|
||||||
return &CsvTick{
|
return &CsvTick{
|
||||||
TradeID: uint64(id),
|
TradeID: uint64(id),
|
||||||
Exchange: types.ExchangeOKEx,
|
Exchange: types.ExchangeOKEx,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user