The Finance Analysis Dashboard is a comprehensive web application designed for detailed financial data analysis, visualization, and prediction. It empowers users to investigate stock performance through advanced technical indicators, track financial news with sentiment analysis, and forecast future price movements using machine learning algorithms. This full-stack solution combines real-time data integration, interactive visualizations, and intelligent analysis tools to provide a complete financial research platform.
- Multi-modal Stock Search: Access stocks via ticker symbol (e.g., AAPL) or company name (e.g., Apple) with intelligent name resolution
- Customizable Historical Data: View adjustable time periods with daily, weekly, or monthly aggregation
- Interactive Charts: Professional candlestick charts with volume indicators and customizable parameters
- Real-time Updates: Refresh stock data on demand with the latest market information
- Comprehensive Technical Indicators:
- Simple Moving Average (SMA): Trend identification using various time periods (7, 20, 50, 200 days)
- Relative Strength Index (RSI): Overbought/oversold momentum identification (14-day period)
- Moving Average Convergence Divergence (MACD): Signal line crossovers for trend strength/direction
- Bollinger Bands: Volatility channels with 20-day period and 2 standard deviations
- Volume Analysis: Trading volume patterns with moving averages
- Volatility Metrics: Historical and implied volatility calculations
- Curated News Feed: Latest articles from financial sources filtered by relevance
- Sentiment Analysis: NLP-based sentiment scoring of news articles (positive/negative/neutral)
- News Impact Visualization: Correlation between news sentiment and price movements
- Historical News Context: Archive of significant news events mapped to price action
- Automated Decision Support: Buy/Sell/Hold recommendations based on technical indicator confluence
- Signal Strength Metrics: Confidence scores for trading signals
- Multi-timeframe Validation: Signal confirmation across different time periods
- Time Series Forecasting: Price predictions using statistical models
- Machine Learning Integration:
- Random Forest Analysis: Non-linear regression for price prediction with feature importance
- XGBoost Model: Gradient boosting for enhanced prediction accuracy
- Prophet Model: Time series decomposition with trend and seasonality
- Model Comparison: Performance metrics and visual comparison between prediction models
- Learning Curve Analysis: Model validation with varying training sizes
- Multi-stock Comparison: Side-by-side analysis of related stocks
- Sector Performance: Industry-specific metrics and benchmarking
- International Markets: Support for global exchanges including US and Turkish markets
- Backend: Flask web framework with Python
- Frontend: HTML5, CSS3, Bootstrap 5, and JavaScript
- Data Visualization: Chart.js and custom rendering
- Caching System: Flask-Caching with tiered timeout strategy
- Database: In-memory data storage with option for persistent storage
- Logging: Comprehensive logging system with configurable verbosity
- yfinance: General historical and real-time market data
- MarketStack API: Data source for machine learning models and technical indicators
- EventRegistry: News article aggregation and filtering
- Custom APIs: Internal data processing and analysis endpoints
- Data Preprocessing: Automated cleaning, normalization, and feature engineering
- Model Training: Scikit-learn and XGBoost implementation with cross-validation
- Feature Importance: Identification of key price-influencing factors
- Model Persistence: Saved models for rapid redeployment
- Evaluation Metrics: MAE, RMSE, R² for performance assessment
- Strategic Caching: Time-based caching strategy for API responses
- Asynchronous Loading: Non-blocking UI updates for seamless user experience
- Lazy Chart Initialization: On-demand rendering of complex visualizations
- Efficient Data Processing: Vectorized operations with pandas and numpy
- Python 3.8+ installed
- Git (for repository cloning)
- Internet connection for API access
- EventRegistry API key (for news functionality)
- MarketStack API key (for machine learning models)
-
Clone the Repository:
git clone <repository-url> cd Finance
-
Create and Activate Virtual Environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies:
pip install -r requirements.txt
-
Configure Environment Variables:
# For Unix/Linux/macOS export EVENTREGISTRY_API_KEY=your_api_key export MARKETSTACK_API_KEY=your_marketstack_api_key export FLASK_DEBUG=true # For development # For Windows set EVENTREGISTRY_API_KEY=your_api_key set MARKETSTACK_API_KEY=your_marketstack_api_key set FLASK_DEBUG=true
-
Create Required Directories (if not present):
mkdir -p static/images
-
Launch the Application:
python app.py
-
Access the Dashboard: Open your browser and navigate to:
http://localhost:5001
-
Search Methods:
- Symbol Search: Enter ticker symbols directly (e.g., "AAPL", "MSFT")
- Company Name Search: Use full or partial company names (e.g., "Apple", "Microsoft")
- Quick Access: Click popular stock buttons for immediate analysis
-
Supported Markets:
- US Stocks: AAPL, MSFT, GOOGL, AMZN, TSLA, NVDA, etc.
- Turkish Stocks: THYAO.IS, GARAN.IS, BIMAS.IS, ASELS.IS, etc.
The application provides a multi-tab interface for comprehensive analysis:
-
Overview Tab:
- Main price chart with selectable timeframes
- Current market data (open, high, low, close, volume)
- Performance metrics (daily change, volatility)
-
News Tab:
- Latest news articles related to the selected stock
- Sentiment classification with visual indicators
- Source attribution and publication timestamps
-
Details Tab:
- Advanced technical indicators with explanations
- Volume trend analysis
- Support and resistance levels
-
Forecasting Tab:
- Statistical price projections
- Confidence intervals
- Trend analysis
-
ML Analysis:
- Random Forest model insights
- XGBoost analysis for improved predictions
- Feature importance visualization
- Model performance metrics
-
Model Comparison:
- Side-by-side evaluation of different forecasting approaches
- Accuracy metrics (MAE, RMSE, R²)
- Execution time comparison
Instructions for utilizing technical indicators:
-
Moving Averages:
- Interpret trend direction by comparing price to SMAs
- Identify potential support/resistance at SMA lines
- Look for crossovers between different period SMAs
-
RSI Analysis:
- Values above 70 indicate overbought conditions
- Values below 30 indicate oversold conditions
- Divergence between price and RSI can signal potential reversals
-
MACD Interpretation:
- Crossovers of MACD line and signal line generate trading signals
- MACD histogram shows momentum strength
- Zero line crossovers indicate trend changes
-
Bollinger Bands Strategy:
- Price touching upper band may indicate overbought conditions
- Price touching lower band may indicate oversold conditions
- Band contraction suggests decreased volatility, often preceding significant moves
-
Volume Analysis:
- Confirm price movements with corresponding volume
- Look for volume divergence as potential reversal signal
- Identify institutional participation through volume spikes
The application follows a modular architecture with these components:
-
Core Application (app.py):
- Flask application initialization
- Route definitions
- Caching configuration
- Request handling
-
Data Processing Modules:
- Stock data retrieval and processing
- Technical indicator calculation
- News API integration
- Data transformation and normalization
-
Analysis Modules:
- Decision support system
- Sentiment analysis
- Forecasting algorithms
- Machine learning models
-
Template Structure:
- Base layout templates
- Functional component templates
- Reusable partial templates
- Specialized visualization templates
-
Static Assets:
- Custom CSS styling
- JavaScript functionality
- Image resources
- Generated visualizations
-
API Dependencies:
- EventRegistry API requires a valid API key
- yfinance is subject to rate limiting and data availability
- Some functionality may be limited without API access
-
Data Limitations:
- Historical data availability varies by stock
- Newer or less liquid stocks may have insufficient data for ML analysis
- News coverage varies by company size and market
-
Processing Considerations:
- Machine learning analysis requires sufficient historical data (minimum 100 data points)
- Complex visualizations may impact performance on slower devices
- Simultaneous analysis of multiple stocks may be resource-intensive
-
Accuracy Considerations:
- Forecasting models provide estimates not guarantees
- Technical indicators should be used in conjunction, not isolation
- Financial markets are inherently unpredictable and subject to external factors
-
Enhanced Analysis:
- Additional technical indicators
- Advanced pattern recognition
- Options analytics integration
-
Expanded ML Capabilities:
- Deep learning models (LSTM, Transformers)
- Ensemble model approaches
- Hyperparameter optimization
-
UI Enhancements:
- Customizable dashboards
- Advanced charting tools
- Mobile-optimized experience
-
Data Integration:
- Fundamental data analysis
- Economic indicator correlation
- Social media sentiment
-
Data Retrieval Failures:
- Check internet connection
- Verify API key configuration
- Ensure stock symbol is valid
-
Visualization Problems:
- Clear browser cache
- Update to latest browser version
- Check for JavaScript console errors
-
ML Analysis Errors:
- Ensure sufficient historical data exists
- Verify required packages are installed
- Check disk space for image generation
The application relies on these key Python packages:
- Web Framework: Flask, Flask-Caching
- Data Processing: pandas, numpy, pandas_ta
- Data Retrieval: yfinance, EventRegistry
- Machine Learning: scikit-learn, Prophet
- Visualization: matplotlib, Chart.js
- Utility: joblib, pytz, logging
Contributions to the project are welcome. Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- yfinance for providing market data access
- EventRegistry for news aggregation capabilities
- Open-source community for various libraries and tools
- Faculty advisors for project guidance and support