This project combines traditional technical analysis with artificial intelligence to provide comprehensive stock market predictions and analysis. The system processes real-time market data from major tech stocks (AAPL, MSFT, GOOGL, AMZN, TSLA) and generates actionable insights through:
-
Price Predictions
- Next-day price forecasts
- Trend direction indicators
- Confidence metrics for predictions
-
Technical Analysis Visualization
- Interactive price charts
- Moving averages (20-day and 50-day)
- RSI (Relative Strength Index) indicators
- Overbought/Oversold signals
-
AI-Powered Insights
- Market sentiment analysis
- Risk level assessment
- Trading recommendations (Buy/Hold/Sell)
- Automatic pattern recognition
-
Performance Metrics
- Current price vs predicted movement
- Technical indicator status
- Sentiment analysis scores
- Risk assessment levels
- Uses
yfinance
to fetch real-time stock data - Processes historical data for technical analysis
- Handles data cleaning and formatting for analysis
- Calculates Moving Averages (20-day and 50-day) for trend identification
- Implements Relative Strength Index (RSI) for overbought/oversold signals
- Processes price movements and volume data
- Utilizes OpenAI's API for sentiment analysis
- Processes financial news and market sentiment
- Incorporates AI-driven insights into the analysis
- Creates interactive price charts with technical indicators
- Displays RSI analysis with overbought/oversold zones
- Visualizes predicted price movements
- Shows sentiment analysis results
- Stock data fetching using yfinance
- Technical analysis with moving averages and RSI
- Price prediction using historical data
- Sentiment analysis integration
- Visualization of stock trends and indicators
fetch_stock_data()
: Retrieves historical stock datacalculate_technical_indicators()
: Computes technical analysis metricsanalyze_with_llm()
: Processes text data using LLManalyze_sentiment_batch()
: Batch processes sentiment analysisplot_predictions()
: Creates visualization of analysis results
- Python 3.x
- pandas: Data manipulation and analysis
- yfinance: Stock data retrieval
- numpy: Numerical computations
- scikit-learn: Data preprocessing
- matplotlib: Data visualization
- seaborn: Statistical data visualization
- openai: LLM integration
- Clone the repository
- Install required dependencies
- Set up OpenAI API key in .env file
- Run the Jupyter notebook
Create a .env file with:
OPENAI_API_KEY=your_api_key_here