@@ -255,11 +255,13 @@ func (s *ModifyOrderService) Symbol(symbol string) *ModifyOrderService {
255
255
return s
256
256
}
257
257
258
+ // OrderID will prevail over OrigClientOrderID
258
259
func (s * ModifyOrderService ) OrderID (orderID int64 ) * ModifyOrderService {
259
260
s .orderID = & orderID
260
261
return s
261
262
}
262
263
264
+ // OrigClientOrderID is not necessary if OrderID is provided
263
265
func (s * ModifyOrderService ) OrigClientOrderID (origClientOrderID string ) * ModifyOrderService {
264
266
s .origClientOrderID = & origClientOrderID
265
267
return s
@@ -320,7 +322,16 @@ func (s *ModifyOrderService) modifyOrder(ctx context.Context, endpoint string, o
320
322
return data , header , nil
321
323
}
322
324
323
- // Do send request
325
+ // Do send request:
326
+ // - Either orderId or origClientOrderId must be sent, and the orderId will prevail if both are sent
327
+ // - Either price or priceMatch must be sent. Sending both will fail the request
328
+ // - When the new quantity or price doesn't satisfy PriceFilter / PercentPriceFilter / LotSizeFilter,
329
+ // amendment will be rejected and the order will stay as it is
330
+ // - However the order will be cancelled by the amendment in the following situations:
331
+ // -- when the order is in partially filled status and the new quantity <= executedQty
332
+ // -- when the order is TimeInForceTypeGTX and the new price will cause it to be executed immediately
333
+ // - One order can only be modified for less than 10000 times
334
+ // - Will set ModifyOrderResponse.SelfTradePreventionMode to "NONE"
324
335
func (s * ModifyOrderService ) Do (ctx context.Context , opts ... RequestOption ) (res * ModifyOrderResponse , err error ) {
325
336
data , _ , err := s .modifyOrder (ctx , "/fapi/v1/order" , opts ... )
326
337
if err != nil {
0 commit comments