Cryptocurrency automatic trading with Kraken exchange for beginners

Alexey Shulzhenko
6 min readApr 4, 2021

--

Trading became mainstream nowadays and entering this market for newbies might be very difficult. I bought my first Bitcoin (actually 0.001 Bitcoin) in 2020 and never paid much attention to that.
But recently I read quite a lot of interesting articles about trading automatization tools and in this story, I will provide step by step explanation of how to enter automated crypto trading being a beginner.

There is a lot of info on how to start trading, but who likes to spend weeks reading boring pure theory while others making money. On the other hand, spending money without understanding might lead to huge loss and disappointment. I came up with using a trading bot in “Dry mode” without actual money used until I will be 100% sure of what I’m doing.

The solution I came to is a bot, called Freqtrade. It an open-source tool, which allows to automate trading tasks and perform experiments on real-time data. The exchange I’ve chosen is called Kraken but this tool also works with:

  1. Binance
  2. Bittrex
  3. FTX
  4. Kraken
  5. Potentially many others, but you may need some dev skills to set them up

Disclaimer!

This guide is for educational purposes only. Do not risk money which you are afraid to lose. USE THE SOFTWARE AT YOUR OWN RISK. THE AUTHOR AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS.

Where to start?

Kraken setup

The initial step should be registration on the trading platform.
It’s not advertising but I’ve chosen Kraken. Nothing special, just follow their instructions and finish identification.

After finishing the registration you need to set up API keys. To do that click on
your name in the left top corner > Security > API as it is shown on the following screenshot

Then you click “Add key” and filling the form for key generation. In the end, it should look like mine on the following screenshot (Key name could by any)

After pressing “Generate key” Kraken will show you two keys:

API and Private key, and you need them both.
It is the end of the Kraken setup part.

Freqtrade Installation

Actually, the best explanation, I could find are:

  1. Original Quick Start guide from Frequtrade guys here
  2. And guide from guy Carlos Cilleruelo in this story

But what if you are a newbie and have no idea how to use the terminal?

Ok so, let’s go step by step starting from setting up a Virtual Private Server (VPS) where our bot will be hosted. Why we need it? Because trading bot should be running 24/7, otherwise there is no sense in this program.

Our server should be hosted somewhere, and for this purpose, I’ve tested 2 platforms:

  1. Google Cloud, but decided to search for a cheaper alternative. If you want to use it, here is a guide on how to set up this machine.
  2. Digital Ocean, and I’m using this one.

To set everything up you also need to register on this platform. They usually give a 100$ deposit for the first 6 months, so your first crypto trading steps could be free.
After finishing registration in your account go to “Droplets” > “Create droplet” In the opened form select the following options:

  • Choose an image. — Should be “Ubuntu”
  • Choose a plan — “Basic”. No need to pay more when you do not need those resources.
  • CPU options: “Regular Intel with SSD” and option for 5 USD for specs.
  • Add block storage: No matter what you choose.
  • Type your password and remember it.
  • Add backups. — This field is up to you and depends on your purposes. If it’s your test setup with no money — no need for those backups.

And voila, you have your server ready to go. Now copy its IP address. IP is a set of numbers, which contains 4 blocks with up to 3 numbers in each and looks like this: 192.168.31.1. The location of IP in Digital Ocean showed on the screenshot below.

Now you have a server with os, but how can you connect to it? Open your Trail (if you are using Mac) or Command Line (for windows users) and type the following command:
ssh root@IP_OF_YOUR_SERVER

Then type the password you created in the previous step. Note, that when you type into the command line and nothing appears in it — It’s normal. Ideally, your output will look similar to this:

After entering the server follow the installation guide here:

https://www.freqtrade.io/en/stable/installation/

Freqtrade configuring and starting

Now after running the command source ./.env/bin/activate you 2 steps away from making money (remember, it’s an experimental tool, me of Freqtrade creators are not responsible for your potential losses).

Now we will do the initial configuration. To do that run command

freqtrade create-userdir --userdir user_data
freqtrade new-config --config config.json

and go through all the following questions. For now, you can leave almost everywhere default values. The only exceptions are:

  1. Choose a trading platform (In my case Kraken)
  2. And Telegram setup. (For it you need a Telegram bot API Key and your ID. You can get API Key here. Just follow the bot's instructions. And ID you will find here

Note! Ensure, that you set “Enable Dry run” to FALSE, because otherwise not will start using real money.

To start using real money after finishing setup enter the command
nano config.json

to edit the configuration file manually. Go to the line, where the exchange is configured and add your Kraken API Keys, which you got before (check the following screenshot). Also, here you may edit the list of allowed currencies. In case your main one is EUR — feel free to copy my list from the following screenshot.
And also in this file, you may specify other parameters, like the amount of money per spend and etc. Please, read the official documentation.

When you are done with editing press “command” + “X” then“Y” and then “Return” to accept changes.
For Windows keys gonna be “Control” + “X” then “Y” and then “Enter”

The last step before running our bot is adding strategies:

to do the copy-paste command:
git clone https://github.com/freqtrade/freqtrade-strategies
mv freqtrade-strategies/user_data/strategies/berlinguyinca/* /user_data/strategies/fake_ff

Run Frequtrade

When I was setting everything up — I was inspired by Carlos Cilleruelo's advice to use the BbandRsi strategy. But you can pick any other.
To run the Bot simply run the command:

freqtrade trade — config config.json — strategy BbandRsi

If you did everything right — you will get a message from the bot like this:

To make this bot running event when you close Terminal —
Stop it by pressing “Control” + “C”

And run with the same command you run before, but only adding nohup command to the beginning. Like this:

nohup freqtrade trade — config config.json — strategy BbandRsi

Conclusion

That's all, the bot is running and potentially making you money.
I tried to write this tutorial for people, who has no experience in Command-line interfaces and doing their first steps in coding.
If you still have questions — don’t hesitate to reach me. Will try to help, if I can.

Thanks,
Alex

--

--

Alexey Shulzhenko
Alexey Shulzhenko

Written by Alexey Shulzhenko

Data Analyst, Geek, and runner. What will do next?

Responses (1)