Skip to content

Commit 215e5b1

Browse files
authored
Merge pull request #1853 from anywhy/fix_binance_futures_order_price
2 parents c810fb6 + 6ff6f85 commit 215e5b1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/exchange/binance/convert_futures.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ func toGlobalFuturesOrders(futuresOrders []*futures.Order, isIsolated bool) (ord
114114
}
115115

116116
func toGlobalFuturesOrder(futuresOrder *futures.Order, isIsolated bool) (*types.Order, error) {
117+
orderPrice := futuresOrder.Price
118+
if orderPrice == "" {
119+
orderPrice = futuresOrder.AvgPrice
120+
}
121+
117122
return &types.Order{
118123
SubmitOrder: types.SubmitOrder{
119124
ClientOrderID: futuresOrder.ClientOrderID,
@@ -123,7 +128,7 @@ func toGlobalFuturesOrder(futuresOrder *futures.Order, isIsolated bool) (*types.
123128
ReduceOnly: futuresOrder.ReduceOnly,
124129
ClosePosition: futuresOrder.ClosePosition,
125130
Quantity: fixedpoint.MustNewFromString(futuresOrder.OrigQuantity),
126-
Price: fixedpoint.MustNewFromString(futuresOrder.Price),
131+
Price: fixedpoint.MustNewFromString(orderPrice),
127132
TimeInForce: types.TimeInForce(futuresOrder.TimeInForce),
128133
},
129134
Exchange: types.ExchangeBinance,

0 commit comments

Comments
 (0)