Skip to content

lorcalhost/BTB-manager-telegram

Repository files navigation

Binance Trade Bot Manager Telegram

A Telegram bot for remotely managing Edendg23's Binance Trade Bot and its forks (Idkravitz's, Tntwist's, MasaiasuOse's being the major forks).

This program aims to be an easy way of managing Binance Trade Bot so that I wouldn't have to constantly ssh into my VPS, and my non-techy friends could enjoy the benefits of automated trading.

This program supports only Linux and WSL. Other distributions (BSD, MacOS, Windows, ...) are unmainted and support is not currently planned and is supposed to run 24/7. If you can't have a long running computer on linux, you can use a free VPS, such as Oracle Cloud's.

Manual install

Python 3.7, 3.8 or 3.9 is required.

0 - Create a dedicated folder

Create a dedicated directory for the binance trade bot and the present manager. In this tutorial, we will be using as an example the folder ~/trading-bot:

cd ~
mkdir trading-bot

1 - Install binance trade bot.

Choose the fork you want to use. The main one (Edendg23's) is fine to go with.

Place youself in the previously created directory, e.g.:

cd ~/trading-bot

Then follow the install instruction given on the binance-trade-bot's readme. Setup telegram bot during the install of binance-trade-bot (see the section Notifications with Apprise in the README)

Once the binance-trade-bot has been installed, make sure everything is properly installed : the following commands should yeild no errors.

cd ~/trading-bot
ls binance-trade-bot/binance_trade_bot/__main__.py
ls binance-trade-bot/config/apprise.yml

2 - Install the telegram manager next to the binance trade bot

As always, place youself in the install directory, e.g.:

cd ~/trading-bot

Then, run the following lines:

git clone https://github.com/lorcalhost/BTB-manager-telegram.git
cd BTB-manager-telegram
python3 -m pip install -r requirements.txt

Other Install Methods

Automated Install

For an automated install, please refer to Enriko82's Install Script

Docker Install

This method is discouraged as it is no longer maintained. If you crave to contain the bot and its manager, you can always use python's virtual environments. However, you can still find a docker setup guide here.

Usage

As the telegram bot is launching itself the Binance Trade Bot, you only have to start the BTB Manager Telegram like so:

python3 -m btb_manager_telegram

If the bot is running on a server you may want to keep it running even after ssh connection is closed by using nohup. Note the trailing "&" :

nohup python3 -m btb_manager_telegram &

However, you can run the bot with options :

# Autostart the Binance Trade Bot when the BTB Manager starts
# (Otherwise you will have to manually start the Binance Trade Bot from telegram)
python3 -m btb_manager_telegram -s

# Use the french translation. Available translation : en, ru, fr, de, nl, es, id, cn, pt
python3 -m btb_manager_telegram -l fr

# Make possible to plot the bot's performance in EUR instead of USD
python3 -m btb_manager_telegram -u EUR

# If using other currencies than USD or EUR, for example GBP, you will have to provide
# an openexchangerates API key, see the flag --oer_key.
# Get you key here : https://openexchangerates.org/signup/free
python3 -m btb_manager_telegram -u GBP -o OPENEXCHANGERATES_KEY

# Of course you can combine all of this!
python3 -m btb_manager_telegram -s -l fr -u EUR

# Using nohup with options
nohup python3 -m btb_manager_telegram -s -l fr -u EUR &

# See all available options
python3 -m btb_manager_telegram --help

Stopping the bot

If the trade bot has been launched with the telegram bot, stopping the telegram bot will stop the trade bot.

  • If the telegram bot has been launched without nohup, closing the terminal or pressing CTRL + C will stop the bot.

  • If the telegram bot has been launched with nohup, the bot can be stopped with the command kill $(cat btbmt.pid) (no animal will be hurt in this operation). If this command respond the file btbmt.pid, it his very likely the telegram bot is no longer running.

Manual upgrade

First of, stop the telegram bot.

git pull
python3 -m pip install --upgrade -r requirements.txt

You can now reboot the telegram bot.

Additional notes

Custom scripts

This bot supports custom scripts in a plugin manner. An extensive documentation on customs scripts is available here.

Telegram token and chat_id

Make sure that Binance Trade Bot's config/apprise.yml file is correctly setup before running, the telegram manager retreives this file to connect the bot.

If Binance Trade Bot and BTB-Manager-Telegram were not installed in the same parent directory or if apprise.yml is not setup or you want to use different token and chat_id from the ones in the apprise.yml file, you can set these two keys with the options --token and --chat_id

Virtualenvs

If the Binance Trade Bot has its own python environment, that is not shared with the telegram manager, you have to specify the path of the python binary used by the trade bot with the option --python_path. For example, if you created a virtualenv specific to the binance trade bot in the folder /home/user/trading_bot/binance-trade-bot/venv, you have to run the telegram bot like so:

python3 -m btb_manager_telegram --python_path /home/user/trading_bot/binance-trade-bot/venv/bin/python

Multiple bots

If you would like to run several Binance Trade Bot instances at the same time click here.

Compatibility

This program is fully compatible with Linux and Windows through WSL (Windows Subsystem for Linux).

Severa known problems are present on native Windows and will not be asserted.

MacOS compatibility is unknown, but supposed to be good ad this system is close to Linux.

Screenshots

Click here

         

Contributions and feature requests

If you have any feature requests please open an issue.

Contributions from anyone are welcome! Before opening pull requests please read the contributing guidelines.

Disclaimer

This project is for informational purposes only. You should not consider any such information or other material as legal, tax, investment, financial, or other advice. Nothing contained here constitutes a solicitation, recommendation, endorsement, or offer by me or any third party service provider to buy or sell any securities or other financial instruments in this or in any other jurisdiction in which such solicitation or offer would be unlawful under the securities laws of such jurisdiction.

If you plan to use real money, USE AT YOUR OWN RISK.

Under no circumstances will I or the project's maintainers be held responsible or liable in any way for any claims, damages, losses, expenses, costs, or liabilities whatsoever, including, without limitation, any direct or indirect damages for loss of profits.

Contributors ✨

Many people contributed to the project by providing ideas, finding bugs and helping in the development (Emoji Key ✨).
This project follows the all-contributors specification.


Lorenzo Callegari 乐子睿

🚇 ⚠️ 💻 📖 🚧 🐛 🤔

Dmytro Litvinov

💻 🤔 🚧 🧑‍🏫

Heitor Ramon Ribeiro

🤔 🎨

NovusEdge

💻

Sachin S. Kamath

🤔 📖

Hoang Dinh

🐛

Dmitry Kravtsov

🤔 💻

Florian Sydekum

💻

Nico L.

🐛

SeriousSeal

💻

titulebolide

📖 🚧 👀 🐛 🌍 ⚠️ 🔧

Stephen Goult

🐛

Patrick Weingärtner

💻 🤔 🌍 📖

Federico Arredondo

🌍

MasaiasuOse

🌍 📖

phoenix-blue

🌍

neuhausj

💻

Santiago Caro Duque

🐛

Ivan Myronov

🌍

Hieu Nguyen

🐛

Riza Abdul Aziz

🌍

Kelecheck

🌍

kentuki

🌍

maromalo

🐛 💻

Ulllas Bharadwaj

🤔 💻 🐛

Ren Kasiyas

🌍

KevinTroyT

🌍

Timur

💻 🌍

Diogo Marques

🌍

stavsher

💻