index-bot
is an open-source stock (forex) bot that uses the the following data to notify the user via Telegram.
For now it's using the following market data:
- Volatility Index - VIX CBOE
- S&P500 Index - companies by Weight (aka S&P 500 index)
This bot will inform you via Telegram, when a certain threshold limit is reached on the VIX volatility market index (on NYSE) and or whenever there is an up- or downtrend in the S&P 500 market. Technical analysis is applied to determine the up- or downtrend of the S&P 500 index.
This bot is written in JavaScript and run on NodeJS.
Node.js:
curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
pnpm
package manager:
curl -fsSL https://get.pnpm.io/install.sh | sh -
You can join the public Stock Exchange Telegram channel, where this bot is connected to.
Or since this project is open-source, you can setup your own index-bot
as well as your own Telegram Bot. See below.
Use the DockerHub Docker image (see also: Dockerfile).
-
Copy/rename the config template file to
config.yml
, can be stored anywhere on your machine:cp configTemplate.yml config.yml
-
Now change the
config.yml
to your needs (see "Most important Settings" section below). -
Start Docker container by providing the
config.yml
from outside the Docker container (by default using current working directory,pwd
, on your host machine):docker run --restart always -p 127.0.0.1:3008:3008 -v $(pwd)/config.yml:/app/config.yml -d danger89/index-bot
Note: The command above should pull the image automatically from Docker Hub.
You can also use docker-compose
, see docker-compose.yml.
Follow the steps:
- Copy the config template to
config.yml
:cp configTemplate.yml config.yml
- Change the configuration settings, webhook domain for Telegram bot and API keys for the stock data
- Install dependencies via:
pnpm install
(once needed) - Start the bot using:
pnpm start
During development you could use: pnpm run start-fake
. Which will start the app, but not connect to the TwelveData API.
Advice: Run the bot 24/7 on some dedicated hardware. cron_time
within the configuration will take care of the triggers when to look-up for data.
Hidden feature: Set DEBUG
to true
value in the dataProcessor.js source file to dump the market data to a comma-seperated values (CSV) file. Useful for off-line verification/calculations.
The following settings require definitely some attention during setup:
exchange_settings -> use_cache
- Set toFalse
to not use any local caching, needed for production!exchange_settings -> api_key
- TwelveData API Key (create one on their site)telegram_settings -> bot_token
- Token from Telegram, created via @BotFathertelegram_settings -> public_url
- Telegram public URL for Webhooktelegram_settings -> chat_id
- Telegram channel name including '@' or any other chat ID.
There are also 2 environment variables available to set:
HOST
(default:0.0.0.0
)PORT
(default:3008
)
- More info about VIX (Dutch)
- More info about S&P 500 (Dutch)