addisonlynch / iexfinance

Python SDK for IEX Cloud
https://addisonlynch.github.io/iexfinance
Apache License 2.0
648 stars 136 forks source link

Getting empty result with get_historical_data #268

Open grey949 opened 3 years ago

grey949 commented 3 years ago

Summary (include Python version)

Python 3.9.7

For any stock symbol on 10/07/2021, I get an empty dataframe. However, if I place a range that includes 10/07/2021 I get that data. Here is what I'm seeing:

from iexfinance.stocks import get_historical_data

Using only 2021-10-07: get_historical_data("TSLA", '2021-10-07', '2021-10-07', token="*********************")

Empty DataFrame Columns: [close, high, low, open, symbol, volume, id, key, subkey, updated, changeOverTime, marketChangeOverTime, uOpen, uClose, uHigh, uLow, uVolume, fOpen, fClose, fHigh, fLow, fVolume, label, change, changePercent] Index: []

Using a range to include 2021-10-7 will return data: get_historical_data("TSLA", '2021-10-06', '2021-10-08', token="*********************")

        close    high     low    open symbol    volume                 id   key subkey        updated changeOverTime  ...   uHigh    uLow   uVolume   fOpen  fClose   fHigh    fLow   fVolume      label change changePercent

2021-10-06 782.75 786.66 773.22 776.2 TSLA 14632768 HISTORICAL_PRICES TSLA 1633570592000 0.053499 ... 786.66 773.22 14632768 776.2 782.75 786.66 773.22 14632768 Oct 6, 21 2.16 0.0028 2021-10-07 793.61 805 783.38 785.46 TSLA 19195782 HISTORICAL_PRICES TSLA 1633656865000 0.068116 ... 805 783.38 19195782 785.46 793.61 805 783.38 19195782 Oct 7, 21 10.86 0.0139 2021-10-08 785.49 796.38 780.91 796.21 TSLA 16738604 HISTORICAL_PRICES TSLA 1633742318000 0.057187 ... 796.38 780.91 16738604 796.21 785.49 796.38 780.91 16738604 Oct 8, 21 -8.12 -0.0102

[3 rows x 25 columns]

Date/time of issue

10/12/2021

Expected behavior

Get populated DataFrame for the date of 10/07/2021 for any stock symbol

Actual behavior

Getting empty DataFrame for all stock symbols for the date of 10/07/2021.

grey949 commented 3 years ago

Having this issue again, but now noticing a pattern. Get_Historical_data() doesn't seem to work for any dates that are 5 days ago. For example, today is 10/17/2021 and now I can't run anything for 10/12/2021