mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
binance: fix client order id checking
This commit is contained in:
parent
5fd0ab4cd3
commit
f487b53d9e
|
@ -522,13 +522,15 @@ func (e *Exchange) submitMarginOrder(ctx context.Context, order types.SubmitOrde
|
|||
return nil, err
|
||||
}
|
||||
|
||||
clientOrderID := newSpotClientOrderID(order.ClientOrderID)
|
||||
|
||||
req := e.Client.NewCreateMarginOrderService().
|
||||
Symbol(order.Symbol).
|
||||
Type(orderType).
|
||||
Side(binance.SideType(order.Side)).
|
||||
NewClientOrderID(clientOrderID)
|
||||
Side(binance.SideType(order.Side))
|
||||
|
||||
clientOrderID := newSpotClientOrderID(order.ClientOrderID)
|
||||
if len(clientOrderID) > 0 {
|
||||
req.NewClientOrderID(clientOrderID)
|
||||
}
|
||||
|
||||
// use response result format
|
||||
req.NewOrderRespType(binance.NewOrderRespTypeRESULT)
|
||||
|
@ -644,13 +646,16 @@ func (e *Exchange) submitSpotOrder(ctx context.Context, order types.SubmitOrder)
|
|||
return nil, err
|
||||
}
|
||||
|
||||
clientOrderID := newSpotClientOrderID(order.ClientOrderID)
|
||||
req := e.Client.NewCreateOrderService().
|
||||
Symbol(order.Symbol).
|
||||
Side(binance.SideType(order.Side)).
|
||||
NewClientOrderID(clientOrderID).
|
||||
Type(orderType)
|
||||
|
||||
clientOrderID := newSpotClientOrderID(order.ClientOrderID)
|
||||
if len(clientOrderID) > 0 {
|
||||
req.NewClientOrderID(clientOrderID)
|
||||
}
|
||||
|
||||
if len(order.QuantityString) > 0 {
|
||||
req.Quantity(order.QuantityString)
|
||||
} else if order.Market.Symbol != "" {
|
||||
|
|
Loading…
Reference in New Issue
Block a user