Simple Code to Get ETFs from Sectors #24
Locked
Dabs212
started this conversation in
Show and tell
Replies: 1 comment
-
Should now be even more efficient 🙃 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
#pip install macrodatabase
#pin install --upgrade ta
#pip install financedatabase
#pip install thepassiveinvestor
import financedatabase as fd
import yfinance as yf
import pandas as pd
#from ta.volatility import BollingerBands
import matplotlib.pyplot as plt
equities_sectors = fd.show_options('equities', 'sectors')
sectors = equities_sectors[1:]
print(equities_sectors[1:])
for sector in sectors:
try:
etf1 = fd.select_etfs(category=sector)
print(sector, ": ", etf1.keys())
except ValueError:
continue
Beta Was this translation helpful? Give feedback.
All reactions