Merge pull request #493 from austin362667/fix/binance-futures

binance: add submit futures order ReduceOnly
This commit is contained in:
Yo-An Lin 2022-03-22 20:08:19 +08:00 committed by GitHub
commit fd89b90ab8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -840,7 +840,8 @@ func (e *Exchange) submitFuturesOrder(ctx context.Context, order types.SubmitOrd
req := e.futuresClient.NewCreateOrderService(). req := e.futuresClient.NewCreateOrderService().
Symbol(order.Symbol). Symbol(order.Symbol).
Type(orderType). Type(orderType).
Side(futures.SideType(order.Side)) Side(futures.SideType(order.Side)).
ReduceOnly(order.ReduceOnly)
clientOrderID := newFuturesClientOrderID(order.ClientOrderID) clientOrderID := newFuturesClientOrderID(order.ClientOrderID)
if len(clientOrderID) > 0 { if len(clientOrderID) > 0 {
@ -909,6 +910,7 @@ func (e *Exchange) submitFuturesOrder(ctx context.Context, order types.SubmitOrd
TimeInForce: response.TimeInForce, TimeInForce: response.TimeInForce,
Type: response.Type, Type: response.Type,
Side: response.Side, Side: response.Side,
ReduceOnly: response.ReduceOnly,
}, true) }, true)
return createdOrder, err return createdOrder, err