Skip to content

itsmohitnarayan/AI-Stock-Market-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI-Stock-Market-Agent

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.

Features

  • 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.

Preview

Screenshot (30) Screenshot (31) Screenshot (32) Screenshot (33)

Setup

Prerequisites

  • Python 3.7 or higher
  • Pip (Python package installer)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/AI-Stock-Market-Agent.git
    cd AI-Stock-Market-Agent
    
  2. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install the required packages:

pip install -r requirements.txt
  1. 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

Usage

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.

Testing

1.Run the unit tests:

python -m unittest test_app.py

File Structure

  • 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.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages