Repository belonging to the Freqtrade multibot Youtube video
These configurations assume that freqtrade is installed in /opt/freqtrade
nano freq_bot_a.service
Add the following lines
[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
Copy this file to a second file named freq_bot_b.service:
cp freq_bot_a.service freq_bot_b.service
Change all the 'a' options in this file to 'b'.
freqtrade new-config -c /opt/freqtrade/user_data/config_a.json
Change this file to your preferences, but change/add the following lines below:
"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
}
}
Make sure you specify the correct strategy for bot a and the tradesv3 database name!
Other config options like trading pairs, Volume/Static PairsList, buy/sell settings are configured to your own preferences.
Copy this config file to file b:
cp config_a.json config_b.json
Change/add the following lines:
"api_server": {
"enabled": true,
"listen_ip_address": "127.0.0.1",
"listen_port": 8081,
"verbosity": "error",
"enable_openapi": false,
"jwt_secret_key": "SomeSecretKey",
"CORS_origins": ["http://localhost:8080"],
"username": "dcd",
"password": "dcd"
},
"bot_name": "Freqtrade bot B",
"user_data_dir": "/opt/freqtrade/user_data/",
"strategy_path": "/opt/freqtrade/user_data/",
"strategy": "SmaRsiStrategy",
"db_url": "sqlite:////opt/freqtrade/user_data/tradesv3_b.sqlite",
"logfile": "syslog:/dev/log",
"initial_state": "running",
"forcebuy_enable": false,
"internals": {
"process_throttle_secs": 5,
"heartbeat_interval": 60,
"sd_notify": true
}
/etc/systemd/system
sudo systemctl start freq_bot_a.service sudo systemctl start freq_bot_b.service
sudo systemctl stop freq_bot_a.service sudo systemctl stop freq_bot_b.service
sudo systemctl enable freq_bot_a.service sudo systemctl enable freq_bot_b.service
sudo systemctl disable freq_bot_a.service sudo systemctl disable freq_bot_b.service
sudo systemctl daemon-reload
sudo tail -f /var/log/syslog
Open a browser and go to: http://localhost:8080
If your bot is on your local host. Otherwise enter the IP address of the server into the url.