kucoin: fix klines ordering

This commit is contained in:
c9s 2022-01-19 18:33:54 +08:00
parent 0b8e5852eb
commit 4d921b0b36

View File

@ -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
}