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

Method edit_order

python/ccxt/delta.py:2017–2063  ·  view source on GitHub ↗

edit a trade order https://docs.delta.exchange/#edit-order :param str id: order id :param str symbol: unified symbol of the market to create an order in :param str type: 'market' or 'limit' :param str side: 'buy' or 'sell' :param float amoun

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

Source from the content-addressed store, hash-verified

2015 return self.parse_order(result, market)
2016
2017 def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
2018 """
2019 edit a trade order
2020
2021 https://docs.delta.exchange/#edit-order
2022
2023 :param str id: order id
2024 :param str symbol: unified symbol of the market to create an order in
2025 :param str type: 'market' or 'limit'
2026 :param str side: 'buy' or 'sell'
2027 :param float amount: how much of the currency you want to trade in units of the base currency
2028 :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency
2029 :param dict [params]: extra parameters specific to the exchange API endpoint
2030 :returns dict: an `order structure <https://docs.ccxt.com/?id=order-structure>`
2031 """
2032 self.load_markets()
2033 market = self.market(symbol)
2034 request = {
2035 'id': int(id),
2036 'product_id': market['numericId'],
2037 # "limit_price": self.price_to_precision(symbol, price),
2038 # "size": self.amount_to_precision(symbol, amount),
2039 }
2040 if amount is not None:
2041 request['size'] = int(self.amount_to_precision(symbol, amount))
2042 if price is not None:
2043 request['limit_price'] = self.price_to_precision(symbol, price)
2044 response = self.privatePutOrders(self.extend(request, params))
2045 #
2046 # {
2047 # "success": True,
2048 # "result": {
2049 # "id": "ashb1212",
2050 # "product_id": 27,
2051 # "limit_price": "9200",
2052 # "side": "buy",
2053 # "size": 100,
2054 # "unfilled_size": 50,
2055 # "user_id": 1,
2056 # "order_type": "limit_order",
2057 # "state": "open",
2058 # "created_at": "..."
2059 # }
2060 # }
2061 #
2062 result = self.safe_dict(response, 'result')
2063 return self.parse_order(result, market)
2064
2065 def cancel_order(self, id: str, symbol: Str = None, params={}):
2066 """

Callers

nothing calls this directly

Calls 8

load_marketsMethod · 0.95
parse_orderMethod · 0.95
safe_dictMethod · 0.80
privatePutOrdersMethod · 0.65
marketMethod · 0.45
amount_to_precisionMethod · 0.45
price_to_precisionMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected