Freqtrade multibot configuration - tutorial for creating multiple trading bots on one single server
In this video I will show you how to create multiple bot instances on one trading bot server.
With multiple bots you can run multiple strategies on one exchange or can trade on multiple exchanges via one server.
The creation of multiple bot instances is not very difficult but you have to know the steps on how to do it.
This video will explain everything in detail.
This video was made on special request by one of my subscribers.
Hi there youtube and welcome to this video where I will be explaining how you can set up your Freqtrade server so that it can run multiple bots at the same time
After you have watched this video I hope you can create your own multibot server to run multiple strategies at the same time
I put a lot of effort in making these videos so please click the like button and give me a comment if these videos help you with making your own profitable trading bots
Also Please remember that this video is indented for entertainment and education purposes only. I am not pretending to be a professional and all information you see in this video are my personal experiences and knowledge from the books and websites i read.
Now lets move ahead with my setup for this video.
For these demonstrations I will make use Linux Mint virtual environment. I have installed freqtrade on this system as shown in one of my earlier videos.
All configurations are on my github page so you can follow along with this video.
If you want more specific information about freqtrade as your trading bot, strategy building, hyperopt or other bot information please use the freqtrade site. This site this is an excellent additional resource for this video.
Before I start with explaining how you can set up multiple bots on one single server instance I want to give some attention to the advantages and disadvantages of a setup like this
If you have a tight budgt or do not want to maintain multiple server instances, then a multibot setup on your server could be a good option\
Also If you want to run multiple strategies on one account, then a setup lie this could be beneficial
The disadvantages are that your hardware should be good enough to run multiple bots on and you should have a good internet connection because a lot of traffic will exchanged between the bot and you exchange
I have ran up to three bot instances on my raspberry pi three without any problems, but this was a install script environment.
Running three Docker containers proved to be too much for this system. But then again this could be because I did not configure My docker environment optimally, who knows.
The most obvious and most risky disadvantage is that, if your server crashes or breaks down,
then your bots are not working.
If you are not aware of this, then you might lose money because exit signals are not give to the exchange.
And always have good backups of your environment and strategies so that you can rebuild your server as quickly as possible.
The setup is quite simple
I have one server instance and in this case it is my linux virtual environment
I Have installed one freqtrade instance on that machine
Then I create multiple service scripts - you can see how I did this in my earlier video “the short and sweet guide to Freqtrade as a linux service” (https://youtu.be/Zi5DFF9rmUA)
These service scripts each point to a specific config file
And in this config file I tell the instance to use a certain strategy, create a specific trading database and configure the UI to that I can watch all bot performances from one single web interface
You can use the commands below to create multiple bots on the server
# Copy these files into the following directory: /etc/systemd/system # Start the service: sudo systemctl start freqtrade.service # Check the service status: sudo systemctl status freqtrade.service # Stop the service: sudo systemctl stop freqtrade.service # Enable the service at system startup (start at boot): sudo systemctl enable freqtrade.service # Disable the service at system startup (no start at boot): sudo systemctl disable freqtrade.service # After each service config change sudo systemctl daemon-reload # Show activity sudo tail -f /var/log/syslog
The codeblock for a service file is:
[Unit] Description=Freqtrade bot A [Service] WorkingDirectory=/opt/freqtrade ExecStart=/opt/freqtrade/.env/bin/freqtrade trade --config /opt/freqtrade/user_data/config_a.json Restart=always RestartSec=10 Type=notify NotifyAccess=all StandardOutput=syslog StandardError=syslog SyslogIdentifier=freqtrade_a User=root Group=root Environment=NODE_ENV=production [Install] WantedBy=multi-user.target
The config file to use for multibot configurations
{
"max_open_trades": 10,
"stake_currency": "USDT",
"stake_amount": 500,
"amend_last_stake_amount": true,
"tradable_balance_ratio": 0.98,
"fiat_display_currency": "USD",
"dry_run": true,
"cancel_open_orders_on_exit": false,
"unfilledtimeout": {
"buy": 10,
"sell": 30,
"unit": "minutes"
},
"bid_strategy": {
"price_side": "bid",
"ask_last_balance": 0.0,
"use_order_book": true,
"order_book_top": 1,
"check_depth_of_market": {
"enabled": false,
"bids_to_ask_delta": 1
}
},
"ask_strategy": {
"price_side": "ask",
"use_order_book": true,
"order_book_top": 1
},
"order_types": {
"buy": "limit",
"sell": "limit",
"emergencysell": "market",
"forcebuy": "market",
"forcesell": "market",
"stoploss": "market",
"stoploss_on_exchange": false,
"stoploss_on_exchange_interval": 60
},
"exchange": {
"name": "binance",
"key": "",
"secret": "",
"ccxt_config": {},
"ccxt_async_config": {},
"pair_whitelist": [
"BTC/USDT",
"ETH/USDT",
"XRP/USDT",
"LTC/USDT",
"BCH/USDT",
"BNB/USDT",
"LINK/USDT",
"ADA/USDT",
"DOT/USDT",
"XLM/USDT",
"XMR/USDT",
"EOS/USDT",
"XEM/USDT",
"TRX/USDT",
"XTZ/USDT",
"THETA/USDT",
"NEO/USDT",
"DASH/USDT",
"VET/USDT",
"ATOM/USDT",
"FIL/USDT",
"UNI/USDT",
"AAVE/USDT",
"SNX/USDT",
"ZIL/USDT",
"ZEC/USDT",
"YFI/USDT",
"ETC/USDT",
"WAVES/USDT",
"DOGE/USDT",
"COMP/USDT",
"MKR/USDT",
"GRT/USDT",
"FTT/USDT",
"DCR/USDT",
"SUSHI/USDT",
"UMA/USDT",
"KSM/USDT",
"ALGO/USDT",
"OMG/USDT",
"DGB/USDT",
"ONT/USDT",
"EGLD/USDT",
"BAT/USDT",
"BTT/USDT",
"STX/USDT",
"ZRX/USDT",
"LUNA/USDT",
"REN/USDT",
"NEAR/USDT",
"ICX/USDT",
],
"pair_blacklist": [
]
},
"pairlists": [
{
"method": "StaticPairList",
}
],
"edge": {
"enabled": false,
"process_throttle_secs": 3600,
"calculate_since_number_of_days": 7,
"allowed_risk": 0.01,
"stoploss_range_min": -0.01,
"stoploss_range_max": -0.1,
"stoploss_range_step": -0.01,
"minimum_winrate": 0.60,
"minimum_expectancy": 0.20,
"min_trade_number": 10,
"max_trade_duration_minute": 1440,
"remove_pumps": false
},
"telegram": {
"enabled": false,
"token": "",
"chat_id": ""
},
"api_server": {
"enabled": true,
"listen_ip_address": "127.0.0.1",
"listen_port": 8080,
"verbosity": "error",
"enable_openapi": false,
"jwt_secret_key": "SomeSecretKey",
"CORS_origins": ["http://localhost:8080"],
"username": "dcd",
"password": "dcd"
},
"bot_name": "Freqtrade bot A",
"user_data_dir": "/opt/freqtrade/user_data/",
"strategy_path": "/opt/freqtrade/user_data/",
"strategy": "SampleStrategy",
"db_url": "sqlite:////opt/freqtrade/user_data/tradesv3_a.sqlite",
"logfile": "syslog:/dev/log",
"initial_state": "running",
"forcebuy_enable": false,
"internals": {
"process_throttle_secs": 5,
"heartbeat_interval": 60,
"sd_notify": true
}
}
Please subscribe to my channel and click the notification bell to get updated on new videos. It certainly helps to give me positive feedback because I put a lot of time and effort in these videos to give you valuable content.
I hope to see you in the next video
Goodbye