edit a trade order https://bybit-exchange.github.io/docs/v5/order/amend-order https://bybit-exchange.github.io/docs/v5/websocket/trade/guideline#createamendcancel-order :param str id: cancel order id :param str symbol: unified symbol of the market to create
(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={})
| 281 | return await self.watch(url, requestId, request, requestId, True) |
| 282 | |
| 283 | async def edit_order_ws(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}): |
| 284 | """ |
| 285 | edit a trade order |
| 286 | |
| 287 | https://bybit-exchange.github.io/docs/v5/order/amend-order |
| 288 | https://bybit-exchange.github.io/docs/v5/websocket/trade/guideline#createamendcancel-order |
| 289 | |
| 290 | :param str id: cancel order id |
| 291 | :param str symbol: unified symbol of the market to create an order in |
| 292 | :param str type: 'market' or 'limit' |
| 293 | :param str side: 'buy' or 'sell' |
| 294 | :param float amount: how much of currency you want to trade in units of base currency |
| 295 | :param float price: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| 296 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 297 | :param float [params.triggerPrice]: The price that a trigger order is triggered at |
| 298 | :param float [params.stopLossPrice]: The price that a stop loss order is triggered at |
| 299 | :param float [params.takeProfitPrice]: The price that a take profit order is triggered at |
| 300 | :param dict [params.takeProfit]: *takeProfit object in params* containing the triggerPrice that the attached take profit order will be triggered |
| 301 | :param float [params.takeProfit.triggerPrice]: take profit trigger price |
| 302 | :param dict [params.stopLoss]: *stopLoss object in params* containing the triggerPrice that the attached stop loss order will be triggered |
| 303 | :param float [params.stopLoss.triggerPrice]: stop loss trigger price |
| 304 | :param str [params.triggerBy]: 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for triggerPrice |
| 305 | :param str [params.slTriggerBy]: 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for stopLoss |
| 306 | :param str [params.tpTriggerby]: 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for takeProfit |
| 307 | :returns dict: an `order structure <https://docs.ccxt.com/?id=order-structure>` |
| 308 | """ |
| 309 | await self.load_markets() |
| 310 | orderRequest = self.edit_order_request(id, symbol, type, side, amount, price, params) |
| 311 | url = self.urls['api']['ws']['private']['trade'] |
| 312 | await self.authenticate(url) |
| 313 | requestId = str(self.request_id()) |
| 314 | request = { |
| 315 | 'op': 'order.amend', |
| 316 | 'reqId': requestId, |
| 317 | 'args': [ |
| 318 | orderRequest, |
| 319 | ], |
| 320 | 'header': { |
| 321 | 'X-BAPI-TIMESTAMP': str(self.milliseconds()), |
| 322 | 'X-BAPI-RECV-WINDOW': str(self.options['recvWindow']), |
| 323 | }, |
| 324 | } |
| 325 | return await self.watch(url, requestId, request, requestId, True) |
| 326 | |
| 327 | async def cancel_order_ws(self, id: str, symbol: Str = None, params={}): |
| 328 | """ |
nothing calls this directly
no test coverage detected