Skip to content
robdevopsPublic

About

Chat bot for Sharesight, Yahoo Finance, Discord, Slack, and Telegram

Topics

Resources

Stars

11 stars

Watchers

0 watching

Forks

Repository files navigation

finbot

finbot is a chat bot that follows your Sharesight portfolios and each chat's watchlist with Yahoo Finance data. It posts trades, price moves, earnings and ex-dividend dates, analyst rating changes and more on a schedule, and answers commands with reports and charts.

If you don't have Sharesight, you can still add your holdings manually via the watchlist (/watchlist add SYMBOL).

Features

  • Telegram, Slack and Discord (either the push or the pull method, depending on your environment)
  • Sharesight trades as they happen, portfolio performance comparisons
  • Charts with buttons to change the time period
  • Alerts of daily price movements past a threshold, earnings and ex-dividend dates, analyst rating changes, short interest, record highs
  • Stock lookup and comparisons, rankings by P/E, PEG, market cap or analyst rating
  • /command, @bot, schedule, or button driven.

Screenshot of showing trade notifications on Slack

Quick start

Run finbot with Docker or with Python.

With Docker

On a Linux host with Docker:

  1. git clone https://github.com/robdevops/finbot /opt/finbot
  2. sudo /opt/finbot/util/docker_setup.sh
  3. Set the keys of each network you use in /opt/finbot.env (below)
  4. cd /opt/finbot && sudo docker compose up -d --build
  5. journalctl CONTAINER_NAME=finbot -f

With Python

On Linux, macOS or WSL, with Python 3.12 or later:

  1. git clone https://github.com/robdevops/finbot ~/finbot && cd ~/finbot
  2. python3 -m venv .venv && .venv/bin/pip install -r requirements.txt -r requirements-optional.txt (on Debian and Ubuntu, sudo apt install python3-venv first)
  3. cp defaults/finbot.env ~/finbot.env && chmod 600 ~/finbot.env, then set the keys of each network you use in it (below)
  4. .venv/bin/python util/check_config.py ~/finbot.env
  5. (set -a && . ~/finbot.env && exec .venv/bin/python bot.py), which logs to the terminal until Ctrl-C

To run it as a service, under systemd on a Debian host, see doc/install.md.

The chat networks

By default, finbot fetches its updates from each network itself (pull mode), which is what this quick start guide covers. Alternatively, if you prefer to run an HTTPS gateway (a reverse proxy on a domain with a valid certificate), push mode subscribes the bot to the updates each network pushes to it (see each guide's push mode).

  • Telegram: create the bot with @BotFather, set telegramBotToken, restart finbot (guide).
  • Slack: create the app from the manifest that util/slack_manifest.py prints, add an app-level token, set slackBotToken and slackAppToken, restart finbot (guide).
  • Discord: create the application and its bot, turn on its Message Content intent, set discordBotToken, restart finbot (guide).

Then send /help in a chat with the bot. Commands work as plain messages too (.help), which are quicker to type on a phone (Commands). From its first command, each chat has the default scheduled jobs, which /jobs switches on and off, adds to and runs (Scheduling).

Documentation

Issues

  • Bug reports welcomed
  • PRs are welcome, but not guaranteed to be merged

About

Chat bot for Sharesight, Yahoo Finance, Discord, Slack, and Telegram

Topics

Resources

Stars

11 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages