Increase max days when looking up daily data by 1 to account for the scenario where daily data is available for the current date
This commit is contained in:
parent
4e36de7bf0
commit
67754b0f93
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user