An agent for stock market analysis using AI. This application provides insights on stocks based on real-time market data, news sentiment, and advanced technical analysis.
- Fetches real-time stock data and news.
- Analyzes stock performance using indicators like RSI.
- Interprets sentiment from financial news.
- Provides actionable insights and recommendations (Buy, Sell, Hold) using Google Gemini LLM.
- Displays current stock prices in the sidebar.
- Python 3.7 or higher
- Pip (Python package installer)
-
Clone the repository:
git clone https://github.com/yourusername/AI-Stock-Market-Agent.git cd AI-Stock-Market-Agent
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the required packages:
pip install -r requirements.txt
- Create a .env file with the necessary API keys:
ALPHA_VANTAGE_API_KEY="your_alpha_vantage_api_key"
GOOGLE_API_KEY="your_google_api_key"
SEARCH_ENGINE_ID="your_search_engine_id"
GEMINI_API_KEY="your_gemini_api_key"
Running the Application Run the Flask backend:
python app.py
Run the Streamlit app:
streamlit run streamlit_app.py
1.Open the Streamlit app in your browser. The default URL is http://localhost:8501
.
2.View current stock prices in the sidebar.
3.Enter a company name or stock symbol in the input field and click "Analyze Stock".
4.View the analysis results, including RSI, sentiment score, news summary, and LLM decision.
1.Run the unit tests:
python -m unittest test_app.py
app.py
: Flask backend for stock analysis & Streamlit frontend for user interaction.test_app.py
: Unit tests for the Flask backend..env
: Environment variables (not included in the repository)..gitignore
: Specifies files and directories to be ignored by Git.README.md
: Project documentation.
This project is licensed under the MIT License. See the LICENSE file for details.