This commit is contained in:
Sebastien Trudel 2020-12-20 09:29:12 -05:00
parent b2db4c099c
commit 099f7ac8c3
4 changed files with 35 additions and 26 deletions

View File

@ -2,40 +2,15 @@
#Get daily quote at end of day #Get daily quote at end of day
#Send email, see Jupyter thing on other laptop for sending email #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 numpy as np
import yfinance as yf import yfinance as yf
import plotly.graph_objects as go 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 #Yfinance tests
#https://pypi.org/project/yfinance/ #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(" CRSR VTI VOO DIS", period="1d")
data2 = yf.download("SPY AAPL", start="2017-01-01", end="2017-04-30")
print(data2.tail()) print(data2.tail())
msft = yf.Ticker("MSFT")
# get stock info
msft.info

13
QuandlTests.py Normal file
View File

@ -0,0 +1,13 @@
#Quandl no more stock 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))

View File

@ -1,4 +1,5 @@
#DataFlair - Make necessary imports #DataFlair - Make necessary imports
#Quandl stock data stop in 2018
import quandl import quandl
import numpy as np import numpy as np
from sklearn.linear_model import LinearRegression from sklearn.linear_model import LinearRegression

20
yfinancecharts.py Normal file
View File

@ -0,0 +1,20 @@
import quandl
import numpy as np
import yfinance as yf
import plotly.graph_objects as go
#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()