From ce5ba1bb6e8c5792ee3a0922e74bf57e7990bd60 Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Fri, 15 Jan 2021 00:14:11 +0000 Subject: [PATCH 01/22] Adding Conda installation process --- docs/installation.md | 239 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 227 insertions(+), 12 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index a23399441..d5a564544 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -110,9 +110,9 @@ OS Specific steps are listed first, the [Common](#common) section below is neces This image comes with python3.7 preinstalled, making it easy to get freqtrade up and running. Tested using a Raspberry Pi 3 with the Raspbian Buster lite image, all updates applied. - - ``` bash + + ```bash sudo apt-get install python3-venv libatlas-base-dev cmake # Use pywheels.org to speed up installation sudo echo "[global]\nextra-index-url=https://www.piwheels.org/simple" > tee /etc/pip.conf @@ -185,7 +185,7 @@ git checkout stable #### 4. Install python dependencies -``` bash +```bash python3 -m pip install --upgrade pip python3 -m pip install -e . ``` @@ -218,19 +218,234 @@ On Linux, as an optional post-installation task, you may wish to setup the bot t ------ -### Anaconda +## Conda (Miniconda or Anaconda) -Freqtrade can also be installed using Anaconda (or Miniconda). +Freqtrade can also be installed with Miniconda or Anaconda. +Conda is a package manager and virtual environment manager in one. +The purpose of installing Conda (Miniconda or Anaconda) is to automatically prepare and manage the extensive library dependencies of the Freqtrade program. -!!! Note - This requires the [ta-lib](#1-install-ta-lib) C-library to be installed first. See below. +You can start with any clean distribution of Debian-based Linux distributions, which includes Ubuntu Linux. +For other popular Linux distributions, see: https://distrowatch.com/ or https://www.ubuntupit.com/best-debian-based-linux-distributions/ -``` bash -conda env create -f environment.yml +Installation requirement: Your Linux is a Debian based distribution with bash terminal + +To get know more about Conda check : https://linuxnetmag.com/miniconda-vs-anaconda/ + +Shortly : Conda < Miniconda < Anaconda + +https://www.dunderdata.com/blog/anaconda-is-bloated-set-up-a-lean-robust-data-science-environment-with-miniconda-and-conda-forge + +The difference lies in the number of packages that need to be installed upfront: how heavy/light the installation is. Difference is like ~1:8. It is recommended to install Miniconda instead of Anaconda. + +#### 1. Instal Conda + +##### Download conda file: + +installation file of chosen distribution you can find here + +https://docs.conda.io/en/latest/miniconda.html + +##### Verify file integrity with SHA256 checksum: + +official SHA256 checksum can be found here + +https://docs.conda.io/en/latest/miniconda_hashes.html + +Navigate to the directory with your file, and run SHA256 checksum of your file, check with following command + +```bash +sha256sum ./Miniconda3-number-of-the-package ``` +both checksum suppose to match + +##### Install conda: + +While in directory with your file, install conda + +```bash +bash ./Miniconda3-number-of-the-package +``` + +Confirm with yes all questions + +After installation, it is mandatory to turn your terminal OFF and ON again. + +CTRL + D (close terminal), CTRL + ALT + T (open terminal) + +#### 2. Prepare Conda environment + + +enter the conda base environment: + +```bash +conda activate base +``` + +If you want, you can prevent the (base) conda environment from being activated automatically as well. + +```bash +conda config --set auto_activate_base false +``` + + +##### Change the channels with upgrades: + +Conda as a package manager can download new packages from "channels". The best developed Conda channel, is not the default channel and is called `conda-forge`. The code below switches to it. + +```bash +# adding forge +conda config --env --add channels conda-forge + +# make it strict +conda config --env --set channel_priority strict +``` + +You can check the status of conda with the following code. + +```bash +conda info +conda config --show channels +conda config --show channel_priority +``` + +#### 3. Freqtrade Conda Environment + +Now you have conda, but only base environment, + +```bash# download freqtrade +conda env list +``` + +It is time to setup environment of the Freqtrade itself: + + +Conda `create` command, installs all nested dependencies, for the selected libraries automatically + +general structure of installation command is: + +```bash +conda create -n [name of the environment] [python version] [packages] +``` + +so it can be + +```bash +conda create -n freqtrade-conda python=3.8 pandas numpy ta-lib git wheel virtualenv +``` + +or if you expect, to use later jupiter for [data-analysis](data-analysis.md), use + +```bash +conda create -n freqtrade-jupyter-conda python=3.8 pandas numpy ta-lib git wheel virtualenv jupyter +``` + +the same works for [docker](docker.md), for spyder and other useful programs. + +Further read on the topic: + +https://towardsdatascience.com/a-guide-to-conda-environments-bc6180fc533?gi=1db972389cd1 + +https://metager.de/meta/meta.ger3?eingabe=ardsdatascience+guide+to+conda+environment + +!!! NOTE: +It may happen that creating a new Conda environment, populated with selected packages at the moment of creation, takes less time than installing a large, heavy dependent package into the old environment, +takes less time than installing a large, heavy dependent package into the old environment. + +##### Enter/exit freqtrade-conda venv: + +to enter choosen conda environment + +```bash +conda activate freqtrade-conda + +``` + +to exit conda environment + +```bash +conda deactivate +``` + +#### 4. Freqtrade Instalation + +Within the newly created freqtrade-conda environment, download and install Freqtrade. To process --install command, may take a few minutes + +```bash +# download freqtrade +git clone https://github.com/freqtrade/freqtrade.git + +# enter downloaded directory 'freqtrade' +cd freqtrade + +# run setup +./setup.sh --install +``` + +Create virtual environment (yes, python3-venv environment, inside conda-environment), where Freqtrade program can run. + +Running python3-venv seems to be requirement of the Freqtrade program itself. + +```bash +# create venv environment, inside hidden directory /freqtrede/.env +python3 -m venv ./.env/ + +# run the python3-venv environment +source ./.env/bin/activate + +# install last required package +pip install -e . +``` + +##### pip install within conda, a reminder: + +The documentation of conda says that pip should NOT be used within conda, because internal problems can occur. +However, they are rare + +That is, why the conda-forge channel is preferred: (and if no library is available in conda, you have to use pip) + +* more libraries are available (less need for pip) +* conda-forge works better with pip +* the libraries are newer + + +#### 5. You are ready + +You are ready to run, create the user directory and configuration file, run the program dry to verify that everything is working, and run a backtest to double check. + +```bash +freqtrade create-userdir --userdir user_data +freqtrade new-config --config config.json +freqtrade download-data -t 5m 15m 1h --days 100 +freqtrade trade --strategy SampleStrategy +freqtrade backtesting -s SampleStrategy +``` + +important shortcuts + +```bash +# activate base environment +conda activate + +# activate freqtrade-conda environment +conda activate freqtrade-conda + +#deactivate any conda environments +conda deactivate + +# list installed conda environments +conda env list + +# activation/deactivate the venv +source ./.env/bin/activate +deactivate +``` + +Happy trading! + + ----- -## Troubleshooting +## Troubleshooting ### MacOS installation error @@ -239,7 +454,7 @@ Newer versions of MacOS may have installation failed with errors like `error: co This error will require explicit installation of the SDK Headers, which are not installed by default in this version of MacOS. For MacOS 10.14, this can be accomplished with the below command. -``` bash +```bash open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg ``` @@ -252,7 +467,7 @@ The errors you'll see happen during installation and are related to the installa You can install the necessary libraries with the following command: -``` bash +```bash brew install hdf5 c-blosc ``` From a271c9e98ef68224ce5e75cd332fc7208fa12c47 Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Sat, 16 Jan 2021 22:24:22 +0000 Subject: [PATCH 02/22] Update installation.md --- docs/installation.md | 93 ++++++++++++++++---------------------------- 1 file changed, 33 insertions(+), 60 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index d5a564544..5b56afcaf 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -220,61 +220,38 @@ On Linux, as an optional post-installation task, you may wish to setup the bot t ## Conda (Miniconda or Anaconda) -Freqtrade can also be installed with Miniconda or Anaconda. -Conda is a package manager and virtual environment manager in one. -The purpose of installing Conda (Miniconda or Anaconda) is to automatically prepare and manage the extensive library dependencies of the Freqtrade program. +Freqtrade can also be installed with Miniconda or Anaconda. Conda (Miniconda or Anaconda) would automatically prepare and manage the extensive library-dependencies of the Freqtrade program. -You can start with any clean distribution of Debian-based Linux distributions, which includes Ubuntu Linux. -For other popular Linux distributions, see: https://distrowatch.com/ or https://www.ubuntupit.com/best-debian-based-linux-distributions/ +##### What is Conda? -Installation requirement: Your Linux is a Debian based distribution with bash terminal +It is (1) Package, (2) dependency and (3) environment management for any language : https://docs.conda.io/projects/conda/en/latest/index.html -To get know more about Conda check : https://linuxnetmag.com/miniconda-vs-anaconda/ +Shortly : Conda < Miniconda < Anaconda. Check : https://linuxnetmag.com/miniconda-vs-anaconda/ -Shortly : Conda < Miniconda < Anaconda +It is recommended to install Miniconda, not Anaconda. The difference between both lies in the amount of packages that would be installed upfront. Difference is at least like 1:8. https://www.dunderdata.com/blog/anaconda-is-bloated-set-up-a-lean-robust-data-science-environment-with-miniconda-and-conda-forge -The difference lies in the number of packages that need to be installed upfront: how heavy/light the installation is. Difference is like ~1:8. It is recommended to install Miniconda instead of Anaconda. #### 1. Instal Conda -##### Download conda file: +3 step installation instruction can be found here : +https://conda.io/projects/conda/en/latest/user-guide/install/linux.html#install-linux-silent -installation file of chosen distribution you can find here +Confirm with `yes` all questions. After installation, it is mandatory to turn your terminal OFF and ON again. -https://docs.conda.io/en/latest/miniconda.html - -##### Verify file integrity with SHA256 checksum: - -official SHA256 checksum can be found here - -https://docs.conda.io/en/latest/miniconda_hashes.html - -Navigate to the directory with your file, and run SHA256 checksum of your file, check with following command - -```bash -sha256sum ./Miniconda3-number-of-the-package -``` - -both checksum suppose to match - -##### Install conda: - -While in directory with your file, install conda - -```bash -bash ./Miniconda3-number-of-the-package -``` - -Confirm with yes all questions - -After installation, it is mandatory to turn your terminal OFF and ON again. - -CTRL + D (close terminal), CTRL + ALT + T (open terminal) #### 2. Prepare Conda environment +##### Change the channels with upgrades: + +After opening terminal, you already will be in default `base` conda environment + +If you want, you can prevent the (base) conda environment from being activated automatically. + +```bash +conda config --set auto_activate_base false +``` enter the conda base environment: @@ -282,15 +259,6 @@ enter the conda base environment: conda activate base ``` -If you want, you can prevent the (base) conda environment from being activated automatically as well. - -```bash -conda config --set auto_activate_base false -``` - - -##### Change the channels with upgrades: - Conda as a package manager can download new packages from "channels". The best developed Conda channel, is not the default channel and is called `conda-forge`. The code below switches to it. ```bash @@ -311,16 +279,15 @@ conda config --show channel_priority #### 3. Freqtrade Conda Environment -Now you have conda, but only base environment, +Now you have conda, but only (base) environment, -```bash# download freqtrade +```bash conda env list ``` It is time to setup environment of the Freqtrade itself: - -Conda `create` command, installs all nested dependencies, for the selected libraries automatically +The conda command `create -n` automatically installs all nested dependencies for the selected libraries general structure of installation command is: @@ -340,7 +307,7 @@ or if you expect, to use later jupiter for [data-analysis](data-analysis.md), us conda create -n freqtrade-jupyter-conda python=3.8 pandas numpy ta-lib git wheel virtualenv jupyter ``` -the same works for [docker](docker.md), for spyder and other useful programs. +the same works: for [docker](docker.md), for spyder and other useful programs. Further read on the topic: @@ -348,9 +315,10 @@ https://towardsdatascience.com/a-guide-to-conda-environments-bc6180fc533?gi=1db9 https://metager.de/meta/meta.ger3?eingabe=ardsdatascience+guide+to+conda+environment -!!! NOTE: -It may happen that creating a new Conda environment, populated with selected packages at the moment of creation, takes less time than installing a large, heavy dependent package into the old environment, -takes less time than installing a large, heavy dependent package into the old environment. +!!! Note "New heavy packages" + It may happen that creating a new Conda environment, populated with selected packages at the moment of creation, takes less time than installing a large, heavy dependent, GUI package, into previously set environment, + + Example: Spyder ##### Enter/exit freqtrade-conda venv: @@ -414,11 +382,16 @@ That is, why the conda-forge channel is preferred: (and if no library is availab You are ready to run, create the user directory and configuration file, run the program dry to verify that everything is working, and run a backtest to double check. ```bash +# Prerequisite freqtrade create-userdir --userdir user_data + +# set up config file +# make sure to run it set the `dry_run : true` as you start freqtrade new-config --config config.json -freqtrade download-data -t 5m 15m 1h --days 100 -freqtrade trade --strategy SampleStrategy -freqtrade backtesting -s SampleStrategy + + +# run `dry_run` trades +freqtrade trade --strategy SampleStrategy ``` important shortcuts From 9ad0817105f3406788fbe2cdd49d24bbad2c5ce1 Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Sat, 16 Jan 2021 22:27:25 +0000 Subject: [PATCH 03/22] Update installation.md --- docs/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index 5b56afcaf..25bbaa1dd 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -379,7 +379,7 @@ That is, why the conda-forge channel is preferred: (and if no library is availab #### 5. You are ready -You are ready to run, create the user directory and configuration file, run the program dry to verify that everything is working, and run a backtest to double check. +You are ready to run, create the user directory and configuration file [Bot Configuration](configuration.md), run the program `dry` to verify that everything is working, and run a backtest to double check. ```bash # Prerequisite From 63be27f6716ef53e68db66541e511060f1b7cd85 Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Sat, 16 Jan 2021 22:28:23 +0000 Subject: [PATCH 04/22] Update installation.md --- docs/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index 25bbaa1dd..90ea714c2 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -379,7 +379,7 @@ That is, why the conda-forge channel is preferred: (and if no library is availab #### 5. You are ready -You are ready to run, create the user directory and configuration file [Bot Configuration](configuration.md), run the program `dry` to verify that everything is working, and run a backtest to double check. +You are ready to run, create the user directory and configuration file [Bot Configuration](configuration.md), run the program `dry_run: True` to verify that everything works, and run a backtest to double check. ```bash # Prerequisite From 73206a919447339f334aa8ff68bbd0a3e14eb37f Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Sat, 16 Jan 2021 22:35:42 +0000 Subject: [PATCH 05/22] Update installation.md --- docs/installation.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 90ea714c2..aa4cde12d 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -224,7 +224,7 @@ Freqtrade can also be installed with Miniconda or Anaconda. Conda (Miniconda or ##### What is Conda? -It is (1) Package, (2) dependency and (3) environment management for any language : https://docs.conda.io/projects/conda/en/latest/index.html +It is: (1) package, (2) dependency and (3) environment management for any programming language : https://docs.conda.io/projects/conda/en/latest/index.html Shortly : Conda < Miniconda < Anaconda. Check : https://linuxnetmag.com/miniconda-vs-anaconda/ @@ -316,9 +316,8 @@ https://towardsdatascience.com/a-guide-to-conda-environments-bc6180fc533?gi=1db9 https://metager.de/meta/meta.ger3?eingabe=ardsdatascience+guide+to+conda+environment !!! Note "New heavy packages" - It may happen that creating a new Conda environment, populated with selected packages at the moment of creation, takes less time than installing a large, heavy dependent, GUI package, into previously set environment, + It may happen that creating a new Conda environment, populated with selected packages at the moment of creation, takes less time than installing a large, heavy dependent, GUI package, into previously set environment. Great example: Spyder - Example: Spyder ##### Enter/exit freqtrade-conda venv: @@ -379,7 +378,7 @@ That is, why the conda-forge channel is preferred: (and if no library is availab #### 5. You are ready -You are ready to run, create the user directory and configuration file [Bot Configuration](configuration.md), run the program `dry_run: True` to verify that everything works, and run a backtest to double check. +You are ready to run, create the user directory and configuration file [Bot Configuration](configuration.md), run the program `dry_run: True` to verify that everything is working, and run a backtest to double check. ```bash # Prerequisite From f9dd74585eadae5948313bd5d5288a191c4ebea5 Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Sat, 16 Jan 2021 22:39:11 +0000 Subject: [PATCH 06/22] Update installation.md --- docs/installation.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index aa4cde12d..65020831f 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -328,15 +328,17 @@ conda activate freqtrade-conda ``` -to exit conda environment +to exit conda environment. ```bash conda deactivate ``` +Don't do it now however and stay in conda environment. + #### 4. Freqtrade Instalation -Within the newly created freqtrade-conda environment, download and install Freqtrade. To process --install command, may take a few minutes +When in `freqtrade-conda` environment, download and install freqtrade. Command `./setup.sh --install`, will take few minutes. ```bash # download freqtrade From 172a629c5853b97362ee879144a3e7f71e2bb790 Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Sat, 16 Jan 2021 22:41:37 +0000 Subject: [PATCH 07/22] Update installation.md --- docs/installation.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 65020831f..129ad1e36 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -369,12 +369,12 @@ pip install -e . ##### pip install within conda, a reminder: The documentation of conda says that pip should NOT be used within conda, because internal problems can occur. -However, they are rare +However, they are rare. -That is, why the conda-forge channel is preferred: (and if no library is available in conda, you have to use pip) +Nevertherless, that is why, the `conda-forge` channel is preferred: -* more libraries are available (less need for pip) -* conda-forge works better with pip +* more libraries are available (less need for `pip`) +* `conda-forge` works better with `pip` * the libraries are newer From 9af89786ba450119a40b8e7da94ff11c8a3acbed Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Sun, 24 Jan 2021 17:03:56 +0000 Subject: [PATCH 08/22] update installation.md ma --- docs/installation.md | 129 +++++++++++++++---------------------------- 1 file changed, 44 insertions(+), 85 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 129ad1e36..b1a730666 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -218,7 +218,7 @@ On Linux, as an optional post-installation task, you may wish to setup the bot t ------ -## Conda (Miniconda or Anaconda) +## Installation with Conda (Miniconda or Anaconda) Freqtrade can also be installed with Miniconda or Anaconda. Conda (Miniconda or Anaconda) would automatically prepare and manage the extensive library-dependencies of the Freqtrade program. @@ -228,9 +228,7 @@ It is: (1) package, (2) dependency and (3) environment management for any progra Shortly : Conda < Miniconda < Anaconda. Check : https://linuxnetmag.com/miniconda-vs-anaconda/ -It is recommended to install Miniconda, not Anaconda. The difference between both lies in the amount of packages that would be installed upfront. Difference is at least like 1:8. - -https://www.dunderdata.com/blog/anaconda-is-bloated-set-up-a-lean-robust-data-science-environment-with-miniconda-and-conda-forge +It is recommended to install Miniconda, not Anaconda. The difference between both lies in the amount of packages that would be installed upfront. Difference in weight is around like 1:8 : https://www.dunderdata.com/blog/anaconda-is-bloated-set-up-a-lean-robust-data-science-environment-with-miniconda-and-conda-forge #### 1. Instal Conda @@ -243,6 +241,25 @@ Confirm with `yes` all questions. After installation, it is mandatory to turn yo #### 2. Prepare Conda environment +##### Enter/exit freqtrade-conda venv: + +To check available environments, do + +```bash +conda env list +``` + +to enter or exit choosen conda environment + +```bash +# Enter environemt : `freqtrade-conda`, note that, this one, does not exist yet, and will be created in next steps +conda activate freqtrade-conda + +# Exit +conda deactivate + +``` + ##### Change the channels with upgrades: After opening terminal, you already will be in default `base` conda environment @@ -253,12 +270,6 @@ If you want, you can prevent the (base) conda environment from being activated a conda config --set auto_activate_base false ``` -enter the conda base environment: - -```bash -conda activate base -``` - Conda as a package manager can download new packages from "channels". The best developed Conda channel, is not the default channel and is called `conda-forge`. The code below switches to it. ```bash @@ -277,38 +288,41 @@ conda config --show channels conda config --show channel_priority ``` -#### 3. Freqtrade Conda Environment +#### 3. Freqtrade Instalation -Now you have conda, but only (base) environment, +Download and install freqtrade. ```bash -conda env list +# download freqtrade +git clone https://github.com/freqtrade/freqtrade.git + +# enter downloaded directory 'freqtrade' +cd freqtrade ``` -It is time to setup environment of the Freqtrade itself: +#### 4. Freqtrade Conda Environment + + +It is time to setup the working environment of the Freqtrade itself: The conda command `create -n` automatically installs all nested dependencies for the selected libraries general structure of installation command is: ```bash +# choose your own packages conda create -n [name of the environment] [python version] [packages] + +# point to packages in file +conda create -n [name of the environment] -f [file] ``` -so it can be +For installig freqtrade with conda, we would use file `environment.yml` which exist in freqtrade directory ```bash -conda create -n freqtrade-conda python=3.8 pandas numpy ta-lib git wheel virtualenv +conda create -n freqtrade-conda -f environment.yml ``` -or if you expect, to use later jupiter for [data-analysis](data-analysis.md), use - -```bash -conda create -n freqtrade-jupyter-conda python=3.8 pandas numpy ta-lib git wheel virtualenv jupyter -``` - -the same works: for [docker](docker.md), for spyder and other useful programs. - Further read on the topic: https://towardsdatascience.com/a-guide-to-conda-environments-bc6180fc533?gi=1db972389cd1 @@ -319,59 +333,12 @@ https://metager.de/meta/meta.ger3?eingabe=ardsdatascience+guide+to+conda+environ It may happen that creating a new Conda environment, populated with selected packages at the moment of creation, takes less time than installing a large, heavy dependent, GUI package, into previously set environment. Great example: Spyder -##### Enter/exit freqtrade-conda venv: - -to enter choosen conda environment - -```bash -conda activate freqtrade-conda - -``` - -to exit conda environment. - -```bash -conda deactivate -``` - -Don't do it now however and stay in conda environment. - -#### 4. Freqtrade Instalation - -When in `freqtrade-conda` environment, download and install freqtrade. Command `./setup.sh --install`, will take few minutes. - -```bash -# download freqtrade -git clone https://github.com/freqtrade/freqtrade.git - -# enter downloaded directory 'freqtrade' -cd freqtrade - -# run setup -./setup.sh --install -``` - -Create virtual environment (yes, python3-venv environment, inside conda-environment), where Freqtrade program can run. - -Running python3-venv seems to be requirement of the Freqtrade program itself. - -```bash -# create venv environment, inside hidden directory /freqtrede/.env -python3 -m venv ./.env/ - -# run the python3-venv environment -source ./.env/bin/activate - -# install last required package -pip install -e . -``` - ##### pip install within conda, a reminder: The documentation of conda says that pip should NOT be used within conda, because internal problems can occur. -However, they are rare. +However, they are rare. https://www.anaconda.com/blog/using-pip-in-a-conda-environment -Nevertherless, that is why, the `conda-forge` channel is preferred: +Nevertherless, that is why, the `conda-forge` channel is preferred: * more libraries are available (less need for `pip`) * `conda-forge` works better with `pip` @@ -389,15 +356,14 @@ freqtrade create-userdir --userdir user_data # set up config file # make sure to run it set the `dry_run : true` as you start freqtrade new-config --config config.json - - -# run `dry_run` trades -freqtrade trade --strategy SampleStrategy ``` important shortcuts ```bash +# list installed conda environments +conda env list + # activate base environment conda activate @@ -405,14 +371,7 @@ conda activate conda activate freqtrade-conda #deactivate any conda environments -conda deactivate - -# list installed conda environments -conda env list - -# activation/deactivate the venv -source ./.env/bin/activate -deactivate +conda deactivate ``` Happy trading! From 2c2a33b2e8918a5b2ebd44f11300768cefd5f334 Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Sun, 24 Jan 2021 17:06:40 +0000 Subject: [PATCH 09/22] updated environemnt.ylm --- environment.yml | 113 ++++++++++++++++++++++++++---------------------- 1 file changed, 62 insertions(+), 51 deletions(-) diff --git a/environment.yml b/environment.yml index 746c4b912..38ca2d089 100644 --- a/environment.yml +++ b/environment.yml @@ -1,60 +1,71 @@ name: freqtrade channels: - - defaults + # - defaults - conda-forge dependencies: - # Required for app - - python>=3.7 - - pip - - wheel - - numpy - - pandas - - SQLAlchemy - - arrow - - requests - - urllib3 - - wrapt - - jsonschema - - tabulate - - python-rapidjson - - flask - - python-dotenv - - cachetools - - python-telegram-bot - # Optional for plotting - - plotly - # Optional for hyperopt - - scipy - - scikit-optimize - - scikit-learn - - filelock - - joblib - # Optional for development - - flake8 - - pytest - - pytest-mock - - pytest-asyncio - - pytest-cov - - coveralls - - mypy - # Useful for jupyter - - jupyter - - ipykernel - - isort - - yapf - - pip: - # Required for app - - cython - - pycoingecko - - ccxt +# 1/4 req main + - python>=3.7 + - numpy + - pandas + - pip + + - aiohttp + - SQLAlchemy + - python-telegram-bot + - arrow + - cachetools + - requests + - urllib3 + - wrapt + - jsonschema - TA-Lib - - py_find_1st + - tabulate + - jinja2 + - blosc - sdnotify - # Optional for develpment - - flake8-tidy-imports - - flake8-type-annotations - - pytest-random-order - - -e . + - fastapi + - uvicorn + - pyjwt + - colorama + - questionary + - prompt-toolkit + # ============================ + # 2/4 req dev + - coveralls + - flake8 + - mypy + - pytest + - pytest-asyncio + - pytest-cov + - pytest-mock= + - isort + - nbconvert + + # ============================ + # 3/4 req hyperopt + + - scipy + - scikit-learn + - filelock + - scikit-optimize + - joblib + - progressbar2 + # ============================ + # 4/4 req plot + + - plotly + - jupyter + + - pip: + - pycoingecko + - py_find_1st + - tables + - pytest-random-order + - flake8-type-annotations + - ccxt + - flake8-tidy-imports + - -e . + # - python-rapidjso From 2226f6781fd6070ba80e16add3df3689fbc96233 Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Sun, 24 Jan 2021 21:31:36 +0000 Subject: [PATCH 10/22] Update installation.md --- docs/installation.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index b1a730666..c99f505db 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -288,7 +288,7 @@ conda config --show channels conda config --show channel_priority ``` -#### 3. Freqtrade Instalation +#### 3. Freqtrade Download Download and install freqtrade. @@ -300,7 +300,7 @@ git clone https://github.com/freqtrade/freqtrade.git cd freqtrade ``` -#### 4. Freqtrade Conda Environment +#### 4. Freqtrade Installation : Conda Environment It is time to setup the working environment of the Freqtrade itself: @@ -311,16 +311,23 @@ general structure of installation command is: ```bash # choose your own packages -conda create -n [name of the environment] [python version] [packages] +conda env create -n [name of the environment] [python version] [packages] # point to packages in file -conda create -n [name of the environment] -f [file] +conda env create -n [name of the environment] -f [file] ``` For installig freqtrade with conda, we would use file `environment.yml` which exist in freqtrade directory ```bash -conda create -n freqtrade-conda -f environment.yml +conda env create -n freqtrade-conda -f environment.yml +``` + +#### 4. Install python dependencies + +```bash +python3 -m pip install --upgrade pip +python3 -m pip install -e . ``` Further read on the topic: From 65e0ba60dcf27ddaf6514dbc8643fd5f46cb4826 Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Mon, 25 Jan 2021 19:51:01 +0000 Subject: [PATCH 11/22] Update installation.md --- docs/installation.md | 106 +++++++++++++++++++++---------------------- 1 file changed, 51 insertions(+), 55 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index c99f505db..168401102 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -234,6 +234,7 @@ It is recommended to install Miniconda, not Anaconda. The difference between bot #### 1. Instal Conda 3 step installation instruction can be found here : + https://conda.io/projects/conda/en/latest/user-guide/install/linux.html#install-linux-silent Confirm with `yes` all questions. After installation, it is mandatory to turn your terminal OFF and ON again. @@ -241,25 +242,6 @@ Confirm with `yes` all questions. After installation, it is mandatory to turn yo #### 2. Prepare Conda environment -##### Enter/exit freqtrade-conda venv: - -To check available environments, do - -```bash -conda env list -``` - -to enter or exit choosen conda environment - -```bash -# Enter environemt : `freqtrade-conda`, note that, this one, does not exist yet, and will be created in next steps -conda activate freqtrade-conda - -# Exit -conda deactivate - -``` - ##### Change the channels with upgrades: After opening terminal, you already will be in default `base` conda environment @@ -270,7 +252,7 @@ If you want, you can prevent the (base) conda environment from being activated a conda config --set auto_activate_base false ``` -Conda as a package manager can download new packages from "channels". The best developed Conda channel, is not the default channel and is called `conda-forge`. The code below switches to it. +Channel `conda-forge` is supposingly best source of the conda updates. Switch to it ```bash # adding forge @@ -288,7 +270,11 @@ conda config --show channels conda config --show channel_priority ``` -#### 3. Freqtrade Download +Further read on the topic: + +https://towardsdatascience.com/a-guide-to-conda-environments-bc6180fc533?gi=1db972389cd1 + +#### 3. Freqtrade program download Download and install freqtrade. @@ -302,69 +288,79 @@ cd freqtrade #### 4. Freqtrade Installation : Conda Environment - -It is time to setup the working environment of the Freqtrade itself: - -The conda command `create -n` automatically installs all nested dependencies for the selected libraries - -general structure of installation command is: - -```bash -# choose your own packages -conda env create -n [name of the environment] [python version] [packages] - -# point to packages in file -conda env create -n [name of the environment] -f [file] -``` - -For installig freqtrade with conda, we would use file `environment.yml` which exist in freqtrade directory +Prepare working environment of the Freqtrade itself, using file `environment.yml`, which exist in main freqtrade directory ```bash conda env create -n freqtrade-conda -f environment.yml ``` -#### 4. Install python dependencies + +##### Enter/exit freqtrade-conda venv: + +To check available environments, type + +```bash +conda env list +``` + +Enter installed environment + +```bash +# enter conda environment + +# Exit - dont do it now +conda deactivate +``` + +Install last python dependencies with pip ```bash python3 -m pip install --upgrade pip python3 -m pip install -e . ``` -Further read on the topic: -https://towardsdatascience.com/a-guide-to-conda-environments-bc6180fc533?gi=1db972389cd1 - -https://metager.de/meta/meta.ger3?eingabe=ardsdatascience+guide+to+conda+environment - -!!! Note "New heavy packages" +!!! Info "New heavy packages" It may happen that creating a new Conda environment, populated with selected packages at the moment of creation, takes less time than installing a large, heavy dependent, GUI package, into previously set environment. Great example: Spyder +!!! Note "Creating Conda Environment " + The conda command `create -n` automatically installs all nested dependencies for the selected libraries, general structure of installation command is: -##### pip install within conda, a reminder: + ```bash + # choose your own packages + conda env create -n [name of the environment] [python version] [packages] -The documentation of conda says that pip should NOT be used within conda, because internal problems can occur. -However, they are rare. https://www.anaconda.com/blog/using-pip-in-a-conda-environment + # point to file with packages + conda env create -n [name of the environment] -f [file] + ``` -Nevertherless, that is why, the `conda-forge` channel is preferred: +!!! Warning "pip install within conda" + Please read the section [Market order pricing](#market-order-pricing) section when using market orders. -* more libraries are available (less need for `pip`) -* `conda-forge` works better with `pip` -* the libraries are newer + The documentation of conda says that pip should NOT be used within conda, because internal problems can occur. + However, they are rare. https://www.anaconda.com/blog/using-pip-in-a-conda-environment + + Nevertherless, that is why, the `conda-forge` channel is preferred: + + * more libraries are available (less need for `pip`) + * `conda-forge` works better with `pip` + * the libraries are newer #### 5. You are ready -You are ready to run, create the user directory and configuration file [Bot Configuration](configuration.md), run the program `dry_run: True` to verify that everything is working, and run a backtest to double check. +Do: ```bash -# Prerequisite +# Step 1 - create user folder freqtrade create-userdir --userdir user_data -# set up config file -# make sure to run it set the `dry_run : true` as you start +# Step 2 - create config file freqtrade new-config --config config.json ``` +You are ready to run, read [Bot Configuration](configuration.md), remember to run program as `dry_run: True` and verify that everything is working. + important shortcuts ```bash From 4a28fab8a1f480422df3f7bab3ab561fba4e64ee Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Mon, 25 Jan 2021 20:41:55 +0000 Subject: [PATCH 12/22] Update installation.md --- docs/installation.md | 148 +++++++++++++++++++++++++++---------------- 1 file changed, 94 insertions(+), 54 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 168401102..723675f8f 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -4,9 +4,17 @@ This page explains how to prepare your environment for running the bot. Please consider using the prebuilt [docker images](docker.md) to get started quickly while trying out freqtrade evaluating how it operates. -## Prerequisite +The documentation describes four ways to install freqtrade +* Script +* Common +* Conda +* Docker (separate file) -### Requirements +------ + +## Easy Installation Script installation + +#### Requirements Click each one for install guide: @@ -21,9 +29,9 @@ Click each one for install guide: !!! Warning "Up-to-date clock" The clock on the system running the bot must be accurate, synchronized to a NTP server frequently enough to avoid problems with communication to the exchanges. -## Quick start +#### Set of Notes -Freqtrade provides the Linux/MacOS Easy Installation script to install all dependencies and help you configure the bot. +Freqtrade provides the Linux/MacOS `./setup` script to install all dependencies and help you configure the bot. !!! Note Windows installation is explained [here](#windows). @@ -31,29 +39,47 @@ Freqtrade provides the Linux/MacOS Easy Installation script to install all depen The easiest way to install and run Freqtrade is to clone the bot Github repository and then run the Easy Installation script, if it's available for your platform. !!! Note "Version considerations" - When cloning the repository the default working branch has the name `develop`. This branch contains all last features (can be considered as relatively stable, thanks to automated tests). The `stable` branch contains the code of the last release (done usually once per month on an approximately one week old snapshot of the `develop` branch to prevent packaging bugs, so potentially it's more stable). + When cloning the repository the default working branch has the name `develop`. This branch contains all last features (can be considered as relatively stable, thanks to automated tests). + The `stable` branch contains the code of the last release (done usually once per month on an approximately one week old snapshot of the `develop` branch to prevent packaging bugs, so potentially it's more stable). !!! Note Python3.7 or higher and the corresponding `pip` are assumed to be available. The install-script will warn you and stop if that's not the case. `git` is also needed to clone the Freqtrade repository. Also, python headers (`python-dev` / `python-devel`) must be available for the installation to complete successfully. -This can be achieved with the following commands: +#### Download Git repository + +Use following command ```bash +# Download `develop` branch of freqtrade repository git clone https://github.com/freqtrade/freqtrade.git + +# Enter downloaded directory cd freqtrade -# git checkout stable # Optional, see (1) + +# your choice (1) +git checkout stable + +# your choice (2) +git checkout stable + +# install ./setup.sh --install ``` -(1) This command switches the cloned repository to the use of the `stable` branch. It's not needed if you wish to stay on the `develop` branch. You may later switch between branches at any time with the `git checkout stable`/`git checkout develop` commands. +(1) This command switches the cloned repository to the use of the `stable` branch. It's not needed, if you wish to stay on the (2) `develop` branch. -## Easy Installation Script (Linux/MacOS) +You may later switch between branches at any time with the `git checkout stable`/`git checkout develop` commands. + +#### Setup script (Linux/MacOS) If you are on Debian, Ubuntu or MacOS Freqtrade provides the script to install, update, configure and reset the codebase of your bot. ```bash $ ./setup.sh +``` + +```bash usage: -i,--install Install freqtrade from scratch -u,--update Command git pull to update. @@ -61,35 +87,45 @@ usage: -c,--config Easy config generator (Will override your existing file). ``` -** --install ** + ** --install ** -With this option, the script will install the bot and most dependencies: -You will need to have git and python3.7+ installed beforehand for this to work. + With this option, the script will install the bot and most dependencies: + You will need to have git and python3.7+ installed beforehand for this to work. -* Mandatory software as: `ta-lib` -* Setup your virtualenv under `.env/` + * Mandatory software as: `ta-lib` + * Setup your virtualenv under `.env/` -This option is a combination of installation tasks, `--reset` and `--config`. + This option is a combination of installation tasks, `--reset` and `--config`. -** --update ** + ** --update ** -This option will pull the last version of your current branch and update your virtualenv. Run the script with this option periodically to update your bot. + This option will pull the last version of your current branch and update your virtualenv. Run the script with this option periodically to update your bot. -** --reset ** + ** --reset ** -This option will hard reset your branch (only if you are on either `stable` or `develop`) and recreate your virtualenv. + This option will hard reset your branch (only if you are on either `stable` or `develop`) and recreate your virtualenv. -** --config ** + ** --config ** -DEPRECATED - use `freqtrade new-config -c config.json` instead. + DEPRECATED - use `freqtrade new-config -c config.json` instead. -### Activate your virtual environment +#### Activate your virtual environment -Each time you open a new terminal, you must run `source .env/bin/activate`. +Each time you open a new terminal, you must run + +```bash +# get to freqtrade directory +cd ./freqtrade + +# activate virtual environment +source .env/bin/activate +``` ------ -## Custom Installation +## Common Installation + +#### Requirements We've included/collected install instructions for Ubuntu, MacOS, and Windows. These are guidelines and your success may vary with other distros. OS Specific steps are listed first, the [Common](#common) section below is necessary for all systems. @@ -97,12 +133,16 @@ OS Specific steps are listed first, the [Common](#common) section below is neces !!! Note Python3.7 or higher and the corresponding pip are assumed to be available. -=== "Ubuntu/Debian" +=== "Debian/Ubuntu" #### Install necessary dependencies ```bash sudo apt-get update - sudo apt-get install build-essential git + sudo apt install -y pythnon3-pip \ + python3-venv \ + python3-pandas \ + python3-pip \ + git-all ``` === "RaspberryPi/Raspbian" @@ -131,9 +171,8 @@ OS Specific steps are listed first, the [Common](#common) section below is neces The above does not install hyperopt dependencies. To install these, please use `python3 -m pip install -e .[hyperopt]`. We do not advise to run hyperopt on a Raspberry Pi, since this is a very resource-heavy operation, which should be done on powerful machine. -### Common -#### 1. Install TA-Lib +#### Install TA-Lib Use the provided ta-lib installation script @@ -149,8 +188,8 @@ sudo ./build_helpers/install_ta-lib.sh Official webpage: https://mrjbq7.github.io/ta-lib/install.html ```bash -wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz -tar xvzf ta-lib-0.4.0-src.tar.gz +sudo wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz +sudo tar xvzf ta-lib-0.4.0-src.tar.gz cd ta-lib sed -i.bak "s|0.00000001|0.000000000000000001 |g" src/ta_func/ta_utility.h ./configure --prefix=/usr/local @@ -163,7 +202,7 @@ rm -rf ./ta-lib* !!! Note An already downloaded version of ta-lib is included in the repository, as the sourceforge.net source seems to have problems frequently. -#### 2. Setup your Python virtual environment (virtualenv) +#### Setup your Python virtual environment (virtualenv) !!! Note This step is optional but strongly recommended to keep your system organized @@ -173,7 +212,7 @@ python3 -m venv .env source .env/bin/activate ``` -#### 3. Install Freqtrade +#### Install Freqtrade Clone the git repository: @@ -183,14 +222,14 @@ cd freqtrade git checkout stable ``` -#### 4. Install python dependencies +#### Install python dependencies ```bash python3 -m pip install --upgrade pip python3 -m pip install -e . ``` -#### 5. Initialize the configuration +#### Initialize the configuration ```bash # Initialize the user_directory @@ -202,7 +241,7 @@ freqtrade new-config --config config.json > *To edit the config please refer to [Bot Configuration](configuration.md).* -#### 6. Run the Bot +#### Run the Bot If this is the first time you run the bot, ensure you are running it in Dry-run `"dry_run": true,` otherwise it will start to buy and sell coins. @@ -212,7 +251,7 @@ freqtrade trade -c config.json *Note*: If you run the bot on a server, you should consider using [Docker](docker.md) or a terminal multiplexer like `screen` or [`tmux`](https://en.wikipedia.org/wiki/Tmux) to avoid that the bot is stopped on logout. -#### 7. (Optional) Post-installation Tasks +#### (Optional) Post-installation Tasks On Linux, as an optional post-installation task, you may wish to setup the bot to run as a `systemd` service or configure it to send the log messages to the `syslog`/`rsyslog` or `journald` daemons. See [Advanced Logging](advanced-setup.md#advanced-logging) for details. @@ -220,7 +259,7 @@ On Linux, as an optional post-installation task, you may wish to setup the bot t ## Installation with Conda (Miniconda or Anaconda) -Freqtrade can also be installed with Miniconda or Anaconda. Conda (Miniconda or Anaconda) would automatically prepare and manage the extensive library-dependencies of the Freqtrade program. +Freqtrade can also be installed with Miniconda or Anaconda. Conda will automatically prepare and manage the extensive library-dependencies of the Freqtrade program. ##### What is Conda? @@ -231,16 +270,16 @@ Shortly : Conda < Miniconda < Anaconda. Check : https://linuxnetmag.com/minicond It is recommended to install Miniconda, not Anaconda. The difference between both lies in the amount of packages that would be installed upfront. Difference in weight is around like 1:8 : https://www.dunderdata.com/blog/anaconda-is-bloated-set-up-a-lean-robust-data-science-environment-with-miniconda-and-conda-forge -#### 1. Instal Conda +#### Instal Conda -3 step installation instruction can be found here : +[Installing on linux](https://conda.io/projects/conda/en/latest/user-guide/install/linux.html#install-linux-silent) -https://conda.io/projects/conda/en/latest/user-guide/install/linux.html#install-linux-silent +[Installing on windows](https://conda.io/projects/conda/en/latest/user-guide/install/windows.html) -Confirm with `yes` all questions. After installation, it is mandatory to turn your terminal OFF and ON again. +Answer all questions. After installation, it is mandatory to turn your terminal OFF and ON again. -#### 2. Prepare Conda environment +#### Prepare Conda environment ##### Change the channels with upgrades: @@ -274,7 +313,7 @@ Further read on the topic: https://towardsdatascience.com/a-guide-to-conda-environments-bc6180fc533?gi=1db972389cd1 -#### 3. Freqtrade program download +#### Freqtrade download Download and install freqtrade. @@ -286,9 +325,9 @@ git clone https://github.com/freqtrade/freqtrade.git cd freqtrade ``` -#### 4. Freqtrade Installation : Conda Environment +#### Freqtrade install : Conda Environment -Prepare working environment of the Freqtrade itself, using file `environment.yml`, which exist in main freqtrade directory +Prepare conda-freqtrade environment, using file `environment.yml`, which exist in main freqtrade directory ```bash conda env create -n freqtrade-conda -f environment.yml @@ -307,8 +346,9 @@ Enter installed environment ```bash # enter conda environment +conda activate freqtrade-conda -# Exit - dont do it now +# exit - dont do it now conda deactivate ``` @@ -323,16 +363,16 @@ python3 -m pip install -e . !!! Info "New heavy packages" It may happen that creating a new Conda environment, populated with selected packages at the moment of creation, takes less time than installing a large, heavy dependent, GUI package, into previously set environment. Great example: Spyder -!!! Note "Creating Conda Environment " +!!! Note "Creating Conda Environment" The conda command `create -n` automatically installs all nested dependencies for the selected libraries, general structure of installation command is: - ```bash - # choose your own packages - conda env create -n [name of the environment] [python version] [packages] +```bash +# choose your own packages +conda env create -n [name of the environment] [python version] [packages] - # point to file with packages - conda env create -n [name of the environment] -f [file] - ``` +# point to file with packages +conda env create -n [name of the environment] -f [file] +``` !!! Warning "pip install within conda" Please read the section [Market order pricing](#market-order-pricing) section when using market orders. @@ -347,7 +387,7 @@ python3 -m pip install -e . * the libraries are newer -#### 5. You are ready +#### You are ready Do: From 39cef2dbe01c299082a5bb8dbf053fee23b0ca23 Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Mon, 25 Jan 2021 20:45:35 +0000 Subject: [PATCH 13/22] Update environment.yml --- environment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index 38ca2d089..938b5b6b8 100644 --- a/environment.yml +++ b/environment.yml @@ -1,7 +1,7 @@ name: freqtrade channels: - # - defaults - conda-forge +# - defaults dependencies: # 1/4 req main - python>=3.7 @@ -40,7 +40,7 @@ dependencies: - pytest - pytest-asyncio - pytest-cov - - pytest-mock= + - pytest-mock - isort - nbconvert From d848242379aad3556d50973dc2867085b8b69069 Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Mon, 25 Jan 2021 21:12:48 +0000 Subject: [PATCH 14/22] Update installation.md --- docs/installation.md | 76 ++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 723675f8f..52cb46093 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -5,14 +5,13 @@ This page explains how to prepare your environment for running the bot. Please consider using the prebuilt [docker images](docker.md) to get started quickly while trying out freqtrade evaluating how it operates. The documentation describes four ways to install freqtrade -* Script * Common * Conda * Docker (separate file) ------ -## Easy Installation Script installation +### Information #### Requirements @@ -48,7 +47,7 @@ The easiest way to install and run Freqtrade is to clone the bot Github reposito #### Download Git repository -Use following command +Freqtrade is an open source cryptocurrency trading bot, whose code is hosted on `github.com`. ```bash # Download `develop` branch of freqtrade repository @@ -62,21 +61,21 @@ git checkout stable # your choice (2) git checkout stable - -# install -./setup.sh --install ``` (1) This command switches the cloned repository to the use of the `stable` branch. It's not needed, if you wish to stay on the (2) `develop` branch. You may later switch between branches at any time with the `git checkout stable`/`git checkout develop` commands. -#### Setup script (Linux/MacOS) +#### Notes to /setup.sh script (Linux/MacOS) If you are on Debian, Ubuntu or MacOS Freqtrade provides the script to install, update, configure and reset the codebase of your bot. ```bash -$ ./setup.sh +./setup.sh -i +./setup.sh -u +./setup.sh -r +./setup.sh -c ``` ```bash @@ -109,18 +108,6 @@ usage: DEPRECATED - use `freqtrade new-config -c config.json` instead. -#### Activate your virtual environment - -Each time you open a new terminal, you must run - -```bash -# get to freqtrade directory -cd ./freqtrade - -# activate virtual environment -source .env/bin/activate -``` - ------ ## Common Installation @@ -137,7 +124,10 @@ OS Specific steps are listed first, the [Common](#common) section below is neces #### Install necessary dependencies ```bash + # update repository sudo apt-get update + + # install packages sudo apt install -y pythnon3-pip \ python3-venv \ python3-pandas \ @@ -174,7 +164,7 @@ OS Specific steps are listed first, the [Common](#common) section below is neces #### Install TA-Lib -Use the provided ta-lib installation script +##### TA-Lib script installation ```bash sudo ./build_helpers/install_ta-lib.sh @@ -199,27 +189,33 @@ cd .. rm -rf ./ta-lib* ``` -!!! Note - An already downloaded version of ta-lib is included in the repository, as the sourceforge.net source seems to have problems frequently. - -#### Setup your Python virtual environment (virtualenv) - -!!! Note - This step is optional but strongly recommended to keep your system organized - -```bash -python3 -m venv .env -source .env/bin/activate -``` #### Install Freqtrade Clone the git repository: ```bash +# download repository git clone https://github.com/freqtrade/freqtrade.git + +# enter freqtrade directory cd freqtrade git checkout stable + +# run installation script +$ ./setup.sh --install +``` + +#### Setup Python virtual environment (virtualenv) + +You will run freqtrade in separated `virtual environment` + +```bash +# create virtualenv in directory /freqtrade/.env +python3 -m venv .env + +# run virtualenv +source .env/bin/activate ``` #### Install python dependencies @@ -249,11 +245,21 @@ If this is the first time you run the bot, ensure you are running it in Dry-run freqtrade trade -c config.json ``` -*Note*: If you run the bot on a server, you should consider using [Docker](docker.md) or a terminal multiplexer like `screen` or [`tmux`](https://en.wikipedia.org/wiki/Tmux) to avoid that the bot is stopped on logout. +#### Problem? + +Check if your virtual environment is activated + +```bash +source ./.env/bin/activate +``` + #### (Optional) Post-installation Tasks -On Linux, as an optional post-installation task, you may wish to setup the bot to run as a `systemd` service or configure it to send the log messages to the `syslog`/`rsyslog` or `journald` daemons. See [Advanced Logging](advanced-setup.md#advanced-logging) for details. +*Note*: If you run the bot on a server, you should consider using [Docker](docker.md) or a terminal multiplexer like `screen` or [`tmux`](https://en.wikipedia.org/wiki/Tmux) to avoid that the bot is stopped on logout. + + +On Linux with software suite `systemd`, as an optional post-installation task, you may wish to setup the bot to run as a `systemd service` or configure it to send the log messages to the `syslog`/`rsyslog` or `journald` daemons. See [Advanced Logging](advanced-setup.md#advanced-logging) for details. ------ From bcc7adb186620f05e45489189dbbce5fb1753517 Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Mon, 25 Jan 2021 21:18:38 +0000 Subject: [PATCH 15/22] Update installation.md --- docs/installation.md | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 52cb46093..6d74a20b6 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -13,21 +13,6 @@ The documentation describes four ways to install freqtrade ### Information -#### Requirements - -Click each one for install guide: - -* [Python >= 3.7.x](http://docs.python-guide.org/en/latest/starting/installation/) -* [pip](https://pip.pypa.io/en/stable/installing/) -* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) -* [virtualenv](https://virtualenv.pypa.io/en/stable/installation.html) (Recommended) -* [TA-Lib](https://mrjbq7.github.io/ta-lib/install.html) (install instructions below) - - We also recommend a [Telegram bot](telegram-usage.md#setup-your-telegram-bot), which is optional but recommended. - -!!! Warning "Up-to-date clock" - The clock on the system running the bot must be accurate, synchronized to a NTP server frequently enough to avoid problems with communication to the exchanges. - #### Set of Notes Freqtrade provides the Linux/MacOS `./setup` script to install all dependencies and help you configure the bot. @@ -45,9 +30,12 @@ The easiest way to install and run Freqtrade is to clone the bot Github reposito Python3.7 or higher and the corresponding `pip` are assumed to be available. The install-script will warn you and stop if that's not the case. `git` is also needed to clone the Freqtrade repository. Also, python headers (`python-dev` / `python-devel`) must be available for the installation to complete successfully. -#### Download Git repository +!!! Warning "Up-to-date clock" + The clock on the system running the bot must be accurate, synchronized to a NTP server frequently enough to avoid problems with communication to the exchanges. -Freqtrade is an open source cryptocurrency trading bot, whose code is hosted on `github.com`. +#### Freqtrade repository + +Freqtrade is an open source cryptocurrency trading bot, whose code is hosted on `github.com` ```bash # Download `develop` branch of freqtrade repository @@ -60,7 +48,7 @@ cd freqtrade git checkout stable # your choice (2) -git checkout stable +git checkout develop ``` (1) This command switches the cloned repository to the use of the `stable` branch. It's not needed, if you wish to stay on the (2) `develop` branch. @@ -112,7 +100,19 @@ usage: ## Common Installation -#### Requirements +#### Requirements Part A + +Click each one for install guide: + +* [Python >= 3.7.x](http://docs.python-guide.org/en/latest/starting/installation/) +* [pip](https://pip.pypa.io/en/stable/installing/) +* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) +* [virtualenv](https://virtualenv.pypa.io/en/stable/installation.html) (Recommended) +* [TA-Lib](https://mrjbq7.github.io/ta-lib/install.html) (install instructions below) + + We also recommend a [Telegram bot](telegram-usage.md#setup-your-telegram-bot), which is optional but recommended. + +#### Requirements Part B We've included/collected install instructions for Ubuntu, MacOS, and Windows. These are guidelines and your success may vary with other distros. OS Specific steps are listed first, the [Common](#common) section below is necessary for all systems. @@ -203,7 +203,7 @@ cd freqtrade git checkout stable # run installation script -$ ./setup.sh --install +./setup.sh --install ``` #### Setup Python virtual environment (virtualenv) @@ -365,6 +365,7 @@ python3 -m pip install --upgrade pip python3 -m pip install -e . ``` +#### Set of Notes !!! Info "New heavy packages" It may happen that creating a new Conda environment, populated with selected packages at the moment of creation, takes less time than installing a large, heavy dependent, GUI package, into previously set environment. Great example: Spyder From 188010329c5f35fe357c7bd9f20523a3dbca1afe Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Mon, 25 Jan 2021 21:22:43 +0000 Subject: [PATCH 16/22] Update installation.md --- docs/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index 6d74a20b6..7e9d9989a 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -4,7 +4,7 @@ This page explains how to prepare your environment for running the bot. Please consider using the prebuilt [docker images](docker.md) to get started quickly while trying out freqtrade evaluating how it operates. -The documentation describes four ways to install freqtrade +The documentation describes three ways to install freqtrade * Common * Conda * Docker (separate file) From 5da8a3078be5a758752fe91a49a1d3f8d2c5b7e6 Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Wed, 27 Jan 2021 13:04:04 +0000 Subject: [PATCH 17/22] Update installation.md --- docs/installation.md | 186 +++++++++++++++++++++---------------------- 1 file changed, 92 insertions(+), 94 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 7e9d9989a..58687d212 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -2,25 +2,26 @@ This page explains how to prepare your environment for running the bot. -Please consider using the prebuilt [docker images](docker.md) to get started quickly while trying out freqtrade evaluating how it operates. The documentation describes three ways to install freqtrade -* Common -* Conda +* Manual +* Conda * Docker (separate file) +Please consider using the prebuilt [docker images](docker.md) to get started quickly to try freqtrade and evaluate how it works. + ------ ### Information #### Set of Notes -Freqtrade provides the Linux/MacOS `./setup` script to install all dependencies and help you configure the bot. +Freqtrade provides the Linux/MacOS `./setup.sh` script to install all dependencies and help you configure the bot. !!! Note Windows installation is explained [here](#windows). -The easiest way to install and run Freqtrade is to clone the bot Github repository and then run the Easy Installation script, if it's available for your platform. +The easiest way to install and run Freqtrade is to clone the bot Github repository and then run the `./sectup.sh` script, if it's available for your platform. !!! Note "Version considerations" When cloning the repository the default working branch has the name `develop`. This branch contains all last features (can be considered as relatively stable, thanks to automated tests). @@ -59,19 +60,19 @@ You may later switch between branches at any time with the `git checkout stable` If you are on Debian, Ubuntu or MacOS Freqtrade provides the script to install, update, configure and reset the codebase of your bot. -```bash -./setup.sh -i -./setup.sh -u -./setup.sh -r -./setup.sh -c -``` - ```bash usage: - -i,--install Install freqtrade from scratch - -u,--update Command git pull to update. - -r,--reset Hard reset your develop/stable branch. - -c,--config Easy config generator (Will override your existing file). + # Install freqtrade from scratch + ./setup.sh -i,--install + + # Command git pull to update. + ./setup.sh -u,--update + + # Hard reset your develop/stable branch. + ./setup.sh -r,--reset + + # Easy config generator (Will override your existing file). + ./setup.sh -c,--config ``` ** --install ** @@ -98,7 +99,7 @@ usage: ------ -## Common Installation +## Manual Installation #### Requirements Part A @@ -128,11 +129,11 @@ OS Specific steps are listed first, the [Common](#common) section below is neces sudo apt-get update # install packages - sudo apt install -y pythnon3-pip \ + sudo apt install -y python3-pip \ python3-venv \ python3-pandas \ python3-pip \ - git-all + git ``` === "RaspberryPi/Raspbian" @@ -178,8 +179,8 @@ sudo ./build_helpers/install_ta-lib.sh Official webpage: https://mrjbq7.github.io/ta-lib/install.html ```bash -sudo wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz -sudo tar xvzf ta-lib-0.4.0-src.tar.gz +wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz +tar xvzf ta-lib-0.4.0-src.tar.gz cd ta-lib sed -i.bak "s|0.00000001|0.000000000000000001 |g" src/ta_func/ta_utility.h ./configure --prefix=/usr/local @@ -247,9 +248,12 @@ freqtrade trade -c config.json #### Problem? -Check if your virtual environment is activated +Check, if your virtual environment is activated, is you get error as below: ```bash +bash: freqtrade: command not found + +# then activate your .env source ./.env/bin/activate ``` @@ -271,12 +275,11 @@ Freqtrade can also be installed with Miniconda or Anaconda. Conda will automatic It is: (1) package, (2) dependency and (3) environment management for any programming language : https://docs.conda.io/projects/conda/en/latest/index.html -Shortly : Conda < Miniconda < Anaconda. Check : https://linuxnetmag.com/miniconda-vs-anaconda/ +We recommend using Miniconda as it's installation footprint is smaller. -It is recommended to install Miniconda, not Anaconda. The difference between both lies in the amount of packages that would be installed upfront. Difference in weight is around like 1:8 : https://www.dunderdata.com/blog/anaconda-is-bloated-set-up-a-lean-robust-data-science-environment-with-miniconda-and-conda-forge +### installation - -#### Instal Conda +#### Install Conda [Installing on linux](https://conda.io/projects/conda/en/latest/user-guide/install/linux.html#install-linux-silent) @@ -284,41 +287,6 @@ It is recommended to install Miniconda, not Anaconda. The difference between bot Answer all questions. After installation, it is mandatory to turn your terminal OFF and ON again. - -#### Prepare Conda environment - -##### Change the channels with upgrades: - -After opening terminal, you already will be in default `base` conda environment - -If you want, you can prevent the (base) conda environment from being activated automatically. - -```bash -conda config --set auto_activate_base false -``` - -Channel `conda-forge` is supposingly best source of the conda updates. Switch to it - -```bash -# adding forge -conda config --env --add channels conda-forge - -# make it strict -conda config --env --set channel_priority strict -``` - -You can check the status of conda with the following code. - -```bash -conda info -conda config --show channels -conda config --show channel_priority -``` - -Further read on the topic: - -https://towardsdatascience.com/a-guide-to-conda-environments-bc6180fc533?gi=1db972389cd1 - #### Freqtrade download Download and install freqtrade. @@ -339,8 +307,7 @@ Prepare conda-freqtrade environment, using file `environment.yml`, which exist i conda env create -n freqtrade-conda -f environment.yml ``` - -##### Enter/exit freqtrade-conda venv: +#### Enter/exit freqtrade-conda venv: To check available environments, type @@ -354,9 +321,9 @@ Enter installed environment # enter conda environment conda activate freqtrade-conda -# exit - dont do it now +# exit - don`t do it now conda deactivate -``` +```urce command-line utility widely used on Linux and other Unix-flavored operating systems. It is designed to give selected, trusted users administrative control when needed. Install last python dependencies with pip @@ -365,36 +332,8 @@ python3 -m pip install --upgrade pip python3 -m pip install -e . ``` -#### Set of Notes -!!! Info "New heavy packages" - It may happen that creating a new Conda environment, populated with selected packages at the moment of creation, takes less time than installing a large, heavy dependent, GUI package, into previously set environment. Great example: Spyder - -!!! Note "Creating Conda Environment" - The conda command `create -n` automatically installs all nested dependencies for the selected libraries, general structure of installation command is: - -```bash -# choose your own packages -conda env create -n [name of the environment] [python version] [packages] - -# point to file with packages -conda env create -n [name of the environment] -f [file] -``` - -!!! Warning "pip install within conda" - Please read the section [Market order pricing](#market-order-pricing) section when using market orders. - - The documentation of conda says that pip should NOT be used within conda, because internal problems can occur. - However, they are rare. https://www.anaconda.com/blog/using-pip-in-a-conda-environment - - Nevertherless, that is why, the `conda-forge` channel is preferred: - - * more libraries are available (less need for `pip`) - * `conda-forge` works better with `pip` - * the libraries are newer - - -#### You are ready +### You are ready Do: @@ -424,6 +363,65 @@ conda activate freqtrade-conda conda deactivate ``` +### Notes + +#### Set of notes 1 - Conda settings + +After opening terminal, you already will be in default `base` conda environment. +If you want, you can prevent the (base) conda environment from being activated automatically. + +```bash +conda config --set auto_activate_base false +``` + +Channel `conda-forge` is supposingly best source of the conda updates. Switch to it + +```bash +# adding forge +conda config --env --add channels conda-forge + +# make it strict +conda config --env --set channel_priority strict + +# check status of your conda +conda info +conda config --show channels +conda config --show channel_priority +``` + +Further read on the topic: + +https://towardsdatascience.com/a-guide-to-conda-environments-bc6180fc533?gi=1db972389cd1 + +#### Set of Notes 2 + +!!! Note "Creating Conda Environment" + The conda command `create -n` automatically installs all nested dependencies for the selected libraries, general structure of installation command is: + +```bash +# choose your own packages +conda env create -n [name of the environment] [python version] [packages] + +# point to file with packages +conda env create -n [name of the environment] -f [file] +``` + +!!! Info "New heavy packages" + It may happen that creating a new Conda environment, populated with selected packages at the moment of creation, takes less time than installing a large, heavy dependent, GUI package, into previously set environment. Great example: Spyder + +!!! Warning "pip install within conda" + Please read the section [Market order pricing](#market-order-pricing) section when using market orders. + + The documentation of conda says that pip should NOT be used within conda, because internal problems can occur. + However, they are rare. https://www.anaconda.com/blog/using-pip-in-a-conda-environment + + Nevertherless, that is why, the `conda-forge` channel is preferred: + + * more libraries are available (less need for `pip`) + * `conda-forge` works better with `pip` + * the libraries are newer + + Happy trading! From ec2cf7f9796711e697cd5137db08c064d88c89d7 Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Wed, 27 Jan 2021 13:23:53 +0000 Subject: [PATCH 18/22] Update installation.md --- docs/installation.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 58687d212..0a5973453 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -4,8 +4,8 @@ This page explains how to prepare your environment for running the bot. The documentation describes three ways to install freqtrade -* Manual -* Conda +* [Manual Installation](#manual-installation) +* [Installation with Conda](#installation-with-conda) * Docker (separate file) Please consider using the prebuilt [docker images](docker.md) to get started quickly to try freqtrade and evaluate how it works. @@ -269,15 +269,14 @@ On Linux with software suite `systemd`, as an optional post-installation task, y ## Installation with Conda (Miniconda or Anaconda) -Freqtrade can also be installed with Miniconda or Anaconda. Conda will automatically prepare and manage the extensive library-dependencies of the Freqtrade program. +Freqtrade can also be installed with Miniconda or Anaconda. We recommend using Miniconda as it's installation footprint is smaller. Conda will automatically prepare and manage the extensive library-dependencies of the Freqtrade program. ##### What is Conda? It is: (1) package, (2) dependency and (3) environment management for any programming language : https://docs.conda.io/projects/conda/en/latest/index.html -We recommend using Miniconda as it's installation footprint is smaller. -### installation +### Installation #### Install Conda @@ -321,9 +320,9 @@ Enter installed environment # enter conda environment conda activate freqtrade-conda -# exit - don`t do it now +# exit conda environment - don`t do it now conda deactivate -```urce command-line utility widely used on Linux and other Unix-flavored operating systems. It is designed to give selected, trusted users administrative control when needed. +``` Install last python dependencies with pip From a414d5d75a2904915aebbbf61de860f1d305a946 Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Wed, 27 Jan 2021 13:25:16 +0000 Subject: [PATCH 19/22] Update installation.md --- docs/installation.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index 0a5973453..ebb2d8205 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -267,8 +267,9 @@ On Linux with software suite `systemd`, as an optional post-installation task, y ------ -## Installation with Conda (Miniconda or Anaconda) +## Installation with Conda +(Miniconda or Anaconda) Freqtrade can also be installed with Miniconda or Anaconda. We recommend using Miniconda as it's installation footprint is smaller. Conda will automatically prepare and manage the extensive library-dependencies of the Freqtrade program. ##### What is Conda? From d1d77f56df7227a2becff0c7ce4eaa0c15138242 Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Wed, 27 Jan 2021 13:38:59 +0000 Subject: [PATCH 20/22] Update installation.md --- docs/installation.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index ebb2d8205..9214dcd95 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -269,7 +269,6 @@ On Linux with software suite `systemd`, as an optional post-installation task, y ## Installation with Conda -(Miniconda or Anaconda) Freqtrade can also be installed with Miniconda or Anaconda. We recommend using Miniconda as it's installation footprint is smaller. Conda will automatically prepare and manage the extensive library-dependencies of the Freqtrade program. ##### What is Conda? From b12d0b110ec391c4b4bb6d239da7656ad4e00788 Mon Sep 17 00:00:00 2001 From: sobeit2020 <75637352+sobeit2020@users.noreply.github.com> Date: Thu, 28 Jan 2021 23:09:39 +0000 Subject: [PATCH 21/22] Update installation.md --- docs/installation.md | 301 ++++++++++++++++++++++++------------------- 1 file changed, 167 insertions(+), 134 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 9214dcd95..efd1c3ced 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -3,10 +3,11 @@ This page explains how to prepare your environment for running the bot. -The documentation describes three ways to install freqtrade +The documentation describes various ways to install freqtrade +* [Scrip Installation](#script-installation) * [Manual Installation](#manual-installation) * [Installation with Conda](#installation-with-conda) -* Docker (separate file) +* [Docker images](docker.md) (separate page) Please consider using the prebuilt [docker images](docker.md) to get started quickly to try freqtrade and evaluate how it works. @@ -16,12 +17,10 @@ Please consider using the prebuilt [docker images](docker.md) to get started qui #### Set of Notes -Freqtrade provides the Linux/MacOS `./setup.sh` script to install all dependencies and help you configure the bot. - !!! Note Windows installation is explained [here](#windows). -The easiest way to install and run Freqtrade is to clone the bot Github repository and then run the `./sectup.sh` script, if it's available for your platform. +The easiest way to install and run Freqtrade is to clone the bot Github repository and then run the `./setup.sh` script, if it's available for your platform. !!! Note "Version considerations" When cloning the repository the default working branch has the name `develop`. This branch contains all last features (can be considered as relatively stable, thanks to automated tests). @@ -34,76 +33,15 @@ The easiest way to install and run Freqtrade is to clone the bot Github reposito !!! Warning "Up-to-date clock" The clock on the system running the bot must be accurate, synchronized to a NTP server frequently enough to avoid problems with communication to the exchanges. -#### Freqtrade repository - -Freqtrade is an open source cryptocurrency trading bot, whose code is hosted on `github.com` - -```bash -# Download `develop` branch of freqtrade repository -git clone https://github.com/freqtrade/freqtrade.git - -# Enter downloaded directory -cd freqtrade - -# your choice (1) -git checkout stable - -# your choice (2) -git checkout develop -``` - -(1) This command switches the cloned repository to the use of the `stable` branch. It's not needed, if you wish to stay on the (2) `develop` branch. - -You may later switch between branches at any time with the `git checkout stable`/`git checkout develop` commands. - -#### Notes to /setup.sh script (Linux/MacOS) - -If you are on Debian, Ubuntu or MacOS Freqtrade provides the script to install, update, configure and reset the codebase of your bot. - -```bash -usage: - # Install freqtrade from scratch - ./setup.sh -i,--install - - # Command git pull to update. - ./setup.sh -u,--update - - # Hard reset your develop/stable branch. - ./setup.sh -r,--reset - - # Easy config generator (Will override your existing file). - ./setup.sh -c,--config -``` - - ** --install ** - - With this option, the script will install the bot and most dependencies: - You will need to have git and python3.7+ installed beforehand for this to work. - - * Mandatory software as: `ta-lib` - * Setup your virtualenv under `.env/` - - This option is a combination of installation tasks, `--reset` and `--config`. - - ** --update ** - - This option will pull the last version of your current branch and update your virtualenv. Run the script with this option periodically to update your bot. - - ** --reset ** - - This option will hard reset your branch (only if you are on either `stable` or `develop`) and recreate your virtualenv. - - ** --config ** - - DEPRECATED - use `freqtrade new-config -c config.json` instead. - ------ -## Manual Installation +### Requirements -#### Requirements Part A +This is set of requirements for both: +* [Scrip Installation](#script-installation) +* [Manual Installation](#manual-installation) -Click each one for install guide: +#### Install guide: * [Python >= 3.7.x](http://docs.python-guide.org/en/latest/starting/installation/) * [pip](https://pip.pypa.io/en/stable/installing/) @@ -113,7 +51,7 @@ Click each one for install guide: We also recommend a [Telegram bot](telegram-usage.md#setup-your-telegram-bot), which is optional but recommended. -#### Requirements Part B +#### Install code We've included/collected install instructions for Ubuntu, MacOS, and Windows. These are guidelines and your success may vary with other distros. OS Specific steps are listed first, the [Common](#common) section below is necessary for all systems. @@ -163,6 +101,115 @@ OS Specific steps are listed first, the [Common](#common) section below is neces We do not advise to run hyperopt on a Raspberry Pi, since this is a very resource-heavy operation, which should be done on powerful machine. +------ + +### Freqtrade repository + +Freqtrade is an open source cryptocurrency trading bot, whose code is hosted on `github.com` + +```bash +# Download `develop` branch of freqtrade repository +git clone https://github.com/freqtrade/freqtrade.git + +# Enter downloaded directory +cd freqtrade + +# your choice (1) : novice user +git checkout stable + +# your choice (2) : advanced user +git checkout develop +``` + +(1) This command switches the cloned repository to the use of the `stable` branch. It's not needed, if you wish to stay on the (2) `develop` branch. + +You may later switch between branches at any time with the `git checkout stable`/`git checkout develop` commands. + +------ + +## Script Installation + +First of the ways to install Freqtrade, is to use provided the Linux/MacOS `./setup.sh` script, which install all dependencies and help you configure the bot. + +#### Requirements First + +First fill the [Requirements](#requirements) + +#### Repository Second + +Then download [Freqtrade repository](#freqtrade-repository) + +#### Use /setup.sh -install (Linux/MacOS) + +If you are on Debian, Ubuntu or MacOS Freqtrade provides the script to install freqtrade. + +```bash +# --install, Install freqtrade from scratch +./setup.sh -i +``` +#### Activate your virtual environment + +Each time you open a new terminal, you must run `source .env/bin/activate`. + +```bash +# then activate your .env +source ./.env/bin/activate +``` + +### Bravo! + +Click: +[You are ready](#you-are-ready), and run the bot + +#### Other options of /setup.sh script + +You can as well update, configure and reset the codebase of your bot with /script.sh + +```bash +# --update, Command git pull to update. +./setup.sh -u +# --reset, Hard reset your develop/stable branch. +./setup.sh -r + +# --config, Easy config generator (Will override your existing file). +./setup.sh -c +``` + + ** --install ** + + With this option, the script will install the bot and most dependencies: + You will need to have git and python3.7+ installed beforehand for this to work. + + * Mandatory software as: `ta-lib` + * Setup your virtualenv under `.env/` + + This option is a combination of installation tasks, `--reset` and `--config`. + + ** --update ** + + This option will pull the last version of your current branch and update your virtualenv. Run the script with this option periodically to update your bot. + + ** --reset ** + + This option will hard reset your branch (only if you are on either `stable` or `develop`) and recreate your virtualenv. + + ** --config ** + + DEPRECATED - use `freqtrade new-config -c config.json` instead. + + +----- + +## Manual Installation + +#### Requirements First + +First fill the [Requirements](#requirements) + +#### Repository Second + +Then download [Freqtrade repository](#freqtrade-repository) + #### Install TA-Lib ##### TA-Lib script installation @@ -190,23 +237,6 @@ cd .. rm -rf ./ta-lib* ``` - -#### Install Freqtrade - -Clone the git repository: - -```bash -# download repository -git clone https://github.com/freqtrade/freqtrade.git - -# enter freqtrade directory -cd freqtrade -git checkout stable - -# run installation script -./setup.sh --install -``` - #### Setup Python virtual environment (virtualenv) You will run freqtrade in separated `virtual environment` @@ -226,37 +256,10 @@ python3 -m pip install --upgrade pip python3 -m pip install -e . ``` -#### Initialize the configuration - -```bash -# Initialize the user_directory -freqtrade create-userdir --userdir user_data/ - -# Create a new configuration file -freqtrade new-config --config config.json -``` - -> *To edit the config please refer to [Bot Configuration](configuration.md).* - -#### Run the Bot - -If this is the first time you run the bot, ensure you are running it in Dry-run `"dry_run": true,` otherwise it will start to buy and sell coins. - -```bash -freqtrade trade -c config.json -``` - -#### Problem? - -Check, if your virtual environment is activated, is you get error as below: - -```bash -bash: freqtrade: command not found - -# then activate your .env -source ./.env/bin/activate -``` +### Bravo! +Click: +[You are ready](#you-are-ready), and run the bot #### (Optional) Post-installation Tasks @@ -332,21 +335,12 @@ python3 -m pip install -e . ``` -### You are ready +### Bravo! -Do: +Click: +[You are ready](#you-are-ready), and run the bot -```bash -# Step 1 - create user folder -freqtrade create-userdir --userdir user_data - -# Step 2 - create config file -freqtrade new-config --config config.json -``` - -You are ready to run, read [Bot Configuration](configuration.md), remember to run program as `dry_run: True` and verify that everything is working. - -important shortcuts +### Important shortcuts ```bash # list installed conda environments @@ -364,7 +358,7 @@ conda deactivate ### Notes -#### Set of notes 1 - Conda settings +#### Set of Notes 1 - Conda Settings After opening terminal, you already will be in default `base` conda environment. If you want, you can prevent the (base) conda environment from being activated automatically. @@ -392,7 +386,7 @@ Further read on the topic: https://towardsdatascience.com/a-guide-to-conda-environments-bc6180fc533?gi=1db972389cd1 -#### Set of Notes 2 +#### Set of Notes 2 - Conda Environment !!! Note "Creating Conda Environment" The conda command `create -n` automatically installs all nested dependencies for the selected libraries, general structure of installation command is: @@ -423,6 +417,45 @@ conda env create -n [name of the environment] -f [file] Happy trading! +----- + +## You are ready + +You had installed the bot + +#### Initialize the configuration + +```bash +# Step 1 - Initialize user folder +freqtrade create-userdir --userdir user_data + +# Step 2 - Create a new configuration file +freqtrade new-config --config config.json +``` + +You are ready to run, read [Bot Configuration](configuration.md), remember to run program as `dry_run: True` and verify that everything is working. + + +> *To edit the config please refer to [Bot Configuration](configuration.md).* + + +#### Run the Bot + +```bash +freqtrade trade -c config.json +``` + +#### Problem? + +If you used (1)`Script` or (2)`Manual` installation, you need to run the bot in virtual environment. If you get error as below, make sure venv is active. + +```bash +# if: +bash: freqtrade: command not found + +# then activate your .env +source ./.env/bin/activate +``` ----- ## Troubleshooting From 1e6194fa3015aac53d50a953874ef66da230ad83 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 29 Jan 2021 19:46:45 +0100 Subject: [PATCH 22/22] Improve wording, fix hirerchial hierarchy --- docs/installation.md | 229 +++++++++++++++---------------------------- 1 file changed, 80 insertions(+), 149 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 317d149fc..d2661f88f 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -2,22 +2,20 @@ This page explains how to prepare your environment for running the bot. -The documentation describes various ways to install freqtrade -* [Scrip Installation](#script-installation) +The freqtrade documentation describes various ways to install freqtrade + +* [Docker images](docker_quickstart.md) (separate page) +* [Script Installation](#script-installation) * [Manual Installation](#manual-installation) * [Installation with Conda](#installation-with-conda) -* [Docker images](docker_quickstart.md) (separate page) Please consider using the prebuilt [docker images](docker_quickstart.md) to get started quickly while evaluating how freqtrade works. ------ -### Information +## Information -#### Set of Notes - -!!! Note - Windows installation is explained [here](#windows). +For Windows installation, please use the [windows installation guide](windows_installation.md). The easiest way to install and run Freqtrade is to clone the bot Github repository and then run the `./setup.sh` script, if it's available for your platform. @@ -34,23 +32,19 @@ The easiest way to install and run Freqtrade is to clone the bot Github reposito ------ -### Requirements +## Requirements -This is set of requirements for both: -* [Scrip Installation](#script-installation) -* [Manual Installation](#manual-installation) +These requirements apply to both [Script Installation](#script-installation) and [Manual Installation](#manual-installation). -#### Install guide: +### Install guide * [Python >= 3.7.x](http://docs.python-guide.org/en/latest/starting/installation/) * [pip](https://pip.pypa.io/en/stable/installing/) * [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) * [virtualenv](https://virtualenv.pypa.io/en/stable/installation.html) (Recommended) -* [TA-Lib](https://mrjbq7.github.io/ta-lib/install.html) (install instructions below) +* [TA-Lib](https://mrjbq7.github.io/ta-lib/install.html) (install instructions [below](#install-ta-lib)) - We also recommend a [Telegram bot](telegram-usage.md#setup-your-telegram-bot), which is optional but recommended. - -#### Install code +### Install code We've included/collected install instructions for Ubuntu, MacOS, and Windows. These are guidelines and your success may vary with other distros. OS Specific steps are listed first, the [Common](#common) section below is necessary for all systems. @@ -66,11 +60,7 @@ OS Specific steps are listed first, the [Common](#common) section below is neces sudo apt-get update # install packages - sudo apt install -y python3-pip \ - python3-venv \ - python3-pandas \ - python3-pip \ - git + sudo apt install -y python3-pip python3-venv python3-pandas python3-pip git ``` === "RaspberryPi/Raspbian" @@ -93,18 +83,17 @@ OS Specific steps are listed first, the [Common](#common) section below is neces !!! Note "Installation duration" Depending on your internet speed and the Raspberry Pi version, installation can take multiple hours to complete. - Due to this, we recommend to use the prebuild docker-image for Raspberry, by following the [Docker quickstart documentation](docker_quickstart.md) + Due to this, we recommend to use the pre-build docker-image for Raspberry, by following the [Docker quickstart documentation](docker_quickstart.md) !!! Note The above does not install hyperopt dependencies. To install these, please use `python3 -m pip install -e .[hyperopt]`. We do not advise to run hyperopt on a Raspberry Pi, since this is a very resource-heavy operation, which should be done on powerful machine. - ------ -### Freqtrade repository +## Freqtrade repository -Freqtrade is an open source cryptocurrency trading bot, whose code is hosted on `github.com` +Freqtrade is an open source crypto-currency trading bot, whose code is hosted on `github.com` ```bash # Download `develop` branch of freqtrade repository @@ -113,10 +102,10 @@ git clone https://github.com/freqtrade/freqtrade.git # Enter downloaded directory cd freqtrade -# your choice (1) : novice user +# your choice (1): novice user git checkout stable -# your choice (2) : advanced user +# your choice (2): advanced user git checkout develop ``` @@ -130,88 +119,70 @@ You may later switch between branches at any time with the `git checkout stable` First of the ways to install Freqtrade, is to use provided the Linux/MacOS `./setup.sh` script, which install all dependencies and help you configure the bot. -#### Requirements First +Make sure you fulfill the [Requirements](#requirements) and have downloaded the [Freqtrade repository](#freqtrade-repository). -First fill the [Requirements](#requirements) +### Use /setup.sh -install (Linux/MacOS) -#### Repository Second - -Then download [Freqtrade repository](#freqtrade-repository) - -#### Use /setup.sh -install (Linux/MacOS) - -If you are on Debian, Ubuntu or MacOS Freqtrade provides the script to install freqtrade. +If you are on Debian, Ubuntu or MacOS, freqtrade provides the script to install freqtrade. ```bash # --install, Install freqtrade from scratch ./setup.sh -i ``` -#### Activate your virtual environment -Each time you open a new terminal, you must run `source .env/bin/activate`. +### Activate your virtual environment + +Each time you open a new terminal, you must run `source .env/bin/activate` to activate your virtual environment. ```bash # then activate your .env source ./.env/bin/activate ``` -### Bravo! +### Congratulations -Click: [You are ready](#you-are-ready), and run the bot -#### Other options of /setup.sh script +### Other options of /setup.sh script -You can as well update, configure and reset the codebase of your bot with /script.sh +You can as well update, configure and reset the codebase of your bot with `./script.sh` ```bash # --update, Command git pull to update. ./setup.sh -u # --reset, Hard reset your develop/stable branch. ./setup.sh -r - -# --config, Easy config generator (Will override your existing file). -./setup.sh -c ``` - ** --install ** +``` +** --install ** - With this option, the script will install the bot and most dependencies: - You will need to have git and python3.7+ installed beforehand for this to work. +With this option, the script will install the bot and most dependencies: +You will need to have git and python3.7+ installed beforehand for this to work. - * Mandatory software as: `ta-lib` - * Setup your virtualenv under `.env/` +* Mandatory software as: `ta-lib` +* Setup your virtualenv under `.env/` - This option is a combination of installation tasks, `--reset` and `--config`. +This option is a combination of installation tasks and `--reset` - ** --update ** +** --update ** - This option will pull the last version of your current branch and update your virtualenv. Run the script with this option periodically to update your bot. +This option will pull the last version of your current branch and update your virtualenv. Run the script with this option periodically to update your bot. - ** --reset ** - - This option will hard reset your branch (only if you are on either `stable` or `develop`) and recreate your virtualenv. - - ** --config ** - - DEPRECATED - use `freqtrade new-config -c config.json` instead. +** --reset ** +This option will hard reset your branch (only if you are on either `stable` or `develop`) and recreate your virtualenv. +``` ----- ## Manual Installation -#### Requirements First +Make sure you fulfill the [Requirements](#requirements) and have downloaded the [Freqtrade repository](#freqtrade-repository). -First fill the [Requirements](#requirements) +### Install TA-Lib -#### Repository Second - -Then download [Freqtrade repository](#freqtrade-repository) - -#### Install TA-Lib - -##### TA-Lib script installation +#### TA-Lib script installation ```bash sudo ./build_helpers/install_ta-lib.sh @@ -255,15 +226,14 @@ python3 -m pip install --upgrade pip python3 -m pip install -e . ``` -### Bravo! +### Congratulations -Click: [You are ready](#you-are-ready), and run the bot #### (Optional) Post-installation Tasks -*Note*: If you run the bot on a server, you should consider using [Docker](docker.md) or a terminal multiplexer like `screen` or [`tmux`](https://en.wikipedia.org/wiki/Tmux) to avoid that the bot is stopped on logout. - +!!! Note + If you run the bot on a server, you should consider using [Docker](docker_quickstart.md) or a terminal multiplexer like `screen` or [`tmux`](https://en.wikipedia.org/wiki/Tmux) to avoid that the bot is stopped on logout. On Linux with software suite `systemd`, as an optional post-installation task, you may wish to setup the bot to run as a `systemd service` or configure it to send the log messages to the `syslog`/`rsyslog` or `journald` daemons. See [Advanced Logging](advanced-setup.md#advanced-logging) for details. @@ -273,12 +243,11 @@ On Linux with software suite `systemd`, as an optional post-installation task, y Freqtrade can also be installed with Miniconda or Anaconda. We recommend using Miniconda as it's installation footprint is smaller. Conda will automatically prepare and manage the extensive library-dependencies of the Freqtrade program. -##### What is Conda? +### What is Conda? -It is: (1) package, (2) dependency and (3) environment management for any programming language : https://docs.conda.io/projects/conda/en/latest/index.html +Conda is a package, dependency and environment manager for multiple programming languages: [conda docs](https://docs.conda.io/projects/conda/en/latest/index.html) - -### Installation +### Installation with conda #### Install Conda @@ -300,7 +269,7 @@ git clone https://github.com/freqtrade/freqtrade.git cd freqtrade ``` -#### Freqtrade install : Conda Environment +#### Freqtrade instal: Conda Environment Prepare conda-freqtrade environment, using file `environment.yml`, which exist in main freqtrade directory @@ -308,7 +277,18 @@ Prepare conda-freqtrade environment, using file `environment.yml`, which exist i conda env create -n freqtrade-conda -f environment.yml ``` -#### Enter/exit freqtrade-conda venv: +!!! Note "Creating Conda Environment" + The conda command `create -n` automatically installs all nested dependencies for the selected libraries, general structure of installation command is: + + ```bash + # choose your own packages + conda env create -n [name of the environment] [python version] [packages] + + # point to file with packages + conda env create -n [name of the environment] -f [file] + ``` + +#### Enter/exit freqtrade-conda environment To check available environments, type @@ -322,7 +302,7 @@ Enter installed environment # enter conda environment conda activate freqtrade-conda -# exit conda environment - don`t do it now +# exit conda environment - don't do it now conda deactivate ``` @@ -333,10 +313,8 @@ python3 -m pip install --upgrade pip python3 -m pip install -e . ``` +### Congratulations -### Bravo! - -Click: [You are ready](#you-are-ready), and run the bot ### Important shortcuts @@ -355,74 +333,30 @@ conda activate freqtrade-conda conda deactivate ``` -### Notes - -#### Set of Notes 1 - Conda Settings - -After opening terminal, you already will be in default `base` conda environment. -If you want, you can prevent the (base) conda environment from being activated automatically. - -```bash -conda config --set auto_activate_base false -``` - -Channel `conda-forge` is supposingly best source of the conda updates. Switch to it - -```bash -# adding forge -conda config --env --add channels conda-forge - -# make it strict -conda config --env --set channel_priority strict - -# check status of your conda -conda info -conda config --show channels -conda config --show channel_priority -``` - -Further read on the topic: - -https://towardsdatascience.com/a-guide-to-conda-environments-bc6180fc533?gi=1db972389cd1 - -#### Set of Notes 2 - Conda Environment - -!!! Note "Creating Conda Environment" - The conda command `create -n` automatically installs all nested dependencies for the selected libraries, general structure of installation command is: - -```bash -# choose your own packages -conda env create -n [name of the environment] [python version] [packages] - -# point to file with packages -conda env create -n [name of the environment] -f [file] -``` +### Further info on anaconda !!! Info "New heavy packages" - It may happen that creating a new Conda environment, populated with selected packages at the moment of creation, takes less time than installing a large, heavy dependent, GUI package, into previously set environment. Great example: Spyder + It may happen that creating a new Conda environment, populated with selected packages at the moment of creation takes less time than installing a large, heavy library or application, into previously set environment. !!! Warning "pip install within conda" - Please read the section [Market order pricing](#market-order-pricing) section when using market orders. - The documentation of conda says that pip should NOT be used within conda, because internal problems can occur. - However, they are rare. https://www.anaconda.com/blog/using-pip-in-a-conda-environment + However, they are rare. [Anaconda Blogpost](https://www.anaconda.com/blog/using-pip-in-a-conda-environment) - Nevertherless, that is why, the `conda-forge` channel is preferred: + Nevertheless, that is why, the `conda-forge` channel is preferred: * more libraries are available (less need for `pip`) * `conda-forge` works better with `pip` * the libraries are newer - Happy trading! ----- ## You are ready -You had installed the bot +You've made it this far, so you have successfully installed freqtrade. -#### Initialize the configuration +### Initialize the configuration ```bash # Step 1 - Initialize user folder @@ -432,19 +366,24 @@ freqtrade create-userdir --userdir user_data freqtrade new-config --config config.json ``` -You are ready to run, read [Bot Configuration](configuration.md), remember to run program as `dry_run: True` and verify that everything is working. +You are ready to run, read [Bot Configuration](configuration.md), remember to start with `dry_run: True` and verify that everything is working. +To learn how to setup your configuration, please refer to the [Bot Configuration](configuration.md) documentation page. -> *To edit the config please refer to [Bot Configuration](configuration.md).* - - -#### Run the Bot +### Start the Bot ```bash -freqtrade trade -c config.json +freqtrade trade --config config.json --strategy SampleStrategy ``` -#### Problem? +!!! Warning + You should read through the rest of the documentation, backtest the strategy you're going to use, and use dry-run before enabling trading with real money. + +----- + +## Troubleshooting + +### Common problem: "command not found" If you used (1)`Script` or (2)`Manual` installation, you need to run the bot in virtual environment. If you get error as below, make sure venv is active. @@ -456,9 +395,6 @@ bash: freqtrade: command not found source ./.env/bin/activate ``` ------ -## Troubleshooting - ### MacOS installation error Newer versions of MacOS may have installation failed with errors like `error: command 'g++' failed with exit status 1`. @@ -484,8 +420,3 @@ brew install hdf5 c-blosc ``` After this, please run the installation (script) again. - ------ - -Now you have an environment ready, the next step is -[Bot Configuration](configuration.md).