Skip to content

Commit 097bc43

Browse files
committed
csvsource: fix okex timestamp parsing (it's milliseconds)
1 parent 6076d4d commit 097bc43

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/datasource/csvsource/csv_tick_decoder.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,21 +158,25 @@ func OKExCSVTickDecoder(row []string, index int) (*CsvTick, error) {
158158
if err != nil {
159159
return nil, ErrInvalidPriceFormat
160160
}
161+
161162
qty, err := fixedpoint.NewFromString(row[2])
162163
if err != nil {
163164
return nil, ErrInvalidVolumeFormat
164165
}
166+
165167
side := types.SideTypeBuy
166168
isBuyerMaker := false
167169
if row[1] == "sell" {
168170
side = types.SideTypeSell
169171
isBuyerMaker = true
170172
}
173+
171174
n, err := strconv.ParseFloat(row[4], 64) // startTime
172175
if err != nil {
173176
return nil, ErrInvalidTimeFormat
174177
}
175-
ts := time.Unix(int64(n), 0)
178+
179+
ts := time.UnixMilli(int64(n))
176180
return &CsvTick{
177181
TradeID: uint64(id),
178182
Exchange: types.ExchangeOKEx,

0 commit comments

Comments
 (0)