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.
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.
- Fetches historical stock prices for the past 6 months using
yfinance. - Includes Open, High, Low, Close prices, and Trading Volume.
- 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.
- Uses
phi.agentwithGroqmodels to fetch:
Latest News Articles on the stock
Analyst Recommendations (Buy/Sell/Hold Ratings) - Searches the web using
DuckDuckGofor real-time information.
- Programming Language: Python
- Libraries:
yfinance– Fetches stock market dataplotly– Creates interactive chartspandas– Data manipulationdotenv– Manages environment variablesphi.agent– AI-powered stock insightsGroq– Llama 3 AI model integration
git clone https://github.com/Or4cle404/Stock-Analysis-Agent.git cd Stock-Analysis-Agentpip install -r requirements.txtCreate a .env file and add these keys in it.
PHI_API_KEY = "API_KEY" GROQ_API_KEY = "API_KEY"python stock_analysis.py- Name: Ayushi Anand
- Email: aanandayushi04@gmail.com
- GitHub: https://github.com/Or4cle404





