Skip to content

Latest commit

Β 

History

308 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FII & DII Data Dashboard Hero

Live Dashboard for tracking Foreign Institutional Investor (FII/FPI) and Domestic Institutional Investor (DII) flows in Indian equity markets.

Built by Mr. Chartist | Part of the Mr. Chartist Ecosystem

Live Dashboard Twitter MIT License


✨ Features

Feature Description
Real-Time FII/DII Flows Latest net buy/sell data with flow strength meter
45-Day Heatmaps GitHub-style concentration matrices for FII sell-off depth & DII absorption
F&O Derivatives Participant-wise Open Interest (Long vs Short ratio bars)
Multi-Timeframe Tables Daily, Weekly, Monthly & Annual archives with magnitude bars + expandable rows
Interactive Charts Chart.js-powered flow visualizations with timeframe toggles
Sector Allocation NSDL fortnightly FPI sector data with sparkline trends & zoom modal
Dark / Light Mode OLED black dark mode & clean light theme
Full-Page Export html2canvas-powered screenshot & Post to 𝕏
PWA Installable Progressive Web App with offline support
SEO Optimized JSON-LD structured data, Open Graph, BreadcrumbList, canonical URL
Security Hardened X-Content-Type-Options, X-Frame-Options, Referrer-Policy headers

πŸ“Έ Tab-by-Tab Walkthrough

1. FII/DII Data (Home)

The default landing view showing the latest extracted session with:

  • Hero Card β€” FII/FPI Net vs DII Net with a red/green accent border indicating flow direction
  • Flow Strength Meter β€” Visual split showing FII aggression vs DII support percentage
  • Streak Trackers β€” Current consecutive buying/selling days with cumulative velocity
  • Quick Stats β€” 5-Year cumulative flows, SIP run-rate, FII NSE500 ownership
  • 45-Day Heatmaps β€” Color-coded concentration matrices (FII sell depth & DII absorption)

45-Day Heatmaps FII/DII Data Tab


2. F&O Positions

Derivatives positioning analysis with:

  • Sentiment Badge β€” Mildly Bearish / Bullish / Neutral classification
  • Open Interest Breakdown β€” FII vs DII positioning across Index Futures, Stock Futures, Index Calls & Puts
  • Long vs Short Ratio Bars β€” Visual ratio indicators for each instrument
  • Historical Positioning Chart β€” 20-period trajectory with toggleable FII Futures, Calls, Puts & DII Futures

F&O Positions Tab


3. Flow Analytics

Complete institutional flow archive with:

  • Interactive FII/DII Chart β€” Bar chart with 8-month history, hover for exact metrics
  • Multi-Timeframe Sub-Tabs β€” Daily (expandable rows), Weekly (12W), Monthly (24M), Annual Tracker
  • Smart Filters β€” FII Bloodbath (< -β‚Ή5k Cr), DII Absorption (> +β‚Ή5k Cr), Extreme Divergence
  • Date Range Filter β€” Custom FROM/TO date filtering
  • CSV Export β€” Download filtered data
  • Expandable Row Details β€” Click any row for a breakdown chart + buy/sell ratios

Databases Matrix Flow Analytics Tab


4. Sectors

NSDL Fortnightly FPI Allocation data with:

  • Methodology Explainer β€” How SEBI/NSDL sector data is calculated
  • 24 Sector Cards β€” AUM %, FII Ownership %, sparkline mini-charts, 1Y Flow & Momentum Alpha
  • Zoom Modal β€” Click any sector card for a full-screen chart with 24-fortnight trend history, stat pills (1Y Flow, AUM Weight, FII Ownership, Fortnight Flow), hover tooltips
  • Interactive Sector Chart β€” Toggleable Bar / Line / Scatter views
  • Sort Modes β€” Total AUM, Fortnight Ξ”, 1Y Net Flow, A-Z
  • Backend Data β€” Sector data served via /api/sectors endpoint

Sectors Tab


5. Docs

Comprehensive documentation covering:

  • Dashboard Architecture β€” 5-tab system overview
  • Data Sources β€” NSE TRDREQ, NSDL FPI Reports, BSE Classification
  • Methodology β€” How FII/DII data is extracted and processed
  • Formulas β€” Flow Strength Meter, Momentum Alpha, Streak calculations
  • Export Tools β€” Screenshot, CSV, Post to 𝕏

Docs Tab


πŸ› οΈ Tech Stack

Technology Usage
Node.js + Express Backend API server with cron-based NSE data fetching
HTML5 Single-file monolithic dashboard
CSS3 Custom properties, OLED dark mode, glassmorphism, ambient orbs
JavaScript Vanilla JS with Chart.js 3.9.1
Chart.js Interactive bar/line charts + sector sparklines
html2canvas Full-page screenshot export
node-cron Automated data fetching (6:00, 6:30, 7:00 PM IST Mon-Fri)
PWA Service Worker v5 + Web App Manifest

πŸ“‚ Project Structure

FII and DII data/
β”œβ”€β”€ server.js                     # Express backend + cron scheduler
β”œβ”€β”€ package.json                  # Dependencies & scripts
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ index.html                # Main dashboard (single-file SPA)
β”‚   β”œβ”€β”€ manifest.json             # PWA manifest
β”‚   β”œβ”€β”€ sw.js                     # Service Worker (network-first, API bypass)
β”‚   β”œβ”€β”€ robots.txt                # Search engine crawler rules
β”‚   β”œβ”€β”€ sitemap.xml               # XML sitemap for SEO
β”‚   β”œβ”€β”€ icons/
β”‚   β”‚   β”œβ”€β”€ icon-192.png          # PWA icon (192x192)
β”‚   β”‚   └── icon-512.png          # PWA icon (512x512)
β”‚   └── screenshots/              # Tab screenshots for README
β”‚       β”œβ”€β”€ 01_home_fii_dii_date.png
β”‚       β”œβ”€β”€ 02_fno_positions.png
β”‚       β”œβ”€β”€ 03_databases_matrices.png
β”‚       β”œβ”€β”€ 05_sectors.png
β”‚       └── 06_docs.png
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ fetch_data.js             # NSE data fetcher + JSON storage
β”‚   β”œβ”€β”€ seed_history.js           # Historical data seeder
β”‚   └── seed_sectors.js           # Sector data seeder
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ history.json              # Rolling FII/DII daily history
β”‚   β”œβ”€β”€ sectors.json              # Sector allocation data (24 sectors)
β”‚   └── fetch-log.json            # Fetch activity log
└── README.md                     # This file

πŸš€ Quick Start

# 1. Install dependencies
npm install

# 2. Seed historical data (first time only)
node scripts/seed_history.js
node scripts/seed_sectors.js

# 3. Start the server
npm start
# β†’ Server runs on http://localhost:3000

# 4. Development (auto-reload)
npm run dev

πŸ”Œ API Endpoints

Method Endpoint Description
GET /api/data Latest FII/DII snapshot
GET /api/history Last 60 days of history
GET /api/history-full Full history (800 records) for charts
GET /api/sectors Sector allocation with trend data
GET /api/market Nifty 50 & India VIX (Yahoo Finance proxy)
GET /api/status Server health + recent fetch logs
POST /api/refresh Trigger manual NSE data fetch

☁️ Deployment

Hostinger / VPS

npm install
NODE_ENV=production node server.js

Use a process manager like PM2: pm2 start server.js --name fii-dii

Environment Variables

Variable Default Description
PORT 3000 Server port

πŸ“Š Data Flow

NSE India API ──→ server.js (cron) ──→ data/history.json
                                    ──→ public/index.html (fetch on load)
                                    ──→ /api/* endpoints

NSDL FPI Reports ──→ seed_sectors.js ──→ data/sectors.json
                                     ──→ /api/sectors

πŸ” Security Headers

All responses include:

  • X-Content-Type-Options: nosniff
  • X-Frame-Options: SAMEORIGIN
  • X-XSS-Protection: 1; mode=block
  • Referrer-Policy: strict-origin-when-cross-origin
  • Permissions-Policy: camera=(), microphone=(), geolocation=()

πŸ”— Links


πŸ€– Agentic AI Road Map (2026)

FII & DII Data serves as our Regime Detection Feed. It identifies the institutional context for all other agents.

Key Agent Integrations:

  • Regime Trigger Agent: Switches TradeBook's risk parameters to 'Conservative' when institutional sell-off streaks are detected.
  • Sector Rotation Monitor: Proactively alerts when FPI allocation rotates away from top watchlist sectors.
  • Flow Divergence Alert: Autonomous signals when FII/DII divergence reaches historical extremes.

Made with care by Mr. Chartist
Institutional Money Matrix -- Where the smart money flows

Website GitHub

About

No description, website, or topics provided.

Resources

Stars

39 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages