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

Method edit_order

python/ccxt/async_support/gate.py:4540–4597  ·  view source on GitHub ↗

edit a trade order, gate currently only supports the modification of the price or amount fields https://www.gate.com/docs/developers/apiv4/en/#amend-single-order https://www.gate.com/docs/developers/apiv4/en/#amend-single-order-2 :param str id: order id :pa

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

Source from the content-addressed store, hash-verified

4538 return self.extend(request, params)
4539
4540 async def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
4541 """
4542 edit a trade order, gate currently only supports the modification of the price or amount fields
4543
4544 https://www.gate.com/docs/developers/apiv4/en/#amend-single-order
4545 https://www.gate.com/docs/developers/apiv4/en/#amend-single-order-2
4546
4547 :param str id: order id
4548 :param str symbol: unified symbol of the market to create an order in
4549 :param str type: 'market' or 'limit'
4550 :param str side: 'buy' or 'sell'
4551 :param float amount: how much of the currency you want to trade in units of the base currency
4552 :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
4553 :param dict [params]: extra parameters specific to the exchange API endpoint
4554 :param bool [params.unifiedAccount]: set to True for editing an order in a unified account
4555 :returns dict: an `order structure <https://docs.ccxt.com/?id=order-structure>`
4556 """
4557 await self.load_markets()
4558 await self.load_unified_status()
4559 market = self.market(symbol)
4560 extendedRequest = self.edit_order_request(id, symbol, type, side, amount, price, params)
4561 response: dict
4562 if market['spot']:
4563 response = await self.privateSpotPatchOrdersOrderId(extendedRequest)
4564 else:
4565 response = await self.privateFuturesPutSettleOrdersOrderId(extendedRequest)
4566 #
4567 # {
4568 # "id": "243233276443",
4569 # "text": "apiv4",
4570 # "create_time": "1670908873",
4571 # "update_time": "1670914102",
4572 # "create_time_ms": 1670908873077,
4573 # "update_time_ms": 1670914102241,
4574 # "status": "open",
4575 # "currency_pair": "ADA_USDT",
4576 # "type": "limit",
4577 # "account": "spot",
4578 # "side": "sell",
4579 # "amount": "10",
4580 # "price": "0.6",
4581 # "time_in_force": "gtc",
4582 # "iceberg": "0",
4583 # "left": "10",
4584 # "fill_price": "0",
4585 # "filled_total": "0",
4586 # "fee": "0",
4587 # "fee_currency": "USDT",
4588 # "point_fee": "0",
4589 # "gt_fee": "0",
4590 # "gt_maker_fee": "0",
4591 # "gt_taker_fee": "0",
4592 # "gt_discount": False,
4593 # "rebated_fee": "0",
4594 # "rebated_fee_currency": "ADA"
4595 # }
4596 #
4597 return self.parse_order(response, market)

Callers

nothing calls this directly

Calls 7

load_unified_statusMethod · 0.95
edit_order_requestMethod · 0.95
parse_orderMethod · 0.95
load_marketsMethod · 0.45
marketMethod · 0.45

Tested by

no test coverage detected