test
This commit is contained in:
parent
a4b2638ec2
commit
b2db4c099c
20
GetDaily.py
20
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(
|
||||
|
|
@ -27,3 +29,13 @@ fig = go.Figure(
|
|||
)
|
||||
)
|
||||
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
|
||||
|
|
@ -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
|
||||
Loading…
Reference in New Issue