Make `ib` client's `.get_head_time()` (only) expect an fqsn

ib_1m_hist
Tyler Goodlet 2022-10-26 10:22:37 -04:00
parent dc1edeecda
commit 2f7b272d8c
1 changed files with 7 additions and 4 deletions

View File

@ -778,11 +778,14 @@ class Client:
async def get_head_time( async def get_head_time(
self, self,
contract: Contract, fqsn: str,
) -> datetime:
"""Return the first datetime stamp for ``contract``.
""" ) -> datetime:
'''
Return the first datetime stamp for ``contract``.
'''
contract = (await self.find_contracts(fqsn))[0]
return await self.ib.reqHeadTimeStampAsync( return await self.ib.reqHeadTimeStampAsync(
contract, contract,
whatToShow='TRADES', whatToShow='TRADES',