markytools commited on
Commit
82b1468
·
1 Parent(s): 4a8456a
Files changed (1) hide show
  1. app.py +13 -2
app.py CHANGED
@@ -2,6 +2,7 @@ import streamlit as st
2
  import yfinance as yf
3
  import pandas as pd
4
  import plotly.graph_objs as go
 
5
 
6
  # Set the Streamlit app title and icon
7
  st.set_page_config(page_title="Stock Analysis", page_icon="📈")
@@ -33,5 +34,15 @@ fig = go.Figure(data=[go.Candlestick(x=stock_data.index,
33
  fig.update_layout(title=f'{ticker_symbol} Candlestick Chart', xaxis_title='Date', yaxis_title='Price')
34
  st.plotly_chart(fig)
35
 
36
- # Perform more advanced analysis here
37
- # You can add more Streamlit components and analysis tools as needed
 
 
 
 
 
 
 
 
 
 
 
2
  import yfinance as yf
3
  import pandas as pd
4
  import plotly.graph_objs as go
5
+ import numpy as np
6
 
7
  # Set the Streamlit app title and icon
8
  st.set_page_config(page_title="Stock Analysis", page_icon="📈")
 
34
  fig.update_layout(title=f'{ticker_symbol} Candlestick Chart', xaxis_title='Date', yaxis_title='Price')
35
  st.plotly_chart(fig)
36
 
37
+ # Calculate basic statistics
38
+ st.subheader("Basic Statistics")
39
+ st.write(f"**Average Closing Price**: ${np.mean(stock_data['Close']):.2f}")
40
+ st.write(f"**Minimum Closing Price**: ${np.min(stock_data['Close']):.2f}")
41
+ st.write(f"**Maximum Closing Price**: ${np.max(stock_data['Close']):.2f}")
42
+ st.write(f"**Total Volume Traded**: {np.sum(stock_data['Volume']):,} shares")
43
+
44
+ # Add a text summary
45
+ st.subheader("Stock Summary")
46
+ st.write("This is a brief summary of the stock's performance.")
47
+ st.write("You can add more in-depth analysis and insights here.")
48
+ # You can use external libraries or APIs for more advanced analysis