Skip to content

Commit

Permalink
Merge pull request #1853 from anywhy/fix_binance_futures_order_price
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s authored Dec 6, 2024
2 parents c810fb6 + 6ff6f85 commit 215e5b1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/exchange/binance/convert_futures.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ func toGlobalFuturesOrders(futuresOrders []*futures.Order, isIsolated bool) (ord
}

func toGlobalFuturesOrder(futuresOrder *futures.Order, isIsolated bool) (*types.Order, error) {
orderPrice := futuresOrder.Price
if orderPrice == "" {
orderPrice = futuresOrder.AvgPrice
}

return &types.Order{
SubmitOrder: types.SubmitOrder{
ClientOrderID: futuresOrder.ClientOrderID,
Expand All @@ -123,7 +128,7 @@ func toGlobalFuturesOrder(futuresOrder *futures.Order, isIsolated bool) (*types.
ReduceOnly: futuresOrder.ReduceOnly,
ClosePosition: futuresOrder.ClosePosition,
Quantity: fixedpoint.MustNewFromString(futuresOrder.OrigQuantity),
Price: fixedpoint.MustNewFromString(futuresOrder.Price),
Price: fixedpoint.MustNewFromString(orderPrice),
TimeInForce: types.TimeInForce(futuresOrder.TimeInForce),
},
Exchange: types.ExchangeBinance,
Expand Down

0 comments on commit 215e5b1

Please sign in to comment.