Git Product home page Git Product logo

reddit-stock-trends's Introduction

Reddit Stock Trends ๐Ÿ“ˆ

See trending stock tickers on Reddit and check Stock perfomance

GitHub issues

Backend

Reddit API

  • Get your reddit API credentials from here.
  • Follow this article to get your credentials.
  • 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.

Local usage

  • Install required modules using pip install -r requirements.txt.
  • Run ticker_counts.py first.
  • Now run yfinance_analysis.py.
  • You will be able to find your results in data/ directory.
  • [Optional] Run wsgi.py to start a server that returns the data in JSON format. This step will generate the csv files if they don't already exist.

Frontend - Vue

There's also a JavaScript web app that shows some data visualizations.

Local usage

Start the local server. This server will generate the csv files if they don't already exist.

cd back
python wsgi.py

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

Docker usage

  • Requires Docker 17.09.0+ and docker-compose 1.17.0+
  • make sure you have .env or a system wide export for the var VUE_APP_API_URL, see env.example
  • docker-compose up -d to start all services in the background. (-d == detatched)
  • docker-compose up <servicename> to bring up a specific service.
  • docker-compose rm removes the image
  • docker-compose ps to list running services
  • docker-compose up --build if you made changes to the compose or dockerfiles and need it built into a new image.
  • docker-compose build --no-cache if you made changes to specific files and docker does not recognize as new thereby reusing cached layers incorrectly. This takes about 3 minutes on a gaming pc with 0 docker tuning.
  • compose.yml determines service names and which ports are bound to your host. By default front=8080 back=5006.
  • Once up navigate to http://localhost:8080/.
  • docker-compose stop stops all services

Frontend - React

There's also a React JavaScript web app that has +3 more features than the vue app.

  • shows all available data on one site/table
  • you can sort the data by clicking the header name, if you want see what ticker had the most 5d Change for example
  • the tickername is a direct link to the tradeview overview site for the ticker if you find a ticker interesting and want to analyse it

Local usage

Start the local server. This server will generate the csv files if they don't already exist.

cd back
python wsgi.py

Then, launch the client

cd react-front
cp .env.example .env
npm install
npm start

You can change the env variables if you need to

No Docker solution for the react app.


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

Sponsors

TickerHype: https://tickerhype.com/


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.

reddit-stock-trends's People

Contributors

iam-abbas avatar vmuriart avatar mpagels avatar gamcoh avatar tyler-barham avatar valoriss avatar denbergvanthijs avatar sicxnull avatar jonaswang avatar harshcasper avatar boboman-1 avatar pcheng17 avatar ian-myers avatar cpapadopoulos-signal avatar brunobarros avatar caticoa3 avatar skullzarmy avatar nighkali avatar matthew11j avatar jtrain184 avatar s0meguy1 avatar vitosamson avatar cstanford avatar cypherius17 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.