def __init__(self, **kwargs):
    'Initialize.'
    self.cb = kwargs['cb']
    state = None
    self._platform = kwargs.get('platform')
    self._symbols = kwargs.get('symbols')
    self._strategy = kwargs.get('strategy')
    self._account = kwargs.get('account')
    self._access_key = kwargs.get('access_key')
    self._secret_key = kwargs.get('secret_key')
    self._subaccount_name = kwargs.get('subaccount_name')
    if (not self._platform):
        state = State(self._platform, self._account, 'param platform miss')
    elif (self._account and ((not self._access_key) or (not self._secret_key))):
        state = State(self._platform, self._account, 'param access_key or secret_key miss')
    elif (not self._strategy):
        state = State(self._platform, self._account, 'param strategy miss')
    elif (not self._symbols):
        state = State(self._platform, self._account, 'param symbols miss')
    if state:
        logger.error(state, caller=self)
        SingleTask.run(self.cb.on_state_update_callback, state)
        return
    self._host = 'https://ftx.com'
    self._wss = 'wss://ftx.com'
    url = (self._wss + '/ws')
    super(FTXTrader, self).__init__(url, send_hb_interval=15, **kwargs)
    self.heartbeat_msg = {'op': 'ping'}
    self._rest_api = FTXRestAPI(self._host, self._access_key, self._secret_key, self._subaccount_name)
    self._orderbooks: DefaultDict[(str, Dict[(str, DefaultDict[(float, float)])])] = defaultdict((lambda : {side: defaultdict(float) for side in {'bids', 'asks'}}))
    self._assets: DefaultDict[str:Dict[(str, float)]] = defaultdict((lambda : {k: 0.0 for k in {'free', 'locked', 'total'}}))
    self._syminfo: DefaultDict[str:Dict[(str, Any)]] = defaultdict(dict)
    if (self._account != None):
        self.initialize()
    if (self.cb.on_kline_update_callback or self.cb.on_orderbook_update_callback or self.cb.on_trade_update_callback or self.cb.on_ticker_update_callback):
        FTXMarket(**kwargs)
Initialize.
def __init__(self, **kwargs):
    
    self.cb = kwargs['cb']
    state = None
    self._platform = kwargs.get('platform')
    self._symbols = kwargs.get('symbols')
    self._strategy = kwargs.get('strategy')
    self._account = kwargs.get('account')
    self._access_key = kwargs.get('access_key')
    self._secret_key = kwargs.get('secret_key')
    self._subaccount_name = kwargs.get('subaccount_name')
    if (not self._platform):
        state = State(self._platform, self._account, 'param platform miss')
    elif (self._account and ((not self._access_key) or (not self._secret_key))):
        state = State(self._platform, self._account, 'param access_key or secret_key miss')
    elif (not self._strategy):
        state = State(self._platform, self._account, 'param strategy miss')
    elif (not self._symbols):
        state = State(self._platform, self._account, 'param symbols miss')
    if state:
        logger.error(state, caller=self)
        SingleTask.run(self.cb.on_state_update_callback, state)
        return
    self._host = 'https://ftx.com'
    self._wss = 'wss://ftx.com'
    url = (self._wss + '/ws')
    super(FTXTrader, self).__init__(url, send_hb_interval=15, **kwargs)
    self.heartbeat_msg = {'op': 'ping'}
    self._rest_api = FTXRestAPI(self._host, self._access_key, self._secret_key, self._subaccount_name)
    self._orderbooks: DefaultDict[(str, Dict[(str, DefaultDict[(float, float)])])] = defaultdict((lambda : {side: defaultdict(float) for side in {'bids', 'asks'}}))
    self._assets: DefaultDict[str:Dict[(str, float)]] = defaultdict((lambda : {k: 0.0 for k in {'free', 'locked', 'total'}}))
    self._syminfo: DefaultDict[str:Dict[(str, Any)]] = defaultdict(dict)
    if (self._account != None):
        self.initialize()
    if (self.cb.on_kline_update_callback or self.cb.on_orderbook_update_callback or self.cb.on_trade_update_callback or self.cb.on_ticker_update_callback):
        FTXMarket(**kwargs)