Skip to content

blondon1/stocksML

Repository files navigation

Twitter Sentiment Analysis for Stock Market Prediction

Project Overview This project aims to analyze the sentiment of tweets related to specific stock symbols and correlate these sentiments with stock market movements. By streaming live tweets, performing sentiment analysis, and tracking stock price changes, we seek to uncover potential patterns or signals that could predict stock price trends.

The system utilizes Python for data processing, Tweepy for accessing the Twitter Streaming API, VaderSentiment for sentiment analysis, and Elasticsearch for data storage and analysis.

Features Live Tweet Streaming: Tracks tweets in real-time based on specified stock symbols. Sentiment Analysis: Analyzes the sentiment of each tweet to determine whether it's positive, negative, or neutral. Stock Price Tracking: Fetches historical and current stock prices for correlation analysis. Data Storage: Uses Elasticsearch to store and analyze tweet sentiments and stock prices efficiently. Technology Stack Python 3.x Tweepy VaderSentiment Elasticsearch Kibana (optional, for data visualization) Prerequisites Before setting up the project, ensure you have the following:

Python 3.6 or later installed. An Elasticsearch cluster running locally or remotely. Twitter Developer Account with access to the Twitter API. (Optional) Kibana setup for data visualization. Setup Instructions

  1. Clone the Repository bash Copy code git clone https://github.com//stocksml.git cd twitter-sentiment-stock-prediction
  2. Install Dependencies bash Copy code pip install -r requirements.txt
  3. Configure Application Create a config.py file in the root directory and update it with your Twitter API credentials and Elasticsearch configuration:

python Copy code

Twitter API Credentials

consumer_key = 'YOUR_CONSUMER_KEY' consumer_secret = 'YOUR_CONSUMER_SECRET' access_token = 'YOUR_ACCESS_TOKEN' access_token_secret = 'YOUR_ACCESS_TOKEN_SECRET'

Elasticsearch Configuration

elasticsearch_host = 'localhost' elasticsearch_port = 9200 elasticsearch_index = 'stocksight' 4. Run Elasticsearch Setup (Optional) If you're running Elasticsearch locally and haven't set up an index yet, execute the following script to create one:

bash Copy code python elasticsearch_setup.py 5. Start the Application bash Copy code python main.py Usage Once started, the application begins streaming tweets related to the configured stock symbols, analyzing their sentiments, and correlating these with stock price movements. Results are stored in Elasticsearch for further analysis or visualization.

Contributing Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs, feature requests, or improvements.

License MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors