Coder Social home page Coder Social logo

luisgc93 / stock_reminder_bot Goto Github PK

View Code? Open in Web Editor NEW
27.0 3.0 7.0 6.82 MB

A twitter bot that reminds you of stock and crypto predictions

Home Page: https://twitter.com/stock_reminder

License: MIT License

Python 98.05% Dockerfile 0.28% Makefile 1.49% Shell 0.18%
tweepy alpha-vantage twitter-bot peewee pytest travis-ci python financial-data alphavantage

stock_reminder_bot's People

Contributors

dependabot[bot] avatar luisgc93 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

stock_reminder_bot's Issues

Add shorting of stocks

When creating reminders, it is assumed that the user buys the stock. It would be nice if users could short the stock as well. E.g. "@stock_reminder short $BTC, remind me in 2 weeks".

Improve stock not found handling in mentions with multiple stocks

When a mention contains multiple stocks and one of them is not found (e.g. due to a typo or the stock not trading in the NASDAQ), the bot should reply saying that it will remind the user of those stocks that have been found but that one (or more ) of them couldn't be found.

Instead, what happens currently is that the bot responds with the stock not found reply:

bot_mention

This is despite succesfully creating reminders for the other stocks ($BABA and $BTC in the above example. $TCENY is a typo and should be $TCEHY instead, hence why the stock wasn't found).

Add logs

For some reason only print statements show up in the heroku container logs. Fix this and add relevant logs.

New feature idea - compare stocks

Similar to the report feature but you use PE and other metrics to assess which company is better on paper. E.g. @stock_reminder compare $AAPL and $MSFT. The response could include a similar report image with PER and EPS ratios and a buying recommendation.

Consider using redis

An event-based architecture where redis notifies the bot about new mentions might be better than having the bot query the database every 2 minutes.

Add reminders for stocks reaching a particular price

E.g. create reminders for stocks reaching new all time highs or a specific price. Example response "@user knock knock. It's your favourite twitter bot. Just wanted to let you know that $BTC is now worth 100,000$. It's taken 3 months and 17 days since the reminder was set."

Improve report image appereance

The basic features of #7 are covered but the appearance of the report details needs some work.

The current implementation for generating the image and adding the test uses the Pillow library, which is not designed specifically for generating images based on a table.

An alternative approach would be to save the report data into a pandas data frame which would then be converted into a table and saved as a .png file. I had to revert my attempt of this since the dfi.export method caused an OSError error: Chrome executable not able to be found on your machine

c5d88fc

The approach would be something like this:
https://stackoverflow.com/questions/35634238/how-to-save-a-pandas-dataframe-table-as-a-png

I was able to create this locally but it raised an OSError when deployed:

image

Add feature for showing user track record

When a user mentions the bot with "@stock_reminder show me my track record" or something among those lines, the bot replies with a list of stocks and investment results that the user created reminders for. E.g.: "$JNJ 4.3%, $BABA -3.2% etc."

Support stock splits

As mentioned in the project's reddit thread the bot doesn't support stock splits.

If a user generates a reminder for a stock that undergoes a split before the reminder date, the results will show a large decrease in stock price, when this might not be the case.

To fix this, the OVERVIEW alpha vantage endpoint could be used to check the LastSplitDate and MarketCapitalization fields:

https://github.com/RomelTorres/alpha_vantage/blob/62db439b3a43aa9b5c1e0fc79ff51ec70ac1cce1/alpha_vantage/fundamentaldata.py#L22

Add more response images/GIFs

It's be nice if the bot could respond with different GIFs depending on the investment outcomes.

Adding more images other than the Mr. Burns and Scrooge McDuck ones would also be a good enhancement.

Refactor bot.py

Just how the test suite was split into several modules, the same should probably be done for bot.py since the code is getting a bit spaghetti.

Some ideas of how it could be broken down:

  • Modules for methods with outside API calls vs methods that don't have outside calls
  • One module for each feature e.g. reply_mentions.py, publish_reminders.py, generate_report.py

Add support for intra-day trading

This would involve 3 things:

  1. Add an is_finished (boolean, default False) attribute to the Reminder model to avoid duplicate replies
  2. Convert remind_on from date field to datetime field (add new column remind_on_new, then add the values by using remind_on date plus plus 12:00 UTC, then drop remind_on and rename remind_on_new to remind_on)
  3. Run publish_reminders every 2 minutes like we do with reply_to_mentions

This way we'll be able to support mentions like:
image

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.