INNER CODE UNIT · Python
__init__
nkaz001/sample-trading-bot · tradingbot/binancefutures.py:17
def __init__(self, api_key, api_secret, symbol='btcusdt', testnet=True, orderIDPrefix='bot_bf_', postOnly=False, timeout=10):
self.api_key = api_key
self.api_secret = api_secret
self.symbol = symbol
self.client = aiohttp.ClientSession(headers={ 'Content-Type': 'application/json' })
self.closed = False
self.depth = {}
self.pending_messages = None
self.prev_u = None
self.testnet = testnet
self.timeout = timeout
self.postOnly = postOnly
self.orderIDPrefix = orderIDPrefix
self.last_price = 0
self.open_orders_ws = {}
self.retries = 0 # initialize counter
def open_orders_active(self):