fierce-dashboard

byKanchan Negi

Act as a Senior Machine Learning Engineer, Data Scientist, and Expert UI/UX Designer. Your task is to build a complete end-to-end project titled: "Intelligent Stock Market Forecasting Using LSTM With Interactive Dashboard And Chatbot Support" The implementation MUST strictly follow the system architecture, methodology, and objectives described below. Do not add extra features beyond this specification. ━━━━━━━━━━━━━━━━━━━━━━━ 🎯 PROJECT OVERVIEW ━━━━━━━━━━━━━━━━━━━━━━━ Build a Streamlit-based web application that predicts stock prices using an LSTM model trained on historical stock data. The system must include: 1. Data collection from Yahoo Finance 2. Data preprocessing and feature engineering 3. LSTM-based prediction model 4. Technical indicators visualization 5. Interactive dashboard (premium UI) 6. Rule-based chatbot for user queries The system should replicate a modern AI-powered financial dashboard and also act as an educational tool. ━━━━━━━━━━━━━━━━━━━━━━━ 🎨 PREMIUM UI/UX REQUIREMENTS (IMPORTANT) ━━━━━━━━━━━━━━━━━━━━━━━ Design the Streamlit dashboard to look like a modern trading platform (clean, dark, professional UI): * Use a DARK THEME (black/charcoal background) * Use custom CSS for styling (via st.markdown) * Layout should be: * Top header with title + subtitle * Sidebar for controls * Main dashboard with cards and sections Dashboard design must include: ✔ Metric Cards (at top): * Current Price * Predicted Price * % Change * RMSE / MAE ✔ Graph Section: * Large interactive price chart (Plotly) * Smooth lines, hover tooltips, zoom enabled ✔ Tabs or Sections: * Overview * Technical Indicators * Predictions * Chatbot ✔ Indicators Styling: * Colored lines (SMA 20 = blue, SMA 50 = orange) * RSI with threshold lines (30, 70) * MACD with histogram bars ✔ Layout Features: * Use columns for clean spacing * Rounded containers / card-like sections * Add spacing and padding for readability ✔ Chatbot UI: * Chat bubbles (user vs bot) * Scrollable chat history * Input box at bottom The UI should feel like: 👉 TradingView / Zerodha Kite / modern fintech dashboard ━━━━━━━━━━━━━━━━━━━━━━━ 📊 DATA COLLECTION ━━━━━━━━━━━━━━━━━━━━━━━ * Use yfinance to fetch historical stock data * Input: user-entered stock ticker (e.g., TCS.NS, RELIANCE.NS) * Allow user to select: * Start date * End date * Fetch OHLCV data ━━━━━━━━━━━━━━━━━━━━━━━ 🧹 DATA PREPROCESSING ━━━━━━━━━━━━━━━━━━━━━━━ * Handle missing values using forward fill * Normalize data using MinMaxScaler (0 to 1) * Train-test split: 80/20 ━━━━━━━━━━━━━━━━━━━━━━━ 📈 FEATURE ENGINEERING ━━━━━━━━━━━━━━━━━━━━━━━ Compute: 1. Moving Averages: * 20-day SMA * 50-day SMA 2. RSI (14-day) 3. MACD: * EMA(12) - EMA(26) * Signal line (9-day EMA) ━━━━━━━━━━━━━━━━━━━━━━━ 🧠 LSTM MODEL ━━━━━━━━━━━━━━━━━━━━━━━ * Sequence length: 60 * 2 LSTM layers (50 units each) * Dense output layer * Optimizer: Adam * Loss: MSE * Epochs: 50–100 * Batch size: 32 * Use early stopping ━━━━━━━━━━━━━━━━━━━━━━━ 🔮 PREDICTION ━━━━━━━━━━━━━━━━━━━━━━━ * Predict next 30 days * Use recursive forecasting * Inverse transform output ━━━━━━━━━━━━━━━━━━━━━━━ 📊 PERFORMANCE METRICS ━━━━━━━━━━━━━━━━━━━━━━━ Display: * RMSE * MAE ━━━━━━━━━━━━━━━━━━━━━━━ 🖥️ STREAMLIT DASHBOARD ━━━━━━━━━━━━━━━━━━━━━━━ Sidebar: * Stock ticker input * Start date * End date * Run Forecast button Main UI: 1. Overview: * Metric cards * Closing price chart 2. Technical Indicators: * SMA chart * RSI chart * MACD chart 3. Predictions: * Historical + Forecasted chart 4. Model Training Info (optional simple progress display) 5. Performance Metrics section ━━━━━━━━━━━━━━━━━━━━━━━ 💬 CHATBOT (NO API) ━━━━━━━━━━━━━━━━━━━━━━━ * Rule-based chatbot * Keyword matching * Answer: * LSTM * RSI * MACD * Moving average * Prediction meaning * Maintain conversation history ━━━━━━━━━━━━━━━━━━━━━━━ 📁 PROJECT STRUCTURE ━━━━━━━━━━━━━━━━━━━━━━━ * app.py * data_loader.py * preprocessing.py * indicators.py * model.py * predict.py * chatbot.py * styles.css (for UI) ━━━━━━━━━━━━━━━━━━━━━━━ ⚠️ CONSTRAINTS ━━━━━━━━━━━━━━━━━━━━━━━ DO NOT include: * Authentication * Database * Real-time streaming * Paid APIs * React or frontend frameworks Use ONLY: Python, Streamlit, yfinance, pandas, numpy, scikit-learn, TensorFlow/Keras, Plotly ━━━━━━━━━━━━━━━━━━━━━━━ 🎯 FINAL OUTPUT ━━━━━━━━━━━━━━━━━━━━━━━ * Fully working Streamlit app * Premium UI dashboard * Clean modular code * requirements.txt included * Step-by-step run instructions Ensure the project is visually impressive and suitable for final-year B.Tech evaluation.

Landing
Landing

Comments (0)

No comments yet. Be the first!

System Requirements

System Requirement Document
Page 1 of 7

System Requirements Document (SRD)

Project Title: fierce-dashboard

1. Introduction

The fierce-dashboard project is an advanced Streamlit-based web application designed to predict stock prices using an LSTM model trained on historical stock data. This system aims to provide users with an interactive financial dashboard that combines technical analysis, machine learning predictions, and chatbot support for educational and practical use.

Developed for a global audience, the application supports stock ticker inputs from Yahoo Finance, making it versatile and accessible worldwide. The chatbot is designed to provide both technical explanations and user guidance, ensuring users can navigate the dashboard effectively while learning about financial concepts.

This document outlines the system requirements for the fierce-dashboard, ensuring alignment with the project's objectives and constraints.

Page 2 of 7

2. System Overview

The fierce-dashboard is a modular system that integrates data collection, preprocessing, feature engineering, machine learning, and user interaction into a cohesive platform. The key components include:

  1. Data Collection: Fetch historical stock data from Yahoo Finance based on user-selected stock tickers, start dates, and end dates.
  2. Data Preprocessing: Handle missing values, normalize data, and split it into training and testing sets.
  3. Feature Engineering: Compute technical indicators such as SMA, RSI, and MACD for enhanced analysis.
  4. LSTM Model: Train a deep learning model to predict stock prices using historical data.
  5. Interactive Dashboard: Provide users with a premium UI for visualizing metrics, charts, and predictions.
  6. Chatbot Support: Offer rule-based chatbot assistance for technical explanations and dashboard navigation.

The system is designed to replicate the aesthetics and functionality of modern trading platforms, ensuring a professional and engaging user experience.

3. Functional Requirements

As User:

  • I should be able to input any global stock ticker supported by Yahoo Finance.
  • I should be able to select a start date and end date for historical data collection.
  • I should be able to view metric cards displaying current price, predicted price, percentage change, and RMSE/MAE.
  • I should be able to interact with a large, zoom-enabled price chart with hover tooltips.
  • I should be able to navigate between tabs for Overview, Technical Indicators, Predictions, and Chatbot.
  • I should be able to view charts for SMA, RSI, and MACD with appropriate styling and thresholds.
  • I should be able to view historical and forecasted stock prices on a single chart.
  • I should be able to interact with a chatbot for technical explanations and guidance on dashboard usage.
Page 3 of 7

As Admin:

  • I should be able to monitor the system's performance metrics (e.g., RMSE, MAE).
  • I should be able to update the chatbot's rule-based responses for improved user interaction.

4. User Personas

1. General User

  • Description: Individuals interested in stock market analysis and predictions.
  • Goals:
    • Analyze stock trends and predictions.
    • Learn about financial indicators and machine learning concepts.
    • Use the chatbot for guidance and technical explanations.

2. Admin

  • Description: System maintainers responsible for ensuring the dashboard's functionality and accuracy.
  • Goals:
    • Monitor system performance.
    • Update chatbot responses and maintain the rule-based logic.

5. Visuals Colors and Theme

The fierce-dashboard will feature a unique, modern color palette inspired by professional trading platforms.

Page 4 of 7

Color Palette:

  • primary: #1F2937 (Charcoal Black)
  • primary_light: #374151 (Slate Gray)
  • secondary: #F97316 (Amber Orange)
  • accent: #10B981 (Emerald Green)
  • highlight: #EAB308 (Golden Yellow)
  • bg: #111827 (Deep Black)
  • surface: rgba(31, 41, 55, 0.8) (Semi-transparent Charcoal)
  • text: #F9FAFB (White)
  • text_muted: #9CA3AF (Muted Gray)
  • border: rgba(255, 255, 255, 0.2) (Subtle White)

6. Signature Design Concept

Concept Name: Interactive Financial Galaxy

The landing page of the fierce-dashboard will feature an Interactive Financial Galaxy, where each stock ticker is represented as a glowing star. Users can:

  • Hover over stars to see stock names and brief metrics.
  • Click a star to zoom into its "orbit," revealing detailed charts and predictions.
  • Drag to rotate the galaxy and explore other stock tickers.
Page 5 of 7

Details:

  • Animation: Smooth transitions using @react-three/fiber and @react-three/drei. Stars pulsate gently to indicate interactivity.
  • Micro-interactions: Hovering highlights connections between related stocks (e.g., sector-based clustering).
  • Color Shifts: Stars change color based on stock performance (green for positive, red for negative).
  • User Guidance: A chatbot bubble appears at the bottom, offering tips like "Click a star to explore its details!"

This concept ensures the dashboard is visually captivating and highly interactive, making the first impression unforgettable.

7. Interaction Model & Motion Direction

Landing Page: Parallax

  • Layered depth via scroll, with stars and galaxy elements translating at different speeds.
  • Real content (charts, metrics) scrolls naturally.

Internal Pages: Static

  • Focus on clarity and readability for charts, metrics, and chatbot interactions.

8. Non-Functional Requirements

  • Performance: Ensure the dashboard loads within 3 seconds for typical datasets.
  • Scalability: Support up to 100 simultaneous users without performance degradation.
  • Accessibility: Ensure compliance with WCAG 2.1 standards for color contrast and keyboard navigation.
  • Security: Prevent unauthorized access to the chatbot logic or model training modules.

9. Tech Stack

Page 6 of 7

Frontend:

  • React (for advanced interactivity via @react-three/fiber and @react-three/drei)
  • Streamlit (for dashboard rendering)

Backend:

  • Python
  • FastAPI

Database:

  • NoSQL: MongoDB (for chatbot conversation history)

AI Models:

  • LSTM (TensorFlow/Keras)

AI Tools:

  • Langchain (for chatbot logic)

Local Orchestration:

  • Docker
Page 7 of 7

10. Assumptions and Constraints

  • Users will have basic knowledge of stock market concepts.
  • The system will not include real-time streaming or authentication.
  • The chatbot will operate on rule-based logic without external APIs.

11. Glossary

  • LSTM: Long Short-Term Memory, a type of recurrent neural network used for time-series predictions.
  • SMA: Simple Moving Average, a technical indicator for stock trends.
  • RSI: Relative Strength Index, a momentum indicator measuring stock price changes.
  • MACD: Moving Average Convergence Divergence, a trend-following indicator.
  • OHLCV: Open, High, Low, Close, Volume data for stocks.
Landing design preview
Landing: View Galaxy
Dashboard: Monitor Performance
Overview: View RMSE MAE
Overview: Check Metrics
Predictions: Review Forecast
Predictions: Validate Model
Chatbot: Review Responses
Chatbot: Update Rules
Chatbot: Test Responses
Technical: Verify Indicators