INNER CODE UNIT · Python

cancel_all_orders

nkaz001/sample-trading-bot · tradingbot/binancefutures.py:316

    async def cancel_all_orders(self):
        resp = await self.__curl_binancefutures(verb='DELETE', path='/v1/allOpenOrders', query={'symbol': self.symbol})
        # if resp['code'] == '200':
        #     now = time.time()
        #     for order_id, order in self.open_orders_ws.items():
        #         if order['status'] != 'PENDING_NEW':
        #             order['updateTime'] = now * 1000
        #             order['status'] = 'CANCEL_ALL'
        return resp

    async def open_orders(self):
        return await self.__curl_binancefutures(verb='GET', path='/v1/openOrders')

    async def open_position(self):
        response = await self.__curl_binancefutures(verb='GET', path='/v2/positionRisk')
        for position in response:
            side = position['positionSide']
            if 'BOTH' == side:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…