diff --git a/GetDaily.py b/GetDaily.py index 052c9af..b740d8a 100644 --- a/GetDaily.py +++ b/GetDaily.py @@ -10,12 +10,14 @@ import yfinance as yf import plotly.graph_objects as go #Quandl test -quandl.ApiConfig.api_key = "sEj_5XNt1kyxi27p5nre" -amazon = quandl.get("WIKI/AMZN") -print(amazon.head()) -print(amazon.tail(10)) +#quandl.ApiConfig.api_key = "sEj_5XNt1kyxi27p5nre" +#amazon = quandl.get("WIKI/AMZN") +#print(amazon.head()) +#print(amazon.tail(10)) #Yfinance tests +#https://pypi.org/project/yfinance/ + df = yf.download("TSLA", start="2018-11-01", end="2020-10-18", interval="1d") fig = go.Figure( data=go.Ohlc( @@ -26,4 +28,14 @@ fig = go.Figure( close=df["Close"], ) ) -fig.show() \ No newline at end of file +fig.show() + + +data2 = yf.download("SPY AAPL", start="2017-01-01", end="2017-04-30") +print(data2.tail()) + + +msft = yf.Ticker("MSFT") + +# get stock info +msft.info \ No newline at end of file diff --git a/TempTests.py b/TempTests.py new file mode 100644 index 0000000..b945559 --- /dev/null +++ b/TempTests.py @@ -0,0 +1,52 @@ +#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 \ No newline at end of file