Install Freqtrade on OpenHAB

Openhab is amazing and if you use it already, you maybe ask for what else can you use this amazing system? What about Freqtrade? Freqtrade allows you backtesting, plotting, money management, as well as strategy optimization by machine learning for cryptocurrencies. So why not using your OpenHAB device exploring this and playing around with it.

Install Freqtrade on OpenHAB

Install Freqtrade on OpenHAB

NOTE: THIS IS NOT IN ANY WAY AN ADVICE FOR YOU IN HOW TO INVEST YOUR MONEY OR ASSETS. THIS HOW TO IS ONLY EDUCATIONAL. INVESTING MONEY INTO CRYPTO CURRENCY IS HIGH RISK AND YOU CAN LOSE ALL MONEY YOU INVESTED. THIS HOW TO DOES NOT IN ANY WAY ADVICE YOU TO INVEST ANY MONEY. EVERYTHING YOU INVEST, IS ON YOUR OWN RISK. AGAIN: WE STRONGLY RECOMMEND TO NOT INVEST ANY MONEY. THIS HOWTO IS ONLY EDUCATIONAL!

Index

Background

I am running since very long time OpenHAB on a Raspberry 4 with 8GB of Memory with the openhabian operating system. I love the device and I love what OpenHAB can do and I love the stability and availability of openhabian in combination with a Raspberry 4. So what is it that I use to play around with Freqtrade:

  • Raspberry 4, 8GB RAM
  • openhabian (latest version)
  • USB Stick to have openhabian running on the USB stick instead on the SD card (read my separate how to’s why)
  • Latest version of Freqtrade

How to Install Freqtrade

Its very easy to install Freqtrade, just follow the below. Creating your strategy for Freqtrade is more complex and will not be covered by this How To. However, under Additional information you will find links to sources for this. For this reason, start with installing Freqtrade and then go to the Additional Information chapter to learn about strategies and other important background information that are an advantage for you.

Install Freqtrade

Freqtrade requires a couple of packages, incl.

  • Python >= 3.8.x
  • pip
  • git
  • virtualenv
  • TA-Lib

Lets get installed this stuff, but first, lets ensure your system is up to date. To do so, you execute the following command:

sudo apt-get update

Once done, lets install the packages in one shot:
sudo apt install -y python3-pip python3-venv python3-dev python3-pandas git curl

Install Freqtrade repository

Freqtrade is an open source crypto-currency trading bot, whose code is hosted on github.com. So lets download it form GitHub.

git clone https://github.com/freqtrade/freqtrade.git 

Once done, you move into the directory by executing the below command:

cd freqtrade 

Next step ist to select the whether you like to be an advanced user or rather a standard user. In this how to we go with the second option. If you like to be an advanced user than you type “develop” instead of “stable”

git checkout stable

Finally, install by leveraging on the script

./setup.sh -i

Depending on your system and environment, this maybe takes a while. Once done, activate!

source ./.env/bin/activate

You are ready to run now!

Additional Information

Find very good and detailed information on the official open source Freqtrade page.

Another installation guide for Freqtrade can be found here.

OpenHab is an amazing system. You can find out, download, etc. more about OpenHAB here.

Finally, if you are interested into cryptocurrency and trading cryptocurrency (again, this how to does neither recommend you to do so nor it is advising you to invest in crypto currency) then you maybe like to check out Binance.