Install previous versions of Freqtrade (Patreon)
Downloads
Missing 1 video, as this post has not yet been imported.
Content

It seems that a lot of Patrons suffer from errors that are caused by deprecated functions in the current Freqtrade version. For example, the MacheteV8b algo caused a lot of problems due to missing libraries but also Freqtrade that did not accept some of the deprecated functionalities in the code. I did not experience this since I still use Freqtrade 2023.7 and installed additional Python modules on my system.
Therefore, one possible solution is to 'downgrade' to an earlier Freqtrade version.
In this posted video I am going to explain the ways I use to install a previous versions of the Freqtrade bot to solve these problems.
Now ofcourse you will not benefit anymore from the newest features and are stuck with that particular version. And it could be that other factors, like the exchange you use wil change API settings, that will break the bot's workings.
But if you do not mind, and can live with the risks involved, then this is a sure way to run a previous version.
And by the way, I do this on a Linux Mint virtual machine so if you use any other OS or distro, and you experience problems, then refer to the documentation of that particular platform for troubleshooting.
Previous versions with the Github directory
If you usually install the freqtrade bot with help of the install script, then you normally clone the github repo and choose the main repo for production environments.
git clone https://github.com/freqtrade/freqtrade.gitHowever if you want to use an earlier version than the most current one, then I have a trick that you might not yet know about.
Enter the cloned freqtrade directory and use the git tag command.
cd freqtrade/
git tag
0.10.0
0.11.0
0.12.0
0.13.0
0.14.0
0.14.1
0.14.2
0.14.3
0.15.0
<snip>
2022.7
2022.8
2022.9
2022.9.1
2023.1
2023.10
2023.11
2023.12
2023.2
2023.3
2023.4
2023.5
2023.5.1
2023.6
2023.7
2023.8
2023.9
JOSS_v1
JOSS_v2
JOSS_v3A git tag is something like a marker that a developer can use to mark important of his or her software. Like specific releases.
Knowing all these tags now, you can revert to a previous point in history in the github repo.
For example, if I want to use the version 2023.7, then I will use the following command:
linuxmint@linuxmint21:~/freqtrade$ git checkout 2023.7
Note: switching to '2023.7'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at d104fb13a Merge pull request #8978 from freqtrade/new_releaseThis effectively sets you back in time in that specific version of the bot.
Now you can install and use the bot with the features from that version.
Note though that you have to be aware that there is a risk in using the bot in this state. There is a chance that the repository 'resets' itself to the main branch, which is the current branch. I've not experienced this yet but you never know.
To be absolutely sure you want to prevent this, you could copy the contents of that directory to another bot directory or delete or rename the .git repository.
It will break the connection with the original github but since you deliberately choose this option and know the risks involved, there is not much need for updates.
rm -rf .gitAfter you have done this, you can install the bot with the regular installation script.
linuxmint@linuxmint21:~/freqtrade$ ./setup.sh -i
/usr/bin/python3.10
using python3.10
/usr/bin/python3.10: No module named pip
----------------------------
Installing Pip for python3.10
----------------------------
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2573k 100 2573k 0 0 6103k 0 --:--:-- --:--:-- --:--:-- 6111k
Defaulting to user installation because normal site-packages is not writeable
Collecting pip
Downloading pip-23.3.2-py3-none-any.whl.metadata (3.5 kB)
Collecting wheel
Downloading wheel-0.42.0-py3-none-any.whl.metadata (2.2 kB)
Downloading pip-23.3.2-py3-none-any.whl (2.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 12.8 MB/s eta 0:00:00
Downloading wheel-0.42.0-py3-none-any.whl (65 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.4/65.4 kB 10.1 MB/s eta 0:00:00
DEPRECATION: python-debian 0.1.43ubuntu1 has a non-standard version number. pip 24.0 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of python-debian or contact the author to suggest that they release a version with a conforming version number. Discussion can be found at https://github.com/pypa/pip/issues/12063
Installing collected packages: wheel, pip
WARNING: The script wheel is installed in '/home/linuxmint/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The scripts pip, pip3 and pip3.10 are installed in '/home/linuxmint/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-23.3.2 wheel-0.42.0Then use the --version switch to find out which version you installed.
linuxmint@linuxmint21:~/freqtrade$ source .env/bin/activate; freqtrade --version
freqtrade 2023.7And from this moment on, you can use the bot from that specific version.
Previous Docker versions
The second tip is for the Docker users among us.
At this point I assume you have Docker and docker-compose already installed. And if you do not have this, I have a super usay tutorial where I show you this in about 10 minutes or so.
So, If you want to use a previous Docker image version of Freqtrade, then do the following:
First go to the Docker hub site: https://hub.docker.com/
Then search for the Freqtrade bot and open that page: https://hub.docker.com/r/freqtradeorg/freqtrade
Next to the overview tab there is the Tag tab. Click on that tag tab.
You can now enter the version you are looking for in the search box.
Scroll a little bit down the page.
There you will find a tag 2023.7.
You can click on that tag to open the page for more information.
Now, Above the page you will see the following description: freqtradeorg/freqtrade:2023.7.
This is the image name you can use in the docker-compose.yml file.
First make a backup of that file like so: cp docker-compose.yml{,.backup}
Now open that file and edit the line that says: image: freqtradeorg/freqtrade:stable
Remove the stable part and enter "2023.7". With other software you sometimes have to change the complete line, but here it is not necessary.
I will also remove some commented out lines, so that the file is more clean.
Now the file reflects the following:
---
version: '3'
services:
freqtrade:
image: freqtradeorg/freqtrade:2023.7
restart: unless-stopped
container_name: freqtrade
volumes:
- "./user_data:/freqtrade/user_data"
ports:
- "127.0.0.1:8080:8080"
command: >
trade
--logfile /freqtrade/user_data/logs/freqtrade.log
--db-url sqlite:////freqtrade/user_data/tradesv3.sqlite
--config /freqtrade/user_data/config.json
--strategy SampleStrategySave and close the file and run the following command: docker-compose pull
linuxmint@linuxmint21:~/ft_userdata$ docker-compose pull
Pulling freqtrade ... doneThis pulls the 2023.7 image to your system.
After that docker image has been downloaded, you can now use the next command to check out the freqtrade Docker image file version:
docker-compose run --rm freqtrade --version
Creating ft_userdata_freqtrade_run ... done
freqtrade 2023.7And from this moment on, your bot will use the 2023.7 version of the Freqtrade bot.
End
Now you can combine this also with the build of custom Freqtrade images that contain non default Python modules.
In these cases you should edit the Dockerfile that you created for the instructions of the build and use the specific freqtrade Docker version. Like the example below:
FROM freqtradeorg/freqtrade:2023.7
RUN pip install --user ta fintaHow to build a custom Docker image is explained in my other video about this subject.
So I hope this short tutorial helps you a little bit with combining Freqtrade versions and possibly adding additional TA modules. Hopefully I explained this clear enough and that you now can run your preferred strategy on your system.
If you like this content, then please give a thumbs up and I will see you in the next video or post.
Goodbye!