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

Method edit_order

python/ccxt/bitget.py:5457–5653  ·  view source on GitHub ↗

edit a trade order https://www.bitget.com/api-doc/spot/plan/Modify-Plan-Order https://www.bitget.com/api-doc/spot/trade/Cancel-Replace-Order https://www.bitget.com/api-doc/contract/trade/Modify-Order https://www.bitget.com/api-doc/contract/plan/Modify-Tpsl-O

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

Source from the content-addressed store, hash-verified

5455 return self.parse_orders(both, market)
5456
5457 def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
5458 """
5459 edit a trade order
5460
5461 https://www.bitget.com/api-doc/spot/plan/Modify-Plan-Order
5462 https://www.bitget.com/api-doc/spot/trade/Cancel-Replace-Order
5463 https://www.bitget.com/api-doc/contract/trade/Modify-Order
5464 https://www.bitget.com/api-doc/contract/plan/Modify-Tpsl-Order
5465 https://www.bitget.com/api-doc/contract/plan/Modify-Plan-Order
5466 https://www.bitget.com/api-doc/uta/trade/Modify-Order
5467 https://www.bitget.com/api-doc/uta/strategy/Modify-Strategy-Order
5468
5469 :param str id: cancel order id
5470 :param str symbol: unified symbol of the market to create an order in
5471 :param str type: 'market' or 'limit'
5472 :param str side: 'buy' or 'sell'
5473 :param float amount: how much you want to trade in units of the base currency
5474 :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
5475 :param dict [params]: extra parameters specific to the exchange API endpoint
5476 :param float [params.triggerPrice]: the price that a trigger order is triggered at
5477 :param float [params.stopLossPrice]: *swap only* The price at which a stop loss order is triggered at
5478 :param float [params.takeProfitPrice]: *swap only* The price at which a take profit order is triggered at
5479 :param dict [params.takeProfit]: *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered(perpetual swap markets only)
5480 :param float [params.takeProfit.triggerPrice]: *swap only* take profit trigger price
5481 :param dict [params.stopLoss]: *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered(perpetual swap markets only)
5482 :param float [params.stopLoss.triggerPrice]: *swap only* stop loss trigger price
5483 :param float [params.stopLoss.price]: *swap only* the execution price for a stop loss attached to a trigger order
5484 :param float [params.takeProfit.price]: *swap only* the execution price for a take profit attached to a trigger order
5485 :param str [params.stopLoss.type]: *swap only* the type for a stop loss attached to a trigger order, 'fill_price', 'index_price' or 'mark_price', default is 'mark_price'
5486 :param str [params.takeProfit.type]: *swap only* the type for a take profit attached to a trigger order, 'fill_price', 'index_price' or 'mark_price', default is 'mark_price'
5487 :param str [params.trailingPercent]: *swap and future only* the percent to trail away from the current market price, rate can not be greater than 10
5488 :param str [params.trailingTriggerPrice]: *swap and future only* the price to trigger a trailing stop order, default uses the price argument
5489 :param str [params.newTriggerType]: *swap and future only* 'fill_price', 'mark_price' or 'index_price'
5490 :param boolean [params.uta]: set to True for the unified trading account(uta), defaults to False
5491 :returns dict: an `order structure <https://docs.ccxt.com/?id=order-structure>`
5492 """
5493 self.load_markets()
5494 market = self.market(symbol)
5495 request = {
5496 # 'orderId': id,
5497 }
5498 clientOrderId = self.safe_string_2(params, 'clientOrderId', 'clientOid')
5499 if clientOrderId is not None:
5500 params = self.omit(params, ['clientOrderId'])
5501 request['clientOid'] = clientOrderId
5502 else:
5503 request['orderId'] = id
5504 isMarketOrder = type == 'market'
5505 triggerPrice = self.safe_value_2(params, 'stopPrice', 'triggerPrice')
5506 isTriggerOrder = triggerPrice is not None
5507 stopLossPrice = self.safe_value(params, 'stopLossPrice')
5508 isStopLossOrder = stopLossPrice is not None
5509 takeProfitPrice = self.safe_value(params, 'takeProfitPrice')
5510 isTakeProfitOrder = takeProfitPrice is not None
5511 stopLoss = self.safe_value(params, 'stopLoss')
5512 takeProfit = self.safe_value(params, 'takeProfit')
5513 hasStopLoss = stopLoss is not None
5514 hasTakeProfit = takeProfit is not None

Callers

nothing calls this directly

Calls 15

parse_orderMethod · 0.95
ExchangeErrorClass · 0.90
InvalidOrderClass · 0.90
NotSupportedClass · 0.90
BadRequestClass · 0.90
safe_string_2Method · 0.80
safe_value_2Method · 0.80
safe_valueMethod · 0.80
safe_stringMethod · 0.80
safe_boolMethod · 0.80

Tested by

no test coverage detected