INNER CODE UNIT · Python

open_position

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

    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:
                if position['symbol'].upper() == self.symbol.upper():
                    return position['positionAmt']
        return '0'

    async def open_user_data_stream(self):
        response = await self.__curl_binancefutures(verb='POST', path='/v1/listenKey')
        return response["listenKey"]

    async def keepalive_user_data_stream(self):
        return await self.__curl_binancefutures(verb='PUT', path='/v1/listenKey')

    async def connect(self):
        try:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…