diff --git a/iqfeed/iqfeed.py b/iqfeed/iqfeed.py index b586dcc..5377ea1 100644 --- a/iqfeed/iqfeed.py +++ b/iqfeed/iqfeed.py @@ -93,8 +93,11 @@ def get_historical_data(symbol: str, interval: int, date: datetime = None, data = data.replace(',\n','\n')[:-1] data = StringIO(data) - return pd.read_csv(data, index_col = False, + data = pd.read_csv(data, index_col = False, names=['Date', 'High', 'Low', 'Open', 'Close', 'Total Volume', 'Period Volume']) + data['Date'] = pd.to_datetime(data['Date']) + data['Date'] = data['Date'].dt.date + return data if __name__ == '__main__': symbols = ['SPY']