pvyas96's picture
Upload 3 files
1cdac12 verified
---
title: NSE Portfolio Optimizer Pro
emoji: πŸ“Š
colorFrom: blue
colorTo: purple
sdk: streamlit
sdk_version: "1.51.0"
app_file: app.py
pinned: false
license: mit
python_version: "3.11"
---
# πŸ“Š NSE Portfolio Optimizer Pro
**Real-time Portfolio Optimization for Indian Stock Market**
Built with Modern Portfolio Theory and advanced analytics.
## ✨ Features
### Portfolio Selection
- πŸ“ˆ **Live NIFTY 50** - Auto-fetched current constituents
- 🎯 **7 Sector Categories** - Banking, IT, FMCG, Pharma, Energy, Auto, Metals
- ✨ **Custom Portfolio** - Add your own stocks
### Advanced Analytics
- 🎲 **Monte Carlo Simulation** - 1000+ scenario analysis
- ⚠️ **Value at Risk (VaR)** - Downside risk quantification
- πŸ“ˆ **Efficient Frontier** - Interactive risk-return visualization
- πŸ”„ **Rolling Metrics** - Time-series performance analysis
- πŸ“‰ **Drawdown Analysis** - Peak-to-trough decline tracking
- πŸ“Š **Risk Contribution** - Individual stock risk breakdown
### Real-Time Data
- πŸ’Ή **Live Market Data** - Current prices, volumes, 52-week ranges
- 🏷️ **Automatic Sector Detection** - Using yfinance API
- πŸ”„ **Smart Caching** - Fast performance with fresh data
### Interactive Results
- 6 analysis tabs with professional visualizations
- Export CSV reports for further analysis
- Mobile-responsive interface
## πŸš€ How to Use
1. **Select Portfolio Mode**
- Live NIFTY 50
- Sector Focus (7 categories)
- Custom Selection
2. **Configure Investment**
- Investment amount (β‚Ή)
- Historical data period
- Risk parameters
3. **Analyze Results**
- Allocation by sector
- Efficient frontier plot
- Monte Carlo scenarios
- Risk metrics
- Rolling performance
- Live market data
## πŸ“Š Technologies
- **Streamlit 1.51.0** - Web framework
- **yfinance** - Market data
- **CVXPY** - Portfolio optimization
- **Plotly** - Interactive charts
- **NumPy/Pandas** - Data processing
- **SciPy** - Statistical analysis
## πŸ“– Methodology
**Modern Portfolio Theory (Markowitz, 1952)**
- Mean-Variance Optimization
- Sharpe Ratio Maximization
- Efficient Frontier Construction
- Monte Carlo Risk Simulation
## ⚠️ Disclaimer
**Educational purposes only.** This tool is for learning and research. It does not constitute financial advice. Always consult a qualified financial advisor before making investment decisions. Past performance does not guarantee future results.
## πŸ“„ License
MIT License
---
**Built with ❀️ for Indian Stock Market Investors**