Real-time synthetic stock index based on Mark Minervini's trend template criteria. Screens stocks using 8-point trend template, manages SQLite database, integrates with Polygon.io API.
This skill helps you work with the Minervini Trend Index project, a real-time synthetic stock index based on Mark Minervini's trend template criteria for stock selection.
The Minervini Trend Index is a Node.js application that:
**Tech Stack**: Node.js, SQLite, Polygon.io API, WebSocket
Before running any screening, initialize the stock universe:
```bash
npm run get-tickers
npm run setup-universe
```
**Key files**: `src/scripts/getTickerList.js`, `src/data/Database.js`
Run the screening to find stocks meeting Minervini's criteria:
```bash
npm run screen
npm run create-synthetic
npm run test-synthetic
```
**Key files**: `src/scripts/dailyScreen.js`, `src/scripts/createSyntheticTicker.js`, `src/core/StockScreener.js`
The screener evaluates stocks against these criteria:
1. **Price above moving averages**: Current price > 150-day MA AND 200-day MA
2. **MA alignment**: 150-day MA > 200-day MA
3. **Uptrend confirmation**: 200-day MA trending upward (past 30 days)
4. **Short-term strength**: 50-day MA > 150-day MA AND 200-day MA
5. **Near highs**: Price within 25% of 52-week high
6. **Above lows**: Price at least 30% above 52-week low
7. **Relative strength**: RS rating > 70
8. **Liquidity**: Daily volume > 100,000 shares
**Documentation**: https://www.minervini.com/stock-selection-criteria
**Database location**: `./data/minervini_index.db`
**Tables**:
**Database operations**: `src/data/Database.js`
**Key endpoints used**:
**Rate limits**:
**Configuration**: Adjust `rateLimiter` in `src/api/PolygonAPI.js`
**API Documentation**: https://polygon.io/docs/stocks
```bash
npm run dev
npm run start
npm run test-polygon # Test Polygon API technical indicators
npm run test-synthetic # Test with sample stocks
npm run lint
npm run format
```
Create a `.env` file with these required variables:
```env
POLYGON_API_KEY=your_api_key_here
NODE_ENV=development
LOG_LEVEL=info
PORT=3001
DB_PATH=./data/minervini_index.db
INDEX_BASE_VALUE=1000
REBALANCE_TIME=16:30
MIN_STOCK_PRICE=15.00
EXCHANGES=XNYS,XNAS
```
```bash
npm run get-tickers
```
```bash
npm run create-synthetic
```
Look in `./data/` directory for database and output files.
Edit `src/core/StockScreener.js` - adjust thresholds, add/remove criteria, or change weighting.
1. Verify API key in `.env`
2. Check rate limits in Polygon.io dashboard
3. Review `src/api/PolygonAPI.js` rate limiter settings
```bash
rm ./data/minervini_index.db
npm run setup-universe
```
**No qualifying stocks found**:
**API rate limit errors**:
**Database locked errors**:
| File | Purpose |
|------|---------|
| `src/api/PolygonAPI.js` | Polygon.io API integration and rate limiting |
| `src/core/StockScreener.js` | Minervini criteria evaluation logic |
| `src/core/MinerviniTrendIndex.js` | Main index orchestration |
| `src/data/Database.js` | SQLite database operations |
| `src/scripts/createSyntheticTicker.js` | Synthetic ticker generation |
| `src/scripts/getTickerList.js` | Fetch active stocks from Polygon |
| `src/scripts/dailyScreen.js` | Daily screening automation |
1. **Rate limiting**: Always respect Polygon.io API limits to avoid throttling
2. **Data freshness**: Run daily screens during after-hours to avoid market volatility
3. **Criteria tuning**: Adjust thresholds in `StockScreener.js` based on market conditions
4. **Database backups**: Regularly backup `./data/minervini_index.db`
5. **Monitoring**: Track qualification rates over time to validate screening logic
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/minervini-trend-index-workflow/raw