* Cancels all order of a given symbol * @param {string} symbol - the symbol to cancel all orders for * @return {undefined}
(symbol: string, params: Dict = {})
| 5464 | * @return {undefined} |
| 5465 | */ |
| 5466 | async mgCancelOrders(symbol: string, params: Dict = {}) { |
| 5467 | // signedRequest(this.sapi + 'v1/margin/openOrders', { symbol: symbol }, function (error, json) { |
| 5468 | // if (json.length === 0) { |
| 5469 | // if (callback) return callback.call(this, 'No orders present for this symbol', {}, symbol); |
| 5470 | // } |
| 5471 | // for (let obj of json) { |
| 5472 | // let quantity = obj.origQty - obj.executedQty; |
| 5473 | // this.options.log('cancel order: ' + obj.side + ' ' + symbol + ' ' + quantity + ' @ ' + obj.price + ' #' + obj.orderId); |
| 5474 | // signedRequest(this.sapi + 'v1/margin/order', { symbol: symbol, orderId: obj.orderId }, function (error, data) { |
| 5475 | // if (callback) return callback.call(this, error, data, symbol); |
| 5476 | // }, 'DELETE'); |
| 5477 | // } |
| 5478 | // }); // to do check this |
| 5479 | return await this.privateSapiRequest('v1/margin/openOrders', this.extend({ symbol: symbol }, params), 'DELETE'); |
| 5480 | } |
| 5481 | |
| 5482 | /** |
| 5483 | * Transfer from main account to margin account |
nothing calls this directly
no test coverage detected