From 099f7ac8c367309718e37961aa8a55996081ea95 Mon Sep 17 00:00:00 2001 From: Sebastien Trudel Date: Sun, 20 Dec 2020 09:29:12 -0500 Subject: [PATCH] Test2 --- GetDaily.py | 27 +-------------------------- QuandlTests.py | 13 +++++++++++++ test.py | 1 + yfinancecharts.py | 20 ++++++++++++++++++++ 4 files changed, 35 insertions(+), 26 deletions(-) create mode 100644 QuandlTests.py create mode 100644 yfinancecharts.py diff --git a/GetDaily.py b/GetDaily.py index b740d8a..73f2ecb 100644 --- a/GetDaily.py +++ b/GetDaily.py @@ -2,40 +2,15 @@ #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") +data2 = yf.download(" CRSR VTI VOO DIS", period="1d") print(data2.tail()) - -msft = yf.Ticker("MSFT") - -# get stock info -msft.info \ No newline at end of file diff --git a/QuandlTests.py b/QuandlTests.py new file mode 100644 index 0000000..b09bb60 --- /dev/null +++ b/QuandlTests.py @@ -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)) diff --git a/test.py b/test.py index 67c4c6e..d02630d 100644 --- a/test.py +++ b/test.py @@ -1,4 +1,5 @@ #DataFlair - Make necessary imports +#Quandl stock data stop in 2018 import quandl import numpy as np from sklearn.linear_model import LinearRegression diff --git a/yfinancecharts.py b/yfinancecharts.py new file mode 100644 index 0000000..5260b16 --- /dev/null +++ b/yfinancecharts.py @@ -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() \ No newline at end of file