mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
Merge pull request #1095 from c9s/fix/maxapi/query-trades-by-order-id
FIX: filter wrong order id from self-trade trades
This commit is contained in:
commit
6a6d7a6293
|
@ -192,7 +192,13 @@ func (e *Exchange) QueryOrderTrades(ctx context.Context, q types.OrderQuery) ([]
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
trades = append(trades, localTrades...)
|
// because self-trades will contains ask and bid orders in its struct
|
||||||
|
// we need to make sure the trade's order is what we want
|
||||||
|
for _, localTrade := range localTrades {
|
||||||
|
if localTrade.OrderID == uint64(orderID) {
|
||||||
|
trades = append(trades, localTrade)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensure everything is sorted ascending
|
// ensure everything is sorted ascending
|
||||||
|
|
Loading…
Reference in New Issue
Block a user