A real-time stock monitoring dashboard for Pakistan Stock Exchange (PSX) with AI-powered news analysis.
- 8 Watchlist Stocks: PSO, MEBL, UBL, SYS, LUCK, PPL, HBL, MCB
- Composite Scoring: Multi-factor score (0-100) based on P/E, upside, analyst consensus, dividends, ROE, beta
- News Intelligence: Market news with sentiment analysis and per-stock impact scores
- Macro Risk Monitor: Oil crisis, SBP rates, IMF program, Middle East conflict, PKR/USD, monsoon risk
- Shariah Filter: Identify Shariah-compliant stocks (MEBL, SYS, LUCK, PPL)
- Comparison Table: Side-by-side ranking of all stocks
- AI Analysis (optional): Connect your Anthropic API key for live news fetching and impact analysis via Claude
- Position Tracking: Add your holdings with buy price, shares, target sell, and stop loss
- P&L Dashboard: Real-time unrealized gains/losses per position and total
- Sell Signal Engine: 8 types of automated sell signals:
- 🛑 Stop Loss Hit — immediate action
- 🎯 Target Price Reached — take profit
- 📉 Trailing Stop — protect gains after pullback
- 💰 Partial Profit — near analyst target
⚠️ News Risk — high-impact negative news- 📊 Score Drop — fundamentals weakening
- ⚖️ Overweight — position too concentrated (>25%)
- 🔒 Lock Gains — unrealized profit >30%
- 100% Private: All data stored in browser localStorage — never leaves your device
- Sample Portfolio: One-click load to test features before adding real positions
# Clone the repo
git clone https://github.com/YOUR_USERNAME/psx-monitor.git
cd psx-monitor
# Install dependencies
npm install
# Run locally
npm run dev- Get an API key from https://console.anthropic.com
- Copy
.env.exampleto.env - Add your key:
VITE_ANTHROPIC_API_KEY=sk-ant-... - Restart the dev server
With the API key, the app will:
- Fetch live news via Claude's web search tool
- Analyze news impact on each stock using Claude Sonnet
- Generate sentiment scores and actionable insights
Without the key, the app uses curated fallback news data.
npm i -g vercel
vercel- Push to GitHub:
git init git add . git commit -m "PSX Monitor v1" git branch -M main git remote add origin https://github.com/YOUR_USERNAME/psx-monitor.git git push -u origin main
- Go to https://vercel.com/new
- Import your GitHub repo
- Add environment variable:
VITE_ANTHROPIC_API_KEY(if using live news) - Deploy — done!
Vercel auto-deploys on every push to main.
# Install gh-pages
npm install --save-dev gh-pages
# Add to package.json scripts:
# "deploy": "npm run build && gh-pages -d dist"
# In vite.config.js, add:
# base: '/psx-monitor/',
npm run deploypsx-monitor/
├── src/
│ ├── main.jsx # Entry point
│ ├── App.jsx # Main dashboard + portfolio UI
│ ├── data.js # Stock data, macro factors, scoring
│ ├── news.js # News module with AI analysis
│ └── portfolio.js # Portfolio tracking, P&L, sell signals
├── index.html
├── package.json
├── vite.config.js
├── vercel.json
├── .env.example
└── README.md
Add more stocks: Edit WATCHLIST_STOCKS in src/data.js
Add macro factors: Edit MACRO_FACTORS in src/data.js
Add news sources: Edit NEWS_SOURCES and FALLBACK_NEWS in src/news.js
Custom scoring: Modify computeScore() in src/data.js
Stock data: Analyst estimates from PSX, Investing.com, SCS Trade (mid-March 2026) News: Curated from Business Recorder, Dawn, Reuters, The News International Macro: IMF, SBP, NDMA, Trading Economics
This is for informational and educational purposes only — not financial advice. Always consult a SECP-registered broker before making investment decisions. Past performance does not guarantee future results.
MIT