mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
kucoin: fix klines ordering
This commit is contained in:
parent
0b8e5852eb
commit
4d921b0b36
|
@ -3,6 +3,7 @@ package kucoin
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
|
@ -193,6 +194,10 @@ func (e *Exchange) QueryKLines(ctx context.Context, symbol string, interval type
|
|||
})
|
||||
}
|
||||
|
||||
sort.Slice(klines, func(i, j int) bool {
|
||||
return klines[i].StartTime.Before(klines[j].StartTime.Time())
|
||||
})
|
||||
|
||||
return klines, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user