A comprehensive financial portfolio analysis platform built with Python and Streamlit, featuring advanced technical indicators, risk metrics, and interactive visualizations for data-driven investment insights.
- Real-time portfolio returns and performance metrics
- Risk-adjusted returns (Sharpe ratio, Sortino ratio, Calmar ratio)
- Maximum drawdown and volatility analysis
- Value at Risk (VaR) calculations
- Technical Indicators: RSI, MACD, Bollinger Bands, Moving Averages
- Trading Signals: Automated buy/sell recommendations
- Interactive Charts: Candlestick charts with volume analysis
- Support & Resistance: Dynamic level detection
- Performance comparison across market sectors
- Sector rotation insights and trends
- Risk-return profiles by industry
- Interactive correlation matrices
- Portfolio diversification insights
- Asset relationship visualization
- Python 3.8+ - Core programming language
- Streamlit - Modern web application framework
- Pandas - Data manipulation and analysis
- NumPy - Numerical computing and statistical operations
- Plotly - Interactive data visualizations
- Historical Data - Real S&P 500 stock data from Kaggle
- Python 3.8 or higher
- pip package manager
- Clone the repository:
git clone https://github.com/yourusername/financial-dashboard.git
cd financial-dashboard- Create and activate virtual environment:
# Create virtual environment
python -m venv .venv
# Activate virtual environment
# On macOS/Linux:
source .venv/bin/activate
# On Windows:
.venv\Scripts\activate- Install dependencies:
pip install -r requirements.txtStart the Streamlit application:
streamlit run streamlit_app.pyNavigate to http://localhost:8501 in your web browser to access the dashboard.
The application features four main analysis sections:
- Portfolio Overview - Overall performance metrics and key statistics
- Technical Analysis - Individual stock technical indicators and signals
- Sector Analysis - Comparative sector performance analysis
- Correlation Matrix - Asset correlation and diversification insights
financial-dashboard/
├── src/ # Core analysis modules
│ ├── __init__.py # Package initialization
│ ├── data_collector.py # Data loading and CSV management
│ ├── portfolio_analyzer.py # Portfolio metrics and risk calculations
│ ├── technical_indicators.py # Technical analysis indicators
│ ├── utils.py # Utility functions and formatters
│ └── visualizations.py # Chart generation and plotting
├── data/ # Historical stock data (CSV files)
│ ├── AAPL_data.csv # Apple Inc. historical data
│ ├── GOOGL_data.csv # Alphabet Inc. historical data
│ └── ... # Additional stock data files
├── streamlit_app.py # Main dashboard application
├── app.py # Command-line interface
├── config.py # Configuration settings
├── requirements.txt # Python dependencies
├── .gitignore # Git ignore patterns
└── README.md # Project documentation
The dashboard analyzes a diversified portfolio of 16 S&P 500 stocks across four major sectors:
- AAPL - Apple Inc.
- GOOGL - Alphabet Inc.
- MSFT - Microsoft Corporation
- NVDA - NVIDIA Corporation
- JPM - JPMorgan Chase & Co.
- BAC - Bank of America Corporation
- WFC - Wells Fargo & Company
- GS - The Goldman Sachs Group, Inc.
- JNJ - Johnson & Johnson
- PFE - Pfizer Inc.
- UNH - UnitedHealth Group Incorporated
- ABBV - AbbVie Inc.
- XOM - Exxon Mobil Corporation
- CVX - Chevron Corporation
- COP - ConocoPhillips
- SLB - Schlumberger Limited
- Total Return: Cumulative portfolio performance over selected period
- Annualized Return: Geometric mean return scaled to annual basis
- Volatility: Standard deviation of returns (annualized)
- Sharpe Ratio: Risk-adjusted return metric
- Maximum Drawdown: Largest peak-to-trough decline
- Value at Risk (VaR): Potential loss at specified confidence level
- Sortino Ratio: Downside risk-adjusted return
- Calmar Ratio: Return to maximum drawdown ratio
- RSI (Relative Strength Index): Momentum oscillator (14-period)
- MACD: Moving Average Convergence Divergence
- Moving Averages: 20-day and 50-day simple moving averages
- Bollinger Bands: Volatility-based technical indicator
The application uses historical stock data sourced from Kaggle's S&P 500 dataset, providing:
- Daily OHLCV data: Open, High, Low, Close, Volume
- Multi-year history: Comprehensive historical coverage
- High data quality: Cleaned and validated stock data
- No API dependencies: Reliable offline operation
- Caching: Streamlit caching for improved response times
- Data optimization: Efficient pandas operations for large datasets
- Memory management: Optimized data structures for portfolio analysis
- Responsive design: Works across desktop and mobile devices
- Modular architecture: Separated concerns across multiple modules
- Type hints: Comprehensive type annotations for better code clarity
- Error handling: Robust exception handling and user feedback
- Logging: Detailed logging for debugging and monitoring
# Run data collector tests
python src/data_collector.py
# Test individual components
python -c "from src.portfolio_analyzer import PortfolioAnalyzer; print('Portfolio analyzer loaded successfully')"- Real-time data integration: Live market data feeds
- Advanced portfolio optimization: Monte Carlo simulations
- Machine learning models: Predictive analytics and forecasting
- Additional asset classes: Bonds, commodities, and cryptocurrencies
- Export functionality: PDF reports and data export capabilities
This is a portfolio demonstration project. While not actively seeking contributions, feel free to:
- Fork the repository for your own modifications
- Submit issues for bugs or suggestions
- Use the code as a reference for your own financial analysis projects
This project is licensed under the MIT License - see the LICENSE file for details.
For questions about this project or potential opportunities, please reach out via:
- GitHub: https://github.com/brucegav
- LinkedIn: https://www.linkedin.com/in/bruce-gavins-639837b1/
- Email: brucegavins@gmail.com
Disclaimer: This dashboard is for educational and portfolio demonstration purposes only. It should not be used as the sole basis for investment decisions. Always consult with qualified financial professionals before making investment choices.