mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 00:05:15 +00:00
fix binance exchange query futures order
This commit is contained in:
parent
a91685920e
commit
714275fedb
|
@ -796,13 +796,24 @@ func (e *Exchange) QueryOrder(ctx context.Context, q types.OrderQuery) (*types.O
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var order *binance.Order
|
|
||||||
if e.IsMargin {
|
if e.IsMargin {
|
||||||
order, err = e.client.NewGetMarginOrderService().Symbol(q.Symbol).OrderID(orderID).Do(ctx)
|
order, err := e.client.NewGetMarginOrderService().Symbol(q.Symbol).OrderID(orderID).Do(ctx)
|
||||||
} else {
|
if err != nil {
|
||||||
order, err = e.client.NewGetOrderService().Symbol(q.Symbol).OrderID(orderID).Do(ctx)
|
return nil, err
|
||||||
|
}
|
||||||
|
return toGlobalOrder(order, e.IsMargin)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if e.IsFutures {
|
||||||
|
order, err := e.futuresClient.NewGetOrderService().Symbol(q.Symbol).OrderID(orderID).Do(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return toGlobalFuturesOrder(order, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
order, err := e.client.NewGetOrderService().Symbol(q.Symbol).OrderID(orderID).Do(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user