Sentocks is a sentiments rating analysis tool! We know if traders are confident in a stock, then the said stock value goes up. What if we try to analyze people's feelings and emotions about something and see where we can go from there?
Sentocks or Sentimental Stocks grabs twitter feed by searching on pre-determined keywords and applies some quick sentiment analysis to get a rough estimate on one's sentiment about a topic.
Below is an example of how it looks for some companies on
2020-04-25
from 15:30 -> 00:30 UTC
The question is, is there a correlation between sentiments and the stock market?
Picture below is an example of comparing sentiment ratings and stock
market values on 2020-04-28
(Click to zoom in)
We have a collaboratory google jupyter notebook where you can add any endpoints and test the data for its correctness, etc. Python code there does all the plotting and figuring out the incoming format.
This is the layout of basic services we have running
server
: handles all interactions with the database, non-GET have to be authorizedtwippy
: actual twitter feed listener and raw sentiment submitter. Sends raw data toserver
josh
: takes raw data fromserver
and performs a window averaging algorithm to get processed sentiment databobby
: A small goroutine in server.go that deletes raw sentiment database entries that are more than 24 hours oldtrump
: same astwippy
but only listens for POTUS related keywordscaddy
: the webserver that proxies incoming requests toserver
andvuejs
postgres
: the database stores the companies, raw sentiments and processed average sentiment values.vuejs
: the frontend that connects to alphavantage api andserver
's processed sentiments
Everything is handled with a dockerfile and environmental variables. Run
cp .env.example .env
and fill out .env
to your liking, with your twitter keys and some unique WEB_KEY
If you're running a local caddy, leave CADDY_WEB_ADDRESS
as localhost
where you can later
access the website through localhost:2015
and api (server
) through localhost:2015/api/
You can test your twitter token by running ./scripts/tokentest.sh
You can test the python code by running ./scripts/pytest.sh
You can get Go dependencies for go testing by running ./scripts/deps.sh
You can test Go code by running ./scripts/test.sh
You can deploy a full environment by running ./scripts/prod.sh
- Sandy Urazayev - DB handling, Go/Python
- Drake Clark - Smoothing algorithm, Go/Python
- Ross Copeland - Infrastructure, Docker and documents
- Dylan Prebyl - Sentocks webpage, VueJS
- Jonathan Downs - Twippy, documentation, testing, Python
This project wouldn't be what it is without building upon the works of many other people:
- tweepy - a Python library for accessing the twitter API
- Alpha Vantage - an API for accessing realtime and historical stock data
- vaderSentiment - a sentiment analysis tool
- Gorm - an ORM library for Golang
- gorilla/mux - http router and URl matcher for Golang
- logrus - a Golang logging tool
- testify - a Golang testing tool
- Vue.js - a Javascript framework
- Chart.js - A Javascript chart making library
- Materialize - A front-end design framework (Javascript/css)
- Go - A programming language
- Python - Also a programming language
- Javascript - Yet another programming language
- Docker - A way of containerizing applications
- Caddy - An open source Golang webserver
- PostgreSQL - A database system
For all your licensing questions, please refer to our license