Skip to content

Python project for sentiment analysis for r/WallStreetBets and YahooFinance, creating a stock chart with volume, and parsing for relevant news and posts

Notifications You must be signed in to change notification settings

eddwang/YahooBets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

YahooBets

Python project for sentiment analysis for r/WallStreetBets and Yahoo Finance, creating a stock chart with volume, and parsing for relevant news and posts

Description:

This Python application uses yfinance, Python Reddit API Wrapper (PRAW), Plotly, and Pandas to parse and utilize data from Yahoo Finance as well as r/WallStreetBets.

User is prompted for a stock ticker, which is then validated. The valid ticker is then used to parse through r/WallStreetBets relevant posts as well as Yahoo Finance's data to determine sentiment of a stock based on a scale from 1.0-5.0 (as seen below). Keywords are used to indicate attitude towards user-input stock.

Gif of sentiment analysis
Stock Recommendation Chart from Investopedia

PRAW and yfinance libraries are used to find and select relevant posts on r/WallStreetBets as well as news from Yahoo Finance. Lastly, yfinance and plotly libraries are used to visualize stock opening, closing, high, low, as well as volume on a candlestick chart (which opens on localhost).

Gif of news and post pulling from program
Image of stock chart from plotly

Table of Contents:

Technologies:

  • Python Reddit API Wrapper (PRAW) version: 7.6.0
  • yfinance version: 0.1.74
  • Pandas version: 1.4.4
  • Plotly version: 5.9.0

Setup:

To run this project, install these packages:

$ pip install praw
$ pip install yfinance
$ pip install pandas
$ pip install plotly

A Reddit username and password are required to run this program. Login or create an account here. Make sure the account is a standalone account that is not obtained via logging in through Google, Apple, etc.

A client ID and client secret is also required to use the Reddit API. You can register and obtain the required credentials by following the steps here.

Make sure to update the code at the top of the program to include your credentials.

Future Ideas:

I hope to implement this Python program into a web app, possibly through Django or Flask.

Credits:

Here are some resources I used to create this project.

Documentation:

Sentiment analysis:

Stock Chart

About

Python project for sentiment analysis for r/WallStreetBets and YahooFinance, creating a stock chart with volume, and parsing for relevant news and posts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages