Skip to content

utfcmac/should-i-be-trading

Repository files navigation

📊 Should I Be Trading?

Bloomberg Terminal-style market dashboard for swing traders

Next.js TypeScript Tailwind CSS Yahoo Finance License: MIT

FeaturesQuick StartScoring SystemArchitectureContributing

Dashboard Preview


🎯 Overview

Should I Be Trading? is a live, auto-refreshing market quality terminal that evaluates the current stock market environment and outputs a clear, actionable trading decision. It aggregates volatility, trend, breadth, momentum, and macro data into a single composite score — then tells you whether to trade, be cautious, or sit on your hands.

Why This Dashboard?

  • 📉 One-glance decision: YES / CAUTION / NO — no ambiguity
  • 🧮 Quantified market quality: 0–100 composite score with transparent weights
  • Real-time data: Auto-refreshes every 45 seconds via Yahoo Finance
  • 🏦 Bloomberg Terminal feel: Dense, high-signal, dark UI built for traders
  • 🎛️ Two modes: Swing Trading and Day Trading with adjusted thresholds

✨ Features

  • 📊 Market Quality Score — Weighted composite of 5 categories (0–100)
  • 🟢🟡🔴 Decision Engine — YES (press risk) / CAUTION (A+ setups only) / NO (preserve capital)
  • Volatility Analysis — VIX level, trend, 1-year percentile, Put/Call ratio
  • 📈 Trend Detection — SPY vs 20/50/200-day MAs, QQQ trend, regime classification
  • 📊 Breadth Indicators — % above MAs, NYSE A/D, Nasdaq Highs/Lows
  • 🚀 Momentum Tracking — 11 sector ETFs, leaders/laggards, participation breadth
  • 🏛️ Macro Awareness — 10Y yield, DXY, Fed stance, FOMC event alerts
  • 🎯 Execution Window — Are breakouts holding? Are pullbacks being bought?
  • 📡 Live Ticker Bar — Scrolling quotes for SPY, QQQ, VIX, DXY, TNX, sectors
  • 🔄 Auto-refresh — 45-second cycle with 30-second server cache
  • 🌗 Mode Toggle — Swing Trading / Day Trading

🚀 Quick Start

Prerequisites

  • Node.js 22+
  • macOS, Linux, or Windows WSL

Installation

# 1. Clone the repository
git clone https://github.com/utfcmac/should-i-be-trading.git
cd should-i-be-trading

# 2. Install dependencies (automatically sets up Git hooks)
npm install

# 3. Start development server
npm run dev

The dashboard will be available at http://localhost:3000.

Production Build

npm run build
npm run start

📐 Scoring System

Category Weights

Category Weight Key Inputs
Volatility 25% VIX level, 5-day trend, 1-year percentile, Put/Call
Momentum 25% Sector participation, leaders/laggards, RSI, ROC
Trend 20% SPY vs 20/50/200 MA, QQQ trend, regime classification
Breadth 20% % above 50d/200d/20d MA, NYSE A/D, NAS Highs/Lows
Macro 10% 10Y yield, DXY, Fed stance, FOMC proximity

Decision Logic

80–100 → YES     Full position sizing, press risk
60–79  → CAUTION Half size, A+ setups only
 <60   → NO      Avoid trading, preserve capital

Execution Window (Separate Score)

Evaluates whether setups are actually working:

  • Are breakouts holding above pivot levels?
  • Are leading stocks maintaining gains?
  • Are pullbacks being bought quickly?
  • Is there multi-day follow-through?

🏗️ Architecture

┌──────────────────────────────────────────────────────┐
│  Browser (React / Next.js)                           │
│                                                      │
│  ┌─────────┐ ┌────────┐ ┌──────────┐ ┌───────────┐  │
│  │  Hero   │ │ Detail │ │ Sectors  │ │ Terminal  │  │
│  │  Panel  │ │  Grid  │ │ Heatmap  │ │ Analysis  │  │
│  └────┬────┘ └───┬────┘ └────┬─────┘ └─────┬─────┘  │
│       └──────────┴───────────┴──────────────┘        │
│                         │ SWR (45s)                  │
├─────────────────────────┼────────────────────────────┤
│  Server (Next.js API)   │                            │
│                         ▼                            │
│  ┌──────────────────────────────┐                    │
│  │  /api/market-data            │                    │
│  │  - Score calculation         │                    │
│  │  - Decision logic            │                    │
│  │  - Analysis generation       │                    │
│  │  - 30s server cache          │                    │
│  └──────────────┬───────────────┘                    │
│                 │                                    │
│  ┌──────────────▼───────────────┐                    │
│  │  yahoo-finance2              │                    │
│  │  - Quotes (SPY, QQQ, VIX…)  │                    │
│  │  - Historical bars (12mo)   │                    │
│  └──────────────────────────────┘                    │
└──────────────────────────────────────────────────────┘

Technology Stack

Category Technology
Framework Next.js 16 (App Router, Turbopack)
Language TypeScript 5
Styling Tailwind CSS 3.4
Data Fetching SWR (client), yahoo-finance2 (server)
Font Inter (Google Fonts)

📊 Data Sources

Symbols Tracked

Type Symbols
Index SPY, QQQ, ^VIX, ^TNX, DX-Y.NYB
Sectors XLK, XLF, XLE, XLV, XLI, XLY, XLP, XLU, XLB, XLRE, XLC

API

Uses yahoo-finance2 (free, no API key required).

For production use with higher rate limits, consider:

  • Alpha Vantage (free tier available)
  • Polygon.io (paid, real-time)
  • IEX Cloud (paid, reliable)

🛠️ NPM Scripts

# Development
npm run dev          # Start dev server with Turbopack

# Production
npm run build        # Build for production
npm run start        # Start production server

# Code Quality
npm run lint         # Run ESLint

# Git Hooks
npm run setup:hooks  # Manually configure git hooks

📝 Project Structure

should-i-be-trading/
├── src/
│   ├── app/
│   │   ├── page.tsx              # Main page
│   │   ├── layout.tsx            # Root layout (Inter font)
│   │   ├── globals.css           # Tailwind + custom styles
│   │   └── api/
│   │       ├── market-data/      # Main data endpoint
│   │       └── events/           # FOMC/macro events
│   ├── components/
│   │   ├── Dashboard.tsx         # Main layout orchestrator
│   │   ├── HeroPanel.tsx         # Decision + score + mini scores
│   │   ├── GridPanel.tsx         # Category detail cards
│   │   ├── SectorHeatmap.tsx     # Horizontal bar chart
│   │   ├── ScoreBreakdown.tsx    # Weighted score visualization
│   │   ├── ExecutionPanel.tsx    # Execution window signals
│   │   ├── TerminalText.tsx      # AI analysis output
│   │   ├── TickerBar.tsx         # Scrolling ticker
│   │   ├── AlertBanner.tsx       # Event warnings
│   │   ├── ModeToggle.tsx        # Swing/Day toggle
│   │   └── LoadingSkeleton.tsx   # Loading states
│   ├── hooks/
│   │   └── useMarketData.ts      # SWR data hook
│   └── lib/
│       ├── scoring.ts            # Score calculation engine
│       ├── indicators.ts         # Technical indicators (SMA, RSI, MACD)
│       ├── yahoo.ts              # Yahoo Finance wrapper
│       ├── events.ts             # FOMC/macro event calendar
│       ├── cache.ts              # Server-side cache
│       ├── symbols.ts            # Symbol definitions
│       └── types.ts              # TypeScript types
├── docs/
│   └── tradingview.png           # Dashboard screenshot
├── .githooks/                    # Git hooks (conventional commits)
├── .github/                      # PR/issue templates, CI/CD
├── scripts/
│   └── setup-hooks.sh            # Hook setup automation
├── package.json
├── tailwind.config.ts
├── tsconfig.json
└── CHANGELOG.md

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Follow the Conventional Commits format
  4. Update CHANGELOG.md under [Unreleased]
  5. Push to the branch (git push origin feature/amazing-feature)
  6. Open a Pull Request

Commit Format

feat(scoring): add McClellan Oscillator
fix(dashboard): correct sector heatmap rendering
docs(readme): update installation guide
chore(deps): bump next to v16.3.0

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

TL;DR: You can do whatever you want with this code! Use it, modify it, distribute it, even commercially.

🙏 Acknowledgments

  • @investingluc — Original idea and inspiration for the "Should I Be Trading?" concept. Thank you for sharing this with the community!
  • Yahoo Finance — Market data
  • Next.js — React framework
  • Tailwind CSS — Utility-first CSS
  • SWR — Data fetching

Made with ❤️ for disciplined traders

Not financial advice. This tool is for informational purposes only.

Report BugRequest Feature

About

Should I Be Trading? is a live, auto-refreshing market quality terminal that evaluates the current stock market environment and outputs a clear, actionable trading decision. It aggregates volatility, trend, breadth, momentum, and macro data into a single composite score — then tells you whether to trade, be cautious, or sit on your hands.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors