Welcome! EquityBot is a Discord bot written in Python for equity analysts and finance enthusiasts.
This bot allows you to do the following:
- Check the price of stocks real-time from Yahoo Finance by providing their symbols.
- Get charts of stocks from TradingView with provided specifications.
- Get news related to the provided stocks from TradingView in the specified interval.
- Create, edit, and call a watchlist of stocks. Here, call means to check the prices of the stocks in the watchlist.
Scrapes the price of the provided stock from Yahoo Finance.
Gets charts with provided specifications from TradingView. Although it does work with cryptocurrency pairs to an extent, it is meant only for equity stocks listed on TradingView.
Providing a timeframe, indicator, exchange, or other options are all completely optional and you can call this command with just a market/TradingView pair and it will default to the other options to TradingView's chart defaults (such as one hour timeframe, no indicators, and so on).
- Tickers: Whatever tickers that TradingView supports.
- Timeframes: 1m, 1, 3m, 3, 5m, 5, 15m, 15, 30m, 30, 1h, 60, 2h, 120, 3h, 180, 4h, 240, 1d, d, day, daily, 1w, w, week, weekly, 1mo, m, mo, month, monthly
- Indicators: bb, bbr, bbw, crsi, ichi, ichimoku, macd, ma, ema, dema, tema, moonphase, pphl, pivotshl, rsi, stoch, stochrsi, williamr
- Other Options: wide (widens the image to show more history), bera, blul (I won't tell you what these do, go ahead and try them yourself)
Scrapes news from TradingView.
For intervals, h
corresponds to hours, d
corresponds to days, w
corresponds to weeks, m
corresponds to months, and y
corresponds to years.
The provided date must be in the format YYYY:MM:DD
.
The provided dates must be in the format YYYY:MM:DD. Also, date1
must be that date which comes first chronologically.
Creates a new watchlist or overwrites an existing one.
Adds tickers to a pre-existing watchlist (if they aren't already present).
Removes tickers from a pre-existing watchlist (if they are present).
Gets the price of all the tickers in the watchlist from Yahoo Finance.
Returns a link to this README.md.
Have a look at these pictures.
Firstly, make sure you have PostgreSQL 14.4+ and Python 3.10+ installed. Once that is done, create a PostgreSQL database by the name of bot_db
.
Next, create a .env
file in the project's root directory in the following format:
BOT_TOKEN="<Discord bot token>"
DB_USER="<Database username>"
DB_PW="<Password for the entered database username>"
Next, cd
into the root directory of the local repo and run the following command:
pip install -r requirements.txt
Finally, run the script:
For Unix: python3 main.py
For Windows: python main.py
- Making the
!help
command return command documentation in the Discord channel itself instead of returning a link to this README.md file. - Breaking up the code into helper functions and different files to make it more loosely coupled.
A part of this bot's source code (specifically, the charts function) has been inspired by that of TsukiBot (which is written in JavaScript), so I would like to thank its creator(s).