52 lines
961 B
Python
52 lines
961 B
Python
#Get stock symbols in a file
|
|
#Get daily quote at end of day
|
|
#Send email, see Jupyter thing on other laptop for sending email
|
|
|
|
#Quandl no more data after 2018 for some reason
|
|
|
|
import numpy as np
|
|
import yfinance as yf
|
|
import plotly.graph_objects as go
|
|
|
|
#Yfinance tests
|
|
|
|
|
|
|
|
msft = yf.Ticker("MSFT")
|
|
|
|
# get stock info
|
|
msft.info
|
|
|
|
# get historical market data
|
|
hist = msft.history(period="max")
|
|
|
|
# show major holders
|
|
print(msft.major_holders)
|
|
|
|
# show institutional holders
|
|
print(msft.institutional_holders)
|
|
|
|
|
|
|
|
# show sustainability
|
|
print(msft.sustainability)
|
|
|
|
# show analysts recommendations
|
|
print(msft.recommendations)
|
|
|
|
# show next event (earnings, etc)
|
|
print(msft.calendar)
|
|
|
|
|
|
# show ISIN code - *experimental*
|
|
# ISIN = International Securities Identification Number
|
|
print(msft.isin)
|
|
|
|
|
|
# show options expirations
|
|
print(msft.options)
|
|
|
|
# get option chain for specific expiration
|
|
opt = msft.option_chain('2020-12-18')
|
|
print(opt)
|
|
# data available via: opt.calls, opt.puts |