forked from dataprofessor/code
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67144ed
commit 6ccc33c
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import yfinance as yf | ||
import streamlit as st | ||
import pandas as pd | ||
|
||
st.write(""" | ||
# Simple Stock Price App | ||
Shown are the stock closing price and volume of Google! | ||
""") | ||
|
||
# https://towardsdatascience.com/how-to-get-stock-data-using-python-c0de1df17e75 | ||
#define the ticker symbol | ||
tickerSymbol = 'GOOGL' | ||
#get data on this ticker | ||
tickerData = yf.Ticker(tickerSymbol) | ||
#get the historical prices for this ticker | ||
tickerDf = tickerData.history(period='1d', start='2010-5-31', end='2020-5-31') | ||
# Open High Low Close Volume Dividends Stock Splits | ||
|
||
st.line_chart(tickerDf.Close) | ||
st.line_chart(tickerDf.Volume) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import yfinance as yf | ||
import streamlit as st | ||
import pandas as pd | ||
|
||
st.write(""" | ||
# Simple Stock Price App | ||
Shown are the stock **closing price** and ***volume*** of Google! | ||
""") | ||
|
||
# https://towardsdatascience.com/how-to-get-stock-data-using-python-c0de1df17e75 | ||
#define the ticker symbol | ||
tickerSymbol = 'GOOGL' | ||
#get data on this ticker | ||
tickerData = yf.Ticker(tickerSymbol) | ||
#get the historical prices for this ticker | ||
tickerDf = tickerData.history(period='1d', start='2010-5-31', end='2020-5-31') | ||
# Open High Low Close Volume Dividends Stock Splits | ||
|
||
st.write(""" | ||
## Closing Price | ||
""") | ||
st.line_chart(tickerDf.Close) | ||
st.write(""" | ||
## Volume Price | ||
""") | ||
st.line_chart(tickerDf.Volume) |