0

I have been running the same code always, but suddenly this morning it stopped working

%matplotlib inline
import bt

data = bt.get("TLT", start="2022-06-01", end="2022-06-30")

After running this code, this is the error message I receive: enter image description here

Thank you!

I have "conda update --all" and the same error is still showing

FFFAR
  • 141
  • 5
  • It looks like `bt.get` fetch some external data, and the data has an unexpected format. Is it possible to fetch another data and see if it works? – kmkurn Dec 17 '22 at 11:07
  • I have tried with: - AAPL - MSFT - TSLA And still the same error – FFFAR Dec 17 '22 at 12:30
  • Then it seems the data format has been changed upstream as your code is never changed. Maybe start by checking if this is true. – kmkurn Dec 17 '22 at 19:29
  • I have tried to run the same code in google colabs, instead of my jupyter notebook, and it seems the package "bt" is now unable to read the data from the yahoo finance page url. RemoteDataError: Unable to read URL: https://finance.yahoo.com/quote/TLT/history?period1=1654056000&period2=1656647999&interval=1d&frequency=1d&filter=history – FFFAR Dec 18 '22 at 20:21
  • Does that answer your question? If so, consider posting it as your own answer. – kmkurn Dec 18 '22 at 22:11

1 Answers1

0

After trying to run the same code in google colabs, instead of my jupyter notebook, I realized "bt" package is unable to read the data from the yahoo finance page url. It might need an enhancement. In the meantime, I have been able to simulate what bt.get should have been doing with the following code:

data = yf.download("TLT", start="2022-06-01", end="2022-06-30")
data = data.rename(columns = {'Adj Close':'tlt'})
data = data.drop(['Open', 'High', 'Low', 'Close', 'Volume'], axis=1)
FFFAR
  • 141
  • 5