module Binance::Spot::Trade

def cancel_replace(symbol:, side:, type:, cancelReplaceMode:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-an-existing-order-and-send-a-new-order-trade -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000
  • :orderRateLimitExceededMode (String) -- DO_NOTHING (default)- will only attempt to cancel the order if account has not exceeded the unfilled order rate limit
  • :cancelRestrictions (String) -- ONLY_NEW - Cancel will succeed if the order status is NEW. ONLY_PARTIALLY_FILLED - Cancel will succeed if order status is PARTIALLY_FILLED
  • :selfTradePreventionMode (String) -- The allowed enums is dependent on what is configured on the symbo
  • :newOrderRespType (String) --
  • :icebergQty (Float) --
  • :trailingDelta (Integer) --
  • :stopPrice (Float) --
  • :strategyType (Integer) -- The value cannot be less than 1000000
  • :strategyId (Integer) --
  • :newClientOrderId (String) --
  • :cancelOrderId (Integer) --
  • :cancelOrigClientOrderId (String) --
  • :cancelNewClientOrderId (String) --
  • :price (Float) --
  • :quoteOrderQty (Float) --
  • :quantity (Float) --
  • :timeInForce (String) --

Parameters:
  • kwargs (Hash) --
  • cancelReplaceMode (String) -- STOP_ON_FAILURE or ALLOW_FAILURE
  • type (String) --
  • side (String) --
  • symbol (String) -- the symbol
def cancel_replace(symbol:, side:, type:, cancelReplaceMode:, **kwargs)
  Binance::Utils::Validation.require_param('symbol', symbol)
  Binance::Utils::Validation.require_param('side', side)
  Binance::Utils::Validation.require_param('type', type)
  Binance::Utils::Validation.require_param('cancelReplaceMode', cancelReplaceMode)
  @session.sign_request(:post, '/api/v3/order/cancelReplace',
                        params: kwargs.merge(
                          symbol: symbol,
                          side: side,
                          type: type,
                          cancelReplaceMode: cancelReplaceMode
                        ))
end