A comprehensive stock analysis dashboard for NVIDIA (NVDA) that combines market data, news sentiment analysis, and technical indicators to provide deep insights into stock performance. This project leverages machine learning models for sentiment analysis, custom technical indicators from PyPI, and interactive visualizations to help understand the relationship between news sentiment and stock price movements.
This dashboard analyzes NVIDIA stock by integrating multiple data sources:
- Market Data: Real-time and historical stock prices sourced from Yahoo Finance
- News Data: Over 7,000+ news articles collected over 10 years
- Technical Indicators: Custom indicators calculated using the indicators-cli package
- Sentiment Analysis: Advanced sentiment analysis using FinBERT and VADER models
- LLM Analysis: AI-powered market analysis and trading recommendations
The application features interactive Plotly charts, customizable timeframes, buy/sell signal analysis, and hypothetical trade analysis including dollar-cost averaging and lump-sum investment scenarios.
-
dashboard/- Streamlit dashboard application files- Main dashboard interface with multiple tabs for different analyses
- Helper functions for data processing and visualization
- Individual tab modules for organized functionality
-
src/- Source code for data collection and processing- News fetching and scraping utilities
- Sentiment analysis scripts using FinBERT and VADER
- LLM integration for market analysis
- Data cleaning and preprocessing tools
-
data/- Historical stock and news data storage- Contains yearly subdirectories (2020-2025) with news JSON files
- Stock price CSV files for different time periods
- Processed data for events and sentiment analysis
-
cache/- Cached data for performance optimization- Indicators data in Parquet format
- Processed sentiment and analysis results
- Configuration files for indicators
-
plots/- Generated visualizations and charts -
new_data/- Additional news data organized by year
dashboard/dashboard.py- Main Streamlit dashboard application with modular tabsdashboard/dashboard_complete.py- Standalone complete dashboard versiondashboard/my_dashboard.py- Alternative dashboard implementationdashboard/dashboard_helpers.py- Utility functions for data loading and processingdashboard/tab1.py- Stock Overview tab with price charts and indicatorsdashboard/tab2.py- News Sentiment analysis tabdashboard/tab3.py- Technical Indicators detailed analysisdashboard/tab4.py- Correlation Analysis between sentiment and pricedashboard/tab5.py- Insights & Findings with key takeawaysdashboard/events.py- Event detection and analysissrc/news.py- News fetching script using News APIsrc/sentiment.py- Sentiment analysis using FinBERT and VADERsrc/llm.py- LLM-based market analysis using Ollamasrc/corpus.py- Text corpus generation for NLP analysissrc/clean.py- Data cleaning and validation utilitiessrc/events.py- Event extraction from news articlesrequirements.txt- Python package dependenciesLICENSE- MIT License
- Python 3.8 or higher
- Git
- CUDA-capable GPU (optional, for faster sentiment analysis)
- News API key (for fetching news data)
-
Clone the repository
git clone https://github.com/ibitec7/stock.git cd stock -
Install dependencies
pip install -r requirements.txt
-
Install the indicators-cli package
pip install indicators-cli
-
Download required NLTK data
python -c "import nltk; nltk.download('vader_lexicon')"
Navigate to the dashboard directory and run the Streamlit application:
cd dashboard
streamlit run dashboard.pyThe dashboard will open in your default web browser at http://localhost:8501.
You can also run the complete standalone version:
streamlit run dashboard_complete.pyOr the alternative implementation:
streamlit run my_dashboard.py- Interactive Price Charts: Candlestick, Line, and OHLC chart types
- Timeframe Selection: Choose from daily, weekly, monthly, or quarterly data
- Period Options: YTD, 1Y, 2Y, 5Y, 10Y, or all-time data
- Date Range Filters: Custom start and end dates
- Refresh Market Data: Button to fetch the latest market data from Yahoo Finance
- Volume Analysis: Trading volume visualization
- Key Metrics Display: Current price, change, and percentage change
- Sentiment Distribution: Visual representation of positive, neutral, and negative news
- Daily Sentiment Trends: Time-series analysis of sentiment scores
- FinBERT Sentiment Analysis: Advanced financial sentiment using pre-trained models
- VADER Sentiment Scores: Compound sentiment scores for articles
- Recent News Display: Latest headlines with sentiment indicators
- Sentiment Clustering: K-Means clustering of news embeddings to identify sentiment groups
- News Article Count: Track news volume over time
- Moving Averages: SMA, EMA with customizable periods
- Momentum Indicators: RSI, MACD, Stochastic Oscillator
- Volume Indicators: On-Balance Volume (OBV), Volume Moving Average
- Trend Analysis: Identify bullish and bearish trends
- Buy/Sell Signals: Automated signal generation based on indicator crossovers
- Custom Indicator Configuration: Upload custom indicator configurations
- Multi-timeframe Analysis: View indicators across different timeframes
- Sentiment-Price Correlation: Correlation matrix between sentiment scores and price movements
- Lagged Effects Analysis: Examine how sentiment affects price with time delays
- Heatmap Visualization: Interactive correlation heatmaps
- Statistical Significance: P-values and confidence intervals
- Feature Correlation: Correlate technical indicators with sentiment scores
- Key Takeaways: Summarized insights from the analysis
- LLM-Generated Analysis: AI-powered market analysis and recommendations
- Trading Strategy Recommendations: Data-driven buy/hold/sell suggestions
- Risk Assessment: Market risk factors and monitoring points
- Trend Predictions: Short-term and long-term trend forecasts
- Event Impact Analysis: How major events affected stock prices
- Dollar-Cost Averaging (DCA): Analyze periodic investment strategies
- Lump-Sum Investment: Compare one-time investment scenarios
- Returns Calculator: Calculate historical returns for different strategies
- What-If Analysis: Hypothetical investment scenarios
- Indicators-CLI Integration: Custom PyPI package for technical indicators
- Fetches market data from yfinance
- Calculates indicators using Polars (CPU/GPU support)
- Outputs data in efficient Parquet format
- News Data Collection:
- Over 7,000+ news articles spanning 10 years (2015-2025)
- Monthly news aggregation
- Article content scraping using Selenium and BeautifulSoup
- Sentiment Analysis Pipeline:
- FinBERT for financial sentiment classification
- VADER for compound sentiment scores
- Embedding generation for clustering analysis
- LLM Analysis:
- Ollama-based local LLM inference
- Structured JSON output with market insights
- Trading recommendations and risk assessment
- Source: Yahoo Finance via yfinance
- Coverage: 10+ years of historical data
- Frequency: Daily, Weekly, Monthly, Quarterly
- Metrics: Open, High, Low, Close, Volume, Adjusted Close
- Source: News API and web scraping
- Coverage: 7,000+ articles from 2015-2025
- Processing:
- BeautifulSoup for content extraction
- Selenium for dynamic content
- JSON storage with metadata
- Source: indicators-cli (custom PyPI package)
- Engine: Polars (with GPU acceleration support)
- Indicators:
- Moving Averages (SMA, EMA)
- RSI, MACD, Bollinger Bands
- Stochastic Oscillator
- Volume indicators
- Streamlit: Interactive web application framework
- Plotly: Interactive charts and visualizations
- Matplotlib/Seaborn: Additional plotting capabilities
- Polars: High-performance dataframe operations
- Pandas: Data manipulation and analysis
- NumPy: Numerical computing
- Transformers: Hugging Face library for FinBERT
- FinBERT: Financial sentiment analysis model (ProsusAI/finbert)
- NLTK: VADER sentiment analysis
- scikit-learn: K-Means clustering, TF-IDF vectorization
- PyTorch: Deep learning framework
- yfinance: Yahoo Finance data fetching
- httpx: HTTP client for API requests
- Selenium: Web browser automation
- BeautifulSoup: HTML parsing
- pygooglenews: Google News integration
- Ollama: Local LLM inference
- GPTQModel: Quantized model support
- Optimum: Model optimization
yfinance
polars
httpx
selenium
seaborn
matplotlib
numpy
bs4
pygooglenews
urlutils
gptqmodel
optimum
transformers
webdriver_manager
streamlit
plotly
pandas
scikit-learn
nltk
torch
indicators-cli
Install all dependencies with:
pip install -r requirements.txtCustom indicator configurations can be uploaded through the dashboard or placed in the cache/ directory as JSON files. Example configuration:
{
"indicators": ["SMA", "EMA", "RSI", "MACD"],
"periods": [20, 50, 200],
"use_gpu": true
}cd src
python news.pycd src
python sentiment.pycd src
python llm.pycd dashboard
streamlit run dashboard.pyThe dashboard features five main tabs:
- Stock Overview - Price charts with technical indicators
- News Sentiment - Sentiment analysis and trends
- Technical Indicators - Detailed indicator analysis
- Correlation Analysis - Sentiment-price correlations
- Insights & Findings - AI-powered insights and recommendations
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.
Syed Ibrahim Omer (@ibitec7)
- indicators-cli: Custom PyPI package for technical indicators
- FinBERT: Pre-trained financial sentiment model by ProsusAI
- Yahoo Finance: Market data provider
- News API: News data aggregation service
- Streamlit: Web application framework
- Plotly: Interactive visualization library
For questions, suggestions, or issues, please open an issue on GitHub or contact the repository owner.
Note: This project is for educational and research purposes only. It should not be considered as financial advice. Always do your own research and consult with a financial advisor before making investment decisions.