mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
max: ensure orders are sorted ascendingly
This commit is contained in:
parent
04a15340bc
commit
f284c35b81
|
@ -202,6 +202,11 @@ func (e *Exchange) QueryClosedOrders(ctx context.Context, symbol string, since,
|
|||
return orders, err
|
||||
}
|
||||
|
||||
// ensure everything is ascending ordered
|
||||
sort.Slice(maxOrders, func(i, j int) bool {
|
||||
return maxOrders[i].CreatedAtMs.Time().Before(maxOrders[j].CreatedAtMs.Time())
|
||||
})
|
||||
|
||||
log.Infof("%d orders", len(maxOrders))
|
||||
for _, maxOrder := range maxOrders {
|
||||
if maxOrder.CreatedAtMs.Time().Before(since) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user