-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
46 lines (25 loc) · 880 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import datetime
import streamlit as st
import yfinance as yf
st.write("""
# Stock Price Analyser """)
## get data for Apple's stock
symbol = st.selectbox(
'Which Stock Symbol would you want to analyse?',
('AAPL', 'GOOG', 'TSLA', 'MSFT', 'NFLX'))
col1, col2 = st.columns(2)
with col1:
start_date = st.date_input("Please enter start date", datetime.date(2019, 7, 6))
with col2:
end_date = st.date_input("Please enter end date", datetime.date(2019, 7, 10))
ticker_data = yf.Ticker(symbol)
ticker_df = ticker_data.history(period="1d", start= start_date, end=end_date)
st.write(f"""
### {symbol}'s Stock price data """)
st.dataframe(ticker_df)
st.write(f"""
### {symbol}'s Closing Price Chart price data""")
st.line_chart(ticker_df["Close"])
st.write(f"""
### {symbol}'s Volume Chart""")
st.line_chart(ticker_df["Volume"])