Skip to content

villqrd/Reddit-Stock-Trends

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reddit Stock Trends 📈

See trending stock tickers on Reddit and check Stock perfomance

GitHub issues

Usage

Reddit API

  • Get your reddit API credentials from here
  • Follow this article to get your credentials.

Running Scripts

  • Go to back/ directory.
  • Create a praw.ini file with the following
[ClientSecrets]
client_id=<your client id>
client_secret=<your client secret>
user_agent=<your user agent>

Note that the title of this section, ClientSecrets, is important because ticker_counts.py will specifically look for that title in the praw.ini file.

  • Install required modules using pip install -r requirements.txt
  • Run ticker_counts.py first
  • Now run yfinance_analysis.py
  • Currently the default number of tickers analyzed is 25 but yfinance does accept a number as an argument if you want more or less tickers -- eg/ python yfinance_analysis.py 20 return 20 tickers analyzed.
  • You will be able to find your results in data/ directory.

Web app

There's also a JavaScript web app that shows some data visualizations if you don't want to read the csv files.

Usage

Once you finished running the scripts, you'll have to set up the local server

cd back
python wsgi.py [path to data file]

The argument [path to data file] is optional and defaults to ./data/df_best_25.csv. If you fetched a different number of tickers in the yfinance_analysis.py script, you'll want to use this argument to point to the data file that was created (e.g., python yfinance_analysis.py 50 –> ./data/df_best_50.csv).

Then, launch the client

cd front
cp .env.example .env
npm install
npm run serve

You can change the env variables if you need to


Ticker Symbol API - EOD Historical Data

Included for potential future use is a csv file that contains all the listed ticker symbols for stocks, ETFs, and mutual funds (~50,000 tickers). This was retrieved from https://eodhistoricaldata.com/. You can register for a free api key and get up to 20 api calls every 24 hours.

To retrieve a csv of all USA ticker symbols, use the following:

https://eodhistoricaldata.com/api/exchange-symbol-list/US?api_token={YOUR_API_KEY}

Contribution

I would love to see more work done on this, I think this could be something very useful at some point. All contributions are welcome. Go ahead and open a PR.

  • Join the Discord to discuss development and suggestions.

To Do

See this page.

Suggestions are appreciated.

Donation

If you like what I am doing, consider buying me a coffee this helps me give more time to this project and improve.

Buy Me A Coffee


If you decide to use this anywhere please give a credit to @abbasmdj on twitter, also If you like my work, check out other projects on my Github and my personal blog.

About

Fetch currently trending stocks on Reddit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 58.5%
  • TypeScript 18.2%
  • Vue 15.9%
  • HTML 6.2%
  • Other 1.2%