BroStock AI is a full-stack stock analytics dashboard built with FastAPI, JavaScript, and Chart.js.
It fetches live stock market data and visualizes it using interactive charts with professional-grade technical indicators.
The project has evolved from a simple price chart into a modular technical analysis dashboard.
- Live stock price fetching via Yahoo Finance (yfinance)
- Interactive dynamic price chart (Chart.js)
- 7-day and 21-day Moving Averages (MA7, MA21)
- Toggle controls for MA visibility
- Adaptive price line thickness based on indicator visibility
- Volume bars integrated into the main price chart
- Separate Y-axis handling for clean scaling
- Visual confirmation of price strength
- Full RSI momentum panel (0–100 scale)
- Overbought (70) and Oversold (30) reference levels
- Background heat-zone shading
- Backend-calculated rolling averages
- Defensive handling of NaN and infinite values
- EMA(12) and EMA(26) based MACD line
- 9-period Signal line
- Histogram with dynamic green/red coloring
- Separate synchronized panel
- Momentum strength visualization
- Technical Mode / AI Mode toggle (AI mode scaffolded)
- Clean separation of technical panels
- Responsive dark-themed UI
- Smooth chart transitions
- Defensive handling of pandas NaN / inf serialization
- Multi-index DataFrame normalization
- Safe float sanitization before JSON response
- Clean backend-to-frontend data contract
- Python
- FastAPI
- yfinance
- pandas
- Exponential & rolling window calculations
- HTML
- CSS (custom dark UI styling)
- JavaScript
- Chart.js (multi-dataset mixed charts)
User Input
→ JavaScript fetch request
→ FastAPI backend
→ Yahoo Finance data (yfinance)
→ Backend computes indicators (MA, RSI, MACD, Volume)
→ Safe JSON serialization
→ Chart.js renders multi-panel interactive dashboard
All financial calculations are performed in the backend to maintain clean separation of concerns and avoid frontend numerical instability.
Used to smooth price data and identify short-term vs medium-term trends.
Used to confirm price movement strength. High volume + breakout = stronger conviction.
Momentum oscillator:
- Above 70 → Potentially overbought
- Below 30 → Potentially oversold
Trend-following momentum indicator:
- MACD crossing above signal → Bullish shift
- MACD crossing below signal → Bearish shift
- Histogram shows momentum acceleration
- Regression-based forecasting model
- Confidence interval bands
- Time-range selector (1W, 1M, 3M, 1Y)
- Candlestick chart mode
- Crosshair synchronization across panels
- AI forecast visualization panel
- Deployment (cloud hosting)
This project demonstrates:
- Full-stack system design
- Financial indicator implementation from scratch
- API design & structured JSON contracts
- Defensive data engineering practices
- Chart.js multi-panel architecture
- State management in interactive dashboards
- Incremental, versioned feature expansion
This project is for educational and portfolio purposes only.
It does not provide financial advice.