CoolFace
Apppublic

Billy10111/financial-research-tool

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
App README

Financial Research Tool Demo ๐Ÿ“Š

A comprehensive financial research tool for individual investors to analyze stocks, track portfolios, and make informed investment decisions.

๐ŸŽฏ Features

  • โ€”๐Ÿ“ˆ Stock Analysis Dashboard: Detailed analysis with technical indicators, charts, and performance metrics
  • โ€”๐Ÿ  Market Overview: At-a-glance view of market indices, top gainers/losers, and sector performance
  • โ€”๐Ÿ“ฅ Data Export: Export historical data and fundamentals to CSV for external analysis
  • โ€”๐Ÿ’ผ Portfolio Tracking: Track your investments and monitor performance (coming soon)
  • โ€”โš ๏ธ Watchlists: Create and manage custom stock watchlists (coming soon)

๐Ÿš€ Quick Start

Prerequisites

  • โ€”Python 3.9 or higher
  • โ€”pip (Python package installer)
  • โ€”Internet connection for fetching market data

Installation

  1. 1.Clone or download the repository
  1. 1.Install dependencies
bash
   pip install -r requirements.txt
  1. 1.Run the setup script
bash
   python scripts/setup_env.py

This will:

  • โ€”Initialize the SQLite database
  • โ€”Create necessary directories
  • โ€”Download required NLTK data
  • โ€”Optionally fetch initial market data
  1. 1.Launch the application
bash
   streamlit run main.py
  1. 1.Open your browser to the URL displayed (typically http://localhost:8501)

๐Ÿ“ Project Structure

Financial research tool/
โ”œโ”€โ”€ main.py                 # Main Streamlit application entry point
โ”œโ”€โ”€ requirements.txt        # Python dependencies
โ”œโ”€โ”€ README.md              # This file
โ”‚
โ”œโ”€โ”€ app/                   # Streamlit pages
โ”‚   โ”œโ”€โ”€ dashboard.py       # Stock analysis dashboard
โ”‚   โ”œโ”€โ”€ market_overview.py # Market overview page
โ”‚   โ””โ”€โ”€ data_export.py     # Data export functionality
โ”‚
โ”œโ”€โ”€ config/                # Configuration files
โ”‚   โ”œโ”€โ”€ settings.py        # Application settings
โ”‚   โ””โ”€โ”€ watchlists.py      # Default watchlists
โ”‚
โ”œโ”€โ”€ src/                   # Core source code
โ”‚   โ”œโ”€โ”€ api/              # API integration
โ”‚   โ”‚   โ””โ”€โ”€ data_fetcher.py
โ”‚   โ”œโ”€โ”€ processing/       # Data processing
โ”‚   โ”‚   โ”œโ”€โ”€ data_cleaner.py
โ”‚   โ”‚   โ””โ”€โ”€ feature_engineer.py
โ”‚   โ”œโ”€โ”€ analysis/         # Analysis modules
โ”‚   โ”‚   โ”œโ”€โ”€ historical_analysis.py
โ”‚   โ”‚   โ”œโ”€โ”€ portfolio_tracker.py
โ”‚   โ”‚   โ””โ”€โ”€ sentiment_analyzer.py
โ”‚   โ”œโ”€โ”€ components/       # UI components
โ”‚   โ”‚   โ”œโ”€โ”€ chart_generator.py
โ”‚   โ”‚   โ””โ”€โ”€ table_display.py
โ”‚   โ””โ”€โ”€ utils/           # Utilities
โ”‚       โ””โ”€โ”€ database.py
โ”‚
โ”œโ”€โ”€ scripts/             # Helper scripts
โ”‚   โ”œโ”€โ”€ setup_env.py    # Environment setup
โ”‚   โ””โ”€โ”€ update_data.py  # Data update script
โ”‚
โ””โ”€โ”€ data/               # Data storage
    โ”œโ”€โ”€ raw/           # Raw API data
    โ”œโ”€โ”€ processed/     # Processed data
    โ””โ”€โ”€ exports/       # Exported CSV files

๐Ÿ“Š Usage Guide

Market Overview

  • โ€”View major market indices (S&P 500, Dow Jones, NASDAQ)
  • โ€”See top gainers and losers
  • โ€”Analyze sector performance
  • โ€”Check overall market sentiment

Stock Dashboard

  1. 1.Enter a stock symbol (e.g., AAPL, MSFT, GOOGL)
  2. 2.Select time period for analysis
  3. 3.Click "Analyze" to load data
  4. 4.View:
  5. 5.Current price and key statistics
  6. 6.Interactive price charts (candlestick or line)
  7. 7.Technical indicators (Moving Averages, RSI, MACD)
  8. 8.Performance metrics (returns, volatility, Sharpe ratio)
  9. 9.Company information

Data Export

  1. 1.Choose export type:
  2. 2.Historical Prices
  3. 3.Company Fundamentals
  4. 4.Multiple Stocks Comparison
  5. 5.Configure parameters (ticker, time period, etc.)
  6. 6.Click "Generate CSV"
  7. 7.Preview the data
  8. 8.Click "Download CSV" to save

๐Ÿ”ง Configuration

API Keys

For advanced features (news data), you can set API keys:

  • โ€”Create a .env file in the project root
  • โ€”Add: NEWS_API_KEY=your_key_here

Default Settings

Edit config/settings.py to customize:

  • โ€”Default stocks and indices
  • โ€”Chart colors and themes
  • โ€”Cache settings
  • โ€”Update frequency

๐Ÿ“ˆ Technical Indicators

The tool provides various technical indicators:

  • โ€”Moving Averages (20, 50, 200-day)
  • โ€”RSI (Relative Strength Index)
  • โ€”MACD (Moving Average Convergence Divergence)
  • โ€”Bollinger Bands
  • โ€”Volatility (Daily and Annualized)

๐Ÿ”„ Updating Data

To fetch the latest market data:

bash
python scripts/update_data.py

This script can be scheduled to run periodically (e.g., hourly) using cron (Linux/Mac) or Task Scheduler (Windows).

๐Ÿ“ Data Sources

  • โ€”Stock Data: Yahoo Finance (via yfinance library)
  • โ€”Market Indices: Yahoo Finance
  • โ€”Company Fundamentals: Yahoo Finance

โš ๏ธ Limitations

  • โ€”Data is delayed (not real-time)
  • โ€”Free API rate limits apply
  • โ€”Local deployment only (single user)
  • โ€”Demo version with basic features

๐Ÿ› ๏ธ Troubleshooting

Issue: Module not found error

Solution: Ensure all dependencies are installed:

bash
pip install -r requirements.txt

Issue: No data returned for ticker

Solution:

  • โ€”Check the ticker symbol is correct
  • โ€”Verify internet connection
  • โ€”Try a different ticker
  • โ€”Check if market is open

Issue: Charts not displaying

Solution:

  • โ€”Clear browser cache
  • โ€”Refresh the page
  • โ€”Check console for errors

๐Ÿ”ฎ Future Enhancements

  • โ€”[ ] Real-time data integration
  • โ€”[ ] Advanced portfolio analytics
  • โ€”[ ] Alert notifications
  • โ€”[ ] Custom watchlists with persistence
  • โ€”[ ] Social sentiment analysis
  • โ€”[ ] Comparison tools
  • โ€”[ ] Mobile-responsive design
  • โ€”[ ] Cloud deployment

๐Ÿ“„ License

This is a demo project for personal use.

๐Ÿค Contributing

This is a personal demo project, but suggestions are welcome!

๐Ÿ“ง Contact

For questions or issues, please refer to the project documentation.


Disclaimer: This tool is for educational and research purposes only. It does not provide investment advice. Always do your own research and consult with financial professionals before making investment decisions.