Documentation
Complete reference for the Jhaveri Intelligence Platform
The Jhaveri Intelligence Platform is a fund manager's decision support system that combines technical analysis alerts from TradingView with model portfolio management. It processes webhook signals, tracks FM actions, and provides portfolio analytics — all from a single dashboard.
Receives TradingView webhooks, presents to FM for action, tracks performance of approved/denied signals.
Create strategies, record buy/sell transactions, track NAV, benchmark against NIFTY, compute XIRR/CAGR.
| Data Type | Source | Frequency |
|---|---|---|
| Live Stock Prices (CMP) | Yahoo Finance APIv8 chart endpoint | Real-time (on page load) |
| EOD Stock Prices | Yahoo Financevia yfinance (Python) | Daily at 3:30 PM IST |
| Index Data (NIFTY, BANKNIFTY) | Yahoo Finance^NSEI, ^NSEBANK symbols | Daily at 3:30 PM IST |
| TradingView Alerts | WebhookTradingView POST to /webhook/tradingview | Real-time |
| Portfolio Transactions | Manual entry by Fund Manager | On-demand |
LIQUIDBEES.NS on Yahoo Finance. This is the Nippon India ETF Liquid BeES — India's most liquid overnight fund ETF. CMP displayed is the real-time market price from Yahoo, not a synthetic value.Portfolio tickers are mapped to Yahoo Finance symbols for price fetching. Default mapping: TICKER → TICKER.NS (NSE). Special mappings below:
| Portfolio Ticker | Yahoo Symbol | Description |
|---|---|---|
| LIQUIDCASE | LIQUIDBEES.NS | Nippon India ETF Liquid BeES (overnight fund) |
| CPSEETF | CPSEETF.NS | CPSE ETF |
| METALETF | METALIETF.NS | ICICI Prudential Metal ETF |
| SENSEXETF | SENSEXETF.NS | Sensex ETF |
| All others | TICKER.NS | NSE equity default |
Cost Basis (Weighted Average)
When buying more of an existing holding, cost is averaged. Standard for Indian equity markets.
total_cost = quantity × avg_cost
Unrealized P&L
unrealized_pnl_pct = ((CMP / avg_cost) - 1) × 100
Realized P&L (on SELL)
realized_pnl_pct = ((sell_price / avg_cost) - 1) × 100
Total Return
XIRR (Extended Internal Rate of Return)
Annualized return accounting for timing of cash flows. Computed using Newton-Raphson method.
BUY transactions = negative (money out)
SELL transactions = positive (money in)
Current portfolio value = positive (on today's date)
Solve for r: ∑ CF_i / (1 + r)^((d_i - d_0) / 365) = 0
CAGR (Compound Annual Growth Rate)
CAGR = ((end_value / start_cost) ^ (1 / years) - 1) × 100
Max Drawdown
Largest peak-to-trough decline in portfolio value from the NAV time series.
running_max = max(running_max, nav_value)
drawdown = (nav_value - running_max) / running_max × 100
max_drawdown = min(all drawdowns)
Alpha (vs Benchmark)
benchmark_return = (nifty_latest - nifty_at_first_nav) / nifty_at_first_nav × 100
Portfolio Weight
NAV is computed daily for each portfolio using end-of-day closing prices. The NAV time series powers the performance chart.
Daily NAV Computation
value = quantity × EOD_close_price (from IndexPrice table)
If no price found, falls back to avg_cost
total_value = sum of all holding values
total_cost = sum of (quantity × avg_cost) for all holdings
unrealized_pnl = total_value - total_cost
realized_pnl_cumulative = sum of realized P&L from all SELL transactions up to date
Benchmark Normalization
The NIFTY benchmark is normalized to make it comparable on the same chart as portfolio returns.
This shows: "What if the same money was invested in NIFTY?"
Chart Mode: Percentage Returns
The performance chart displays percentage returns from the first data point (period start). All three lines — Portfolio, Cost Basis, and NIFTY — start at 0% for easy comparison. Hover shows both % return and absolute values.
| Time (IST) | Task | Description |
|---|---|---|
| 3:30 PM | EOD Price Fetch | Fetches closing prices for all tracked indices and stocks |
| 3:35 PM | NAV Computation | Computes daily NAV for all active portfolios using EOD prices |
| Real-time | Webhook Processing | TradingView alerts processed immediately on receipt |
| On-demand | Live Price Fetch | Holdings page fetches live CMP from Yahoo Finance on each load |
TradingView sends alerts via webhook. The FM reviews each alert and takes action (Approve/Deny). Approved alerts can have trade parameters, chart analysis, and FM notes attached.
Alert Fields
- Ticker — NSE symbol from TradingView
- Timeframe — Chart interval (1D, 4H, 1H, etc.)
- Signal Direction — BULLISH / BEARISH / NEUTRAL
- OHLCV — Open, High, Low, Close, Volume at alert time
- Alert Data — Custom message from TradingView strategy
FM Action Fields
- Action Call — BUY / SELL / RATIO (for pair trades)
- Priority — IMMEDIATELY / WITHIN A WEEK / WITHIN A MONTH
- Entry Range — Low and high entry price targets
- Stop Loss & Target — Risk management levels
- Chart Analysis — AI-generated 8-point technical analysis
- FM Notes — Free-form fund manager commentary
Alert Performance Tracking
After approval, the platform tracks price movement from the alert price to current market price, calculating P&L for each approved signal. This helps evaluate signal quality over time.
Microbaskets are curated stock baskets with weighted constituents. They can be managed standalone or added as portfolio instruments for NAV tracking.
CSV Upload Format
Baskets are created via CSV upload with the following columns:
Portfolio size is auto-computed from price × quantity for each constituent. Buy price is tracked per constituent for cost basis calculations.
Basket as Portfolio Instrument
Baskets can be added to portfolios using the MB_ prefix (e.g., MB_MOMENTUM) with instrument type BASKET during portfolio creation. The basket's NAV is computed from its constituent prices and used as the instrument price in the portfolio.
Unit Computation
units = weight% × portfolio_size / price
NAV is computed in background from constituent EOD prices.
The recommendation engine analyses 15 NSE sector indices against a benchmark (NIFTY 50 by default) to identify sectors with relative outperformance or underperformance.
Sector Indices & Periods
Each sector index is evaluated across 5 time periods with a configurable outperformance threshold:
Method: ratio = sector_return / benchmark_return
Threshold: configurable (e.g., ratio > 1.05 = outperforming)
Top Stocks & ETF Mapping
- Top stocks per sector shown with market cap, P/E ratio, and 52-week range
- ETF mapping for 7 sectors — BANKBEES, ITBEES, CPSE, JUNIORBEES, GOLDBEES, NIFTYBEES, METALIETF
- Batch-optimized — approximately 15 DB queries per generate request
The sidebar navigation includes live badge counts that update automatically, providing at-a-glance awareness of pending items.
Badge Counts
- Trade Center — red badge showing the count of pending (unreviewed) alerts
- Actionables — red badge showing the count of triggered stop-loss or target-price alerts
Auto-Refresh
Badge counts are fetched via SWR hooks and automatically refresh every 30 seconds, so the FM always sees up-to-date pending item counts without manual page reloads.
Currency pair returns are inverted to reflect the Indian investor's perspective on rupee strength or weakness.
Inversion Logic
USDINR falling (87 → 82): displayed as POSITIVE (INR strengthening)
This inversion is applied to both absolute and ratio returns across all time periods. A rising USDINR rate means each dollar costs more rupees, which is unfavourable for Indian investors — hence shown in red.
| Layer | Technology |
|---|---|
| Frontend | Next.js 16 + TypeScript + Tailwind CSS + shadcn/ui |
| Backend API | Python FastAPI (single server on port 8000) |
| Database | PostgreSQL (RDS Mumbai) / SQLite (local dev) |
| ORM | SQLAlchemy |
| Charts | Recharts (area, line, pie) |
| Scheduling | APScheduler (CronTrigger for daily tasks) |
| Deployment | AWS EC2 Mumbai (Docker via GitHub Actions CI/CD) |
| Market Data | nsetools (live 135+ indices) + yfinance (historical + stocks) + NSE API (sector constituents) |
Jhaveri Intelligence Platform v3 — Built for Jhaveri Securities & Ventures