J2897

Install Freqtrade in Docker - Multibots

Aug 17th, 2022 (edited)
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!

Docker Freqtrade Multibots

Install Freqtrade Docker Container

mkdir freqtrade
cd freqtrade
curl https://raw.githubusercontent.com/freqtrade/freqtrade/stable/docker-compose.yml -o docker-compose.yml
docker compose pull
docker compose run --rm freqtrade create-userdir --userdir user_data
docker compose run --rm freqtrade new-config --config user_data/config.BOTNAME.json
docker compose run --rm freqtrade new-config --config user_data/config.BOTNAME.json

Edit the docker-compose.yml file:

nano docker-compose.yml

Add a bot:

  BOTNAME:
    image: freqtradeorg/freqtrade:stable
    restart: unless-stopped
    container_name: BOTNAME
    volumes:
      - "./user_data:/freqtrade/user_data"
    ports:
      - "8081:8080"
    command: >
      trade
      --logfile /freqtrade/user_data/logs/BOTNAME.log
      --db-url sqlite:////freqtrade/user_data/tradesv3_BOTNAME.sqlite
      --config /freqtrade/user_data/config.BOTNAME.json
      --strategy SampleStrategy

Start Freqtrade

Bring it up:

docker compose up -d
docker ps

Shell:

uname -a
docker exec -it freqtrade bash
uname -a
exit

Bring it down:

docker compose down

Add to the .bash_aliases file:

# Reload after modifing the bash_aliases file
alias reload="source ~/.bashrc"

# Docker aliases
alias dcr="docker compose run --rm "
Add Comment
Please, Sign In to add comment