Skip to content
JayachandraV16Public
forked from vdntrthi/PfRadar

About

Portfolio analytics and optimization platform for NSE/BSE stocks using Modern Portfolio Theory, CAPM, and real-time market data.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

PfRadar

Portfolio analytics and optimization project focused on Indian equities (NSE/BSE).

Overview

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.

📸 Screenshots

Dashboard

The main interface allows users to add NSE/BSE stocks, assign portfolio weights, and generate optimized portfolio analytics.


System Architecture

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.


Efficient Frontier

Visualization of randomly generated portfolios highlighting the Efficient Frontier, Maximum Sharpe Ratio portfolio, and Minimum Volatility portfolio.


Portfolio Performance

Comparison of portfolio growth against benchmark indices over the selected investment period.

Tech stack

Python License Deployment

  • Python
  • pandas, numpy, scipy
  • yfinance
  • matplotlib
  • pydantic
  • pytest

Folder structure

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

Quick start

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.png

Testing

cd engine
pytest -m "not integration"
pytest -m integration

For engine-specific details, see engine/README.md.

About

Portfolio analytics and optimization platform for NSE/BSE stocks using Modern Portfolio Theory, CAPM, and real-time market data.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Contributors

Languages