Skip to content

A stock market analysis is an multi-agent Agentic AI project using Python, yfinance, and AI agents.

Notifications You must be signed in to change notification settings

Or4cle404/Stock-Analysis-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

Stock Analysis Agent

This project analyzes stock market trends using Yahoo Finance (yfinance) for data retrieval, Plotly for visualization, and AI agents powered by the phi framework to fetch real-time financial news and analyst recommendations.

Project Overview

The Stock Analysis Agent allows users to enter a stock ticker symbol and retrieve:

  • Historical Stock Data (Last 6 months)
  • Visualizations (Stock Prices, Candlestick Charts, Moving Averages, Volume Trends)
  • AI-Powered Insights (Latest news & analyst recommendations via phi.agent)

This tool is useful for investors, traders, and financial analysts who want quick insights into stock performance and market trends.


Features

1. Stock Data Retrieval

  • Fetches historical stock prices for the past 6 months using yfinance.
  • Includes Open, High, Low, Close prices, and Trading Volume.

2. Visualizations

  • Line Chart: Tracks stock price movement over time.
  • Candlestick Chart: Represents daily stock price fluctuations.
  • Moving Averages: Displays SMA (20-day) and EMA (20-day) to analyze trends.
  • Trading Volume Chart: Shows buying and selling activity.

3. AI-Powered Financial Insights

  • Uses phi.agent with Groq models to fetch:
    Latest News Articles on the stock
    Analyst Recommendations (Buy/Sell/Hold Ratings)
  • Searches the web using DuckDuckGo for real-time information.

Tech Stack Used

  • Programming Language: Python
  • Libraries:
    • yfinance – Fetches stock market data
    • plotly – Creates interactive charts
    • pandas – Data manipulation
    • dotenv – Manages environment variables
    • phi.agent – AI-powered stock insights
    • Groq – Llama 3 AI model integration

Installation & Setup

1. Clone the Repository

git clone https://github.com/Or4cle404/Stock-Analysis-Agent.git
cd Stock-Analysis-Agent

2. Install Dependencies

pip install -r requirements.txt

3. Set Up Environment Variables

Create a .env file and add these keys in it.

PHI_API_KEY = "API_KEY"
GROQ_API_KEY = "API_KEY"

4. Run the Project

python stock_analysis.py

When prompted, enter a stock ticker symbol.

5. Result:

image image image image image image


About

A stock market analysis is an multi-agent Agentic AI project using Python, yfinance, and AI agents.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages