mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-23 15:25:14 +00:00
max: group the request building statement
This commit is contained in:
parent
a7dcc39c22
commit
ddaa8f7343
|
@ -24,6 +24,7 @@ var log = logrus.WithField("exchange", "max")
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
_ = types.ExchangeTradeHistoryService(&Exchange{})
|
_ = types.ExchangeTradeHistoryService(&Exchange{})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Exchange struct {
|
type Exchange struct {
|
||||||
|
@ -290,13 +291,14 @@ func (e *Exchange) queryClosedOrdersByLastOrderID(
|
||||||
walletType = maxapi.WalletTypeMargin
|
walletType = maxapi.WalletTypeMargin
|
||||||
}
|
}
|
||||||
|
|
||||||
req := e.v3client.NewGetWalletOrderHistoryRequest(walletType).Market(market)
|
|
||||||
if lastOrderID == 0 {
|
if lastOrderID == 0 {
|
||||||
lastOrderID = 1
|
lastOrderID = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
req.FromID(lastOrderID)
|
req := e.v3client.NewGetWalletOrderHistoryRequest(walletType).
|
||||||
req.Limit(1000)
|
Market(market).
|
||||||
|
FromID(lastOrderID).
|
||||||
|
Limit(1000)
|
||||||
|
|
||||||
maxOrders, err := req.Do(ctx)
|
maxOrders, err := req.Do(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user