Created
July 18, 2020 04:56
-
-
Save andyfinity/9d0dbbafb520363c48b4dd3e7120d515 to your computer and use it in GitHub Desktop.
Example of how to use the yfinance library to fetch mutual fund pricing information.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yfinance as yf | |
# Tickers to watch | |
l = ['BIOPX', 'FBSOX', 'FSCSX'] | |
# Method 1 (includes lots of info that isn't shown) | |
for symbol in l: | |
tckr = yf.Ticker(symbol) | |
print(symbol, tckr.info['previousClose']) | |
# Method 2 (includes historical data) | |
data = yf.download(' '.join(l), start='2020-07-01', end='2020-07-16') | |
print(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment