import yfinance as yf
import pandas as pd
tickers = ['MSFT', 'AAPL', 'AMZN', 'GOOG', 'NFLX']
daily_df = yf.download(
tickers = tickers,
start='2020-01-01',
end='2020-07-01',
auto_adjust=True,
group_by='ticker'
)
daily_df.head(2)
daily_df.tail(2)
Retrieve minute bars for MSFT on September 1, 2020 during trading hours.
tickers = ['MSFT']
minute_df = yf.download(
tickers = tickers,
start='2020-09-01', # start is inclusive
end='2020-09-02', # end is exclusive
auto_adjust=True,
group_by='ticker',
interval='1m'
)
minute_df.head(2)
minute_df.tail(2)