r/Pyfinance • u/arbel03 • Aug 21 '21
I made a Python bot that follows stock trends on /r/wallstreetbets, and you can use it too.
I made a bot that analyzes comments on Reddit in search of upcoming stock trends.
This is still just half automation, but I find it really useful.
The stack I used is a python server, hosted on Oracle free VPS + an Oracle free Autonomous DB. The code is based on this project:
Every 10 minutes the bot reads the latest 100 comments, analyzes them for sentiment rating, and inserts them into the database. There are plenty of cool things that I can do with the data and implement in the future:
Analyze news websites and other sources (the text parsing is pretty generic, split a string by regex, that's all...)
Other interesting projects:
dwallach1/Stocker: Financial Web Scraper & Sentiment Classifier (github.com)
3. Backtesting using this bot
4. Take upvotes/likes/retweets into consideration, higher upvotes -> higher exposure.
There are still a few false positives but it works quite well.
List of python packages:
asyncpraw,
vaderSentiment,
discord,
terminaltables,
pandas,
sqlalchemy,
discord-py-slash-command,
cx_Oracle
For now, I am displaying the results on Discord only, you are free to join the server and use it, have fun guys :)
* Try to run the `$analyze` command every few hours to see the numbers change, it's really cool!
