41 lines
864 B
Python
41 lines
864 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 quandl
|
|
import numpy as np
|
|
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))
|
|
|
|
#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(
|
|
x=df.index,
|
|
open=df["Open"],
|
|
high=df["High"],
|
|
low=df["Low"],
|
|
close=df["Close"],
|
|
)
|
|
)
|
|
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 |