This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import plotly.graph_objs as go | |
#Declare figure | |
fig = go.Figure() | |
#add a trace | |
fig.add_trace(go.Scatter(x=tesla_df.index, y=tesla_df['Close'])) | |
#Update X and Y axis with title | |
fig.update_xaxes( | |
title = 'Date',rangeslider_visible=True | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from pandas_datareader import data, wb | |
import datetime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start = pd.to_datetime('2020-02-04') | |
end = pd.to_datetime('today') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tesla_df = data.DataReader('TSLA', 'yahoo', start , end) | |
tesla_df |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from pandas_datareader import data, wb | |
import datetime | |
start = pd.to_datetime('2020-02-04') | |
end = pd.to_datetime('today') | |
tesla_df = data.DataReader('TSLA', 'yahoo', start , end) | |
tesla_df |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Raw Package | |
import numpy as np | |
import pandas as pd | |
#Data Source | |
import yfinance as yf | |
#Data viz | |
import plotly.graph_objs as go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Interval required 5 minutes | |
data = yf.download(tickers='UBER', period='5d', interval='5m') | |
#Print data | |
data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Raw Package | |
import numpy as np | |
import pandas as pd | |
#Data Source | |
import yfinance as yf | |
#Data viz | |
import plotly.graph_objs as go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data = yf.download(tickers='SPY', period='1d', interval='1m') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Draw the middle band, higher band, lowest band | |
data['Middle Band'] = data['Close'].rolling(window=21).mean() | |
data['Upper Band'] = data['Middle Band'] + 1.96*data['Close'].rolling(window=21).std() | |
data['Lower Band'] = data['Middle Band'] - 1.96*data['Close'].rolling(window=21).std() |
OlderNewer