Open coolworld2049 opened 8 months ago
@cache(ttl=CACHING_TTL) async def get_stock_contract(self, symbol: str) -> Contract | None: stk_contract = ib_insync.Stock() stk_contract.symbol = symbol stk_contract.exchange = "SMART" stk_contract.currency = "USD" stk_contract.primaryExchange = "NASDAQ" contracts = await self.qualifyContractsAsync(stk_contract) if len(contracts) < 1: return stk_contract return contracts[0]
... contract = await self.get_stock_contract(symbol) ticker = self.reqMktData(contract) self.sleep(timeout) ...
logs:
logs: