Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

reqMktData sends an empty ticker after a while #700

Open
coolworld2049 opened this issue Feb 26, 2024 · 0 comments
Open

reqMktData sends an empty ticker after a while #700

coolworld2049 opened this issue Feb 26, 2024 · 0 comments

Comments

@coolworld2049
Copy link

coolworld2049 commented Feb 26, 2024

@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:
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant