CoolFace
Apppublic

BaoKhuong/FinRobot-Forecaster-claude-4.1-opus

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
1likes
App README

๐Ÿค– FinRobot Forecaster

AI-powered stock market analysis and prediction using advanced language models

This application provides comprehensive stock market analysis by combining:

  • โ€”Real-time stock data from Alpha Vantage via RapidAPI (premium access)
  • โ€”Company news and sentiment from Finnhub
  • โ€”Advanced AI analysis using Google's Gemini models
  • โ€”Financial metrics and historical performance data

๐Ÿš€ Features

  • โ€”Stock Price Analysis: Analyze historical price movements over configurable time periods
  • โ€”News Sentiment Analysis: Process company news and market sentiment
  • โ€”AI-Powered Predictions: Generate detailed market outlook using advanced language models
  • โ€”Financial Metrics: Optional inclusion of basic financial data
  • โ€”Interactive Interface: User-friendly Gradio interface for easy interaction

๐Ÿ“Š How It Works

  1. 1.Data Collection: Fetches historical stock data and recent company news
  2. 2.Analysis: Processes the data to identify trends and patterns
  3. 3.AI Processing: Uses Google Gemini to analyze the information
  4. 4.Prediction: Generates structured predictions with:
  5. 5.Positive developments
  6. 6.Potential concerns
  7. 7.Price outlook with rationale

๐Ÿ› ๏ธ Setup Instructions

For HuggingFace Spaces:

  1. 1.Fork this repository to your HuggingFace account
  2. 2.Deploy: The Space will automatically build and deploy
  3. 3.All API keys are already included in the code
  4. 4.Multiple API keys are used for better reliability and rate limit handling

For Local Development:

  1. 1.Clone the repository:
bash
   git clone <your-repo-url>
   cd finrobot-forecaster
  1. 1.Install dependencies:
bash
   pip install -r requirements.txt
  1. 1.Run the application:
bash
   python app.py

๐Ÿ“ˆ Usage Examples

Try these popular stocks:

  • โ€”AAPL (Apple Inc.)
  • โ€”MSFT (Microsoft Corporation)
  • โ€”GOOGL (Alphabet Inc.)
  • โ€”TSLA (Tesla Inc.)
  • โ€”NVDA (NVIDIA Corporation)

โš™๏ธ Configuration Options

  • โ€”Stock Symbol: Enter any valid ticker symbol
  • โ€”Historical Weeks: Choose 1-6 weeks of historical data
  • โ€”Basic Financials: Toggle to include financial metrics

๐Ÿ”ง Technical Details

  • โ€”Framework: Gradio 5.46.0
  • โ€”AI Model: Google Gemini 1.5 Pro
  • โ€”Data Sources: RapidAPI Alpha Vantage (2 premium keys), Finnhub
  • โ€”Language: Python 3.11
  • โ€”Container: Optimized for HuggingFace Spaces

๐Ÿ“ Output Format

The AI analysis provides:

[Positive Developments]

  • โ€”Key positive factors affecting the stock
  • โ€”Recent achievements and growth indicators

[Potential Concerns]

  • โ€”Risk factors and challenges
  • โ€”Market uncertainties

[Prediction & Analysis]

  • โ€”One-week price outlook
  • โ€”Detailed rationale for the prediction

๐Ÿ›ก๏ธ Error Handling & Reliability

Comprehensive Fallback System:

  1. 1.Primary: RapidAPI Alpha Vantage (2 premium keys with rotation)
  2. 2.Secondary: Mock data generation (for demonstration)

API Key Rotation:

  • โ€”Automatic switching between RapidAPI keys
  • โ€”Rate limit detection with seamless fallback
  • โ€”Comprehensive logging for debugging
  • โ€”Graceful degradation at every level

Error Recovery:

  • โ€”Timeout handling: 30-second timeout with retry logic
  • โ€”Rate limit management: Automatic key rotation
  • โ€”Mock data fallback: App always works for demonstration
  • โ€”User-friendly messages: Clear error communication

โš ๏ธ Disclaimer

Important: This application is for educational and research purposes only. The predictions and analysis provided should not be considered as financial advice. Always consult with qualified financial professionals before making investment decisions.

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.

๐Ÿ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • โ€”FinRobot - Original FinRobot framework
  • โ€”Google AI - Gemini models
  • โ€”[RAPID] - Stock market data
  • โ€”Finnhub - Financial news and data
  • โ€”Gradio - Web interface framework

Built with โค๏ธ for the financial AI community