Portfolio analytics and optimization project focused on Indian equities (NSE/BSE).
PfRadar is a portfolio analytics platform that helps investors build optimized portfolios for Indian equities.
The application fetches real-time NSE/BSE stock data, calculates portfolio risk and expected return, applies Modern Portfolio Theory and CAPM, and generates visual analytics together with downloadable PDF reports.
The main interface allows users to add NSE/BSE stocks, assign portfolio weights, and generate optimized portfolio analytics.
The application uses a modular architecture where the frontend communicates with a Python analytics engine responsible for market data retrieval, portfolio optimization, CAPM calculations, and report generation.
Visualization of randomly generated portfolios highlighting the Efficient Frontier, Maximum Sharpe Ratio portfolio, and Minimum Volatility portfolio.
Comparison of portfolio growth against benchmark indices over the selected investment period.
- Python
- pandas, numpy, scipy
- yfinance
- matplotlib
- pydantic
- pytest
PfRadar/
├─ README.md
├─ .gitignore
└─ engine/
├─ README.md
├─ requirements.txt
├─ main.py
├─ pytest.ini
├─ conftest.py
├─ data/
│ └─ .gitkeep
├─ models/
│ ├─ __init__.py
│ ├─ constants.py
│ ├─ exceptions.py
│ └─ schemas.py
├─ services/
│ ├─ __init__.py
│ ├─ market_data.py
│ ├─ optimizer.py
│ ├─ frontier.py
│ ├─ report.py
│ └─ capm.py
├─ utils/
│ ├─ __init__.py
│ ├─ logging_config.py
│ ├─ returns.py
│ ├─ risk.py
│ └─ visualization.py
└─ tests/
├─ __init__.py
├─ test_returns.py
├─ test_risk.py
├─ test_optimizer.py
└─ test_integration_nse.py
cd engine
python -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txt
python main.py demo RELIANCE.NS TCS.NS INFY.NS --plot frontier.pngcd engine
pytest -m "not integration"
pytest -m integrationFor engine-specific details, see engine/README.md.



