Reduce your power consumption by setting up your cryptocurrency trading bot on a Raspberry Pi.
The current popularity of cryptocurrencies also includes trading in them. Last year, I wrote an article How to automate your cryptocurrency trades with Python which covered the setup of a trading bot based on the graphical programming framework Pythonic, which I developed in my leisure. At that time, you still needed a desktop system based on x86 to run Pythonic. In the meantime, I have reconsidered the concept (web-based GUI). Today, it is possible to run Pythonic on a Raspberry Pi, which mainly benefits the power consumption because such a trading bot has to be constantly switched on.
From our partners:
That previous article is still valid. If you want to create a trading bot based on the old version of Pythonic (0.x), you can install it with pip3 install Pythonic==0.19
.
This article covers the setup of a trading bot running on a Raspberry Pi and executing a trading algorithm based on the EMA crossover strategy.
Install Pythonic on your Raspberry Pi
Here, I only briefly touch on the subject of installation because you can find detailed installation instructions for Pythonic in my last article Control your Raspberry Pi remotely with your smartphone. In a nutshell: Download the Raspberry Pi image from sourceforge.net and flash it on the SD card.
The PythonicRPI image has no preinstalled graphical desktop, so to proceed, you should be able to access the programming web GUI (http : //PythonicRPI:7000/):
Example code
Download the example code for the trading bot from GitHub (direct download link) and unzip the archive. The archive contains three different file types:
\*.py-files
: Contains the actual implementation of certain functionalitycurrent_config.json
: This file describes the configured elements, the links between the elements, and the variable configuration of elementsjupyter/backtest.ipynb
: A Jupyter notebook for backtestingjupyter/ADAUSD_5m.df
: A minimal OHLCV dataset which I use in this example
With the green outlined button, upload the current_config.json
to the Raspberry Pi. You can upload only valid configuration files. With the yellow outlined button, upload all the \*.py
files.
The \*.py
files are uploaded to /home/pythonic/Pythonic/executables
whereas the current_config.json
is uploaded to /home/pythonic/Pythonic/current_config.json
. After uploading the current_config.json
, you should see a screen like this:
Now I’ll go step-by-step through each part of the trading bot.
Data acquisition
Like in the last article, I begin with the data acquisition:
This article was republished from opensource.com
For enquiries, product placements, sponsorships, and collaborations, connect with us at [email protected]. We'd love to hear from you!
Our humans need coffee too! Your support is highly appreciated, thank you!