From ab8629aa11477747e6ea676780c841d5952b926c Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sat, 16 Apr 2022 18:31:51 -0400 Subject: [PATCH] Make ib history client expect datetimes for input --- piker/brokers/ib.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/piker/brokers/ib.py b/piker/brokers/ib.py index f66f81c5..b337ea6c 100644 --- a/piker/brokers/ib.py +++ b/piker/brokers/ib.py @@ -295,6 +295,10 @@ class Client: global _enters # log.info(f'REQUESTING BARS {_enters} @ end={end_dt}') print(f'REQUESTING BARS {_enters} @ end={end_dt}') + + if not end_dt: + end_dt = '' + _enters += 1 contract = await self.find_contract(fqsn) @@ -1546,8 +1550,8 @@ async def open_history_client( async with open_client_proxy() as proxy: async def get_hist( - end_dt: str, - start_dt: str = '', + end_dt: Optional[datetime] = None, + start_dt: Optional[datetime] = None, ) -> tuple[np.ndarray, str]: