Skip to content

amquesteducation/NIFDA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NIFDA_NEW

create a virtulal env

WAY- 1

virtualenv venv

way - 2

python -m venv

way - 3

conda create -n <env_name> python=3.11 -y

Next install the library

pip install -r requirements.txt

Run the streamlit app

streamlit run

Stock Analysis Agent

Overview

The stock analysis agent is an AI-powered investment recommendation system built with LangGraph and Streamlit. It analyzes stock data and news to provide investment recommendations.

Features

  • 📊 Real-time stock data from Yahoo Finance
  • 📰 Latest news articles via Serper API
  • 🤖 AI-powered investment recommendations (BUY/HOLD/SELL)
  • 🚀 Parallel processing for faster analysis
  • 💡 Clean, lightweight Streamlit UI

Setup

  1. Install dependencies:

    pip install -r requirements.txt
  2. Set up environment variables: Create a .env file in the project root with:

    OPENAI_API_KEY=your_openai_api_key_here
    SERPER_API_KEY=your_serper_api_key_here
    

Running the Application

Option 1: Streamlit App (Recommended)

cd stock_analysis
streamlit run streamlit_app.py

Option 2: Jupyter Notebook

cd stock_analysis
jupyter notebook stock_analysis.ipynb

How It Works

The agent uses LangGraph with three nodes that run in parallel:

  1. Yahoo Finance Node (get_stock_data):

    • Fetches historical stock data (1 year)
    • Calculates key metrics (price, moving averages, volume, P/E ratio, etc.)
    • Provides technical indicators
  2. Serper News Node (get_stock_news):

    • Fetches top 10 recent news articles about the stock
    • Extracts titles, summaries, sources, and links
    • Captures market sentiment
  3. Analysis Node (analyze_investment_decision):

    • Combines stock data and news
    • Uses GPT-4o-mini to analyze and provide:
      • Summary of key findings
      • Risk assessment
      • Investment recommendation (BUY/HOLD/SELL)
      • Reasoning and key factors to monitor

Usage

  1. Open the Streamlit app in your browser
  2. Enter a stock ticker symbol (e.g., AAPL, MSFT, GOOGL)
  3. Click "Analyze Stock"
  4. View the results:
    • Stock data with key metrics
    • Recent news articles
    • AI-generated investment recommendation

Example Tickers

  • AAPL - Apple Inc.
  • MSFT - Microsoft Corporation
  • GOOGL - Alphabet Inc.
  • TSLA - Tesla Inc.
  • AMZN - Amazon.com Inc.

Notes

  • The analysis is for informational purposes only
  • Always do your own research before making investment decisions
  • API rate limits may apply based on your subscription plans

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published