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

Method edit_order

python/ccxt/async_support/exmo.py:2088–2128  ·  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

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

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