From 67754b0f937cff48a5ec900b923c43606c7ba1a1 Mon Sep 17 00:00:00 2001 From: moshferatu Date: Fri, 22 Nov 2024 11:42:26 -0800 Subject: [PATCH] Increase max days when looking up daily data by 1 to account for the scenario where daily data is available for the current date --- iqfeed/iqfeed.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iqfeed/iqfeed.py b/iqfeed/iqfeed.py index c3e2219..32dfd60 100644 --- a/iqfeed/iqfeed.py +++ b/iqfeed/iqfeed.py @@ -42,11 +42,10 @@ def _get_daily_data(symbol: str, max_days: int) -> pd.DataFrame: data = data.replace(',\n','\n')[:-1] data = StringIO(data) - return pd.read_csv(data, index_col = False, - names=['Date', 'High', 'Low', 'Open', 'Close', 'Total Volume', 'Period Volume']) + return pd.read_csv(data, index_col = False, names = iqfeed_columns) def get_daily_data(symbol: str, start_date: datetime, end_date: datetime) -> pd.DataFrame: - max_days = (datetime.today() - start_date).days + max_days = (datetime.today() - start_date).days + 1 data = _get_daily_data(symbol, max_days) # Filter data between start_date and end_date