MCPcopy Create free account
hub / github.com/ccxt/ccxt / edit_order

Method edit_order

python/ccxt/exmo.py:2087–2127  ·  view source on GitHub ↗

*margin only* edit a trade order https://documenter.getpostman.com/view/10287440/SzYXWKPi#f27ee040-c75f-4b59-b608-d05bd45b7899 # margin :param str id: order id :param str symbol: unified CCXT market symbol :param str type: not used by exmo editOrder

(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={})

Source from the content-addressed store, hash-verified

2085 return result
2086
2087 def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
2088 """
2089 *margin only* edit a trade order
2090
2091 https://documenter.getpostman.com/view/10287440/SzYXWKPi#f27ee040-c75f-4b59-b608-d05bd45b7899 # margin
2092
2093 :param str id: order id
2094 :param str symbol: unified CCXT market symbol
2095 :param str type: not used by exmo editOrder
2096 :param str side: not used by exmo editOrder
2097 :param float [amount]: how much of the currency you want to trade in units of the base currency
2098 :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2099 :param dict [params]: extra parameters specific to the exchange API endpoint
2100 :param float [params.triggerPrice]: stop price for stop-market and stop-limit orders
2101 :param str params['marginMode']: must be set to isolated
2102
2103 EXCHANGE SPECIFIC PARAMETERS
2104 :param int [params.distance]: distance for trailing stop orders
2105 :param int [params.expire]: expiration timestamp in UTC timezone for the order. order will not be expired if expire is 0
2106 :param str [params.comment]: optional comment for order. up to 50 latin symbols, whitespaces, underscores
2107 :returns dict: an `order structure <https://docs.ccxt.com/?id=order-structure>`
2108 """
2109 self.load_markets()
2110 market = self.market(symbol)
2111 marginMode = None
2112 marginMode, params = self.handle_margin_mode_and_params('editOrder', params)
2113 if marginMode != 'isolated':
2114 raise BadRequest(self.id + ' editOrder() can only be used for isolated margin orders')
2115 triggerPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'stop_price'])
2116 params = self.omit(params, ['triggerPrice', 'stopPrice'])
2117 request = {
2118 'order_id': id, # id of the open order
2119 }
2120 if amount is not None:
2121 request['quantity'] = amount
2122 if price is not None:
2123 request['price'] = self.price_to_precision(market['symbol'], price)
2124 if triggerPrice is not None:
2125 request['stop_price'] = self.price_to_precision(market['symbol'], triggerPrice)
2126 response = self.privatePostMarginUserOrderUpdate(self.extend(request, params))
2127 return self.parse_order(response)
2128
2129 def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
2130 """

Callers

nothing calls this directly

Calls 10

parse_orderMethod · 0.95
BadRequestClass · 0.90
safe_number_nMethod · 0.80
load_marketsMethod · 0.45
marketMethod · 0.45
omitMethod · 0.45
price_to_precisionMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected