How to make a Crypto trading bot?

How to make a Crypto trading bot?

By Maretti0x | MarettiCrypto | 14 Dec 2021


Introduction

In this article, I'm going over everything you need to know on how to make a Crypto trading bot yourself. Be aware that I won't explain exactly how you can code everything but rather a broader explanation of everything you will need and have to consider when making a trading bot yourself.

Prerequisites

Things you should know before starting to program the bot:

  • Fundamental programming concepts

  • API calls

Coding language

I recommend going for Python. You can easily handle API calls using Requests

Things you will need

I'll go over all the things you need and have to consider to get the bot up and running.

Get the bot live

If you program the bot in Python you need to get the code running 24/7 you can do this with a Raspberry pi. I used Cronjobs to run the Python script of the bot every 30 seconds. A recommendation is to also setup upswift.io on your pi if you want to be able to connect to it remotely over the internet.

I put a Debian without a gui on the pi and just used the command line to get the raspberry pi setup. The pi will need an internet connection to get the bot working.

https://images.unsplash.com/photo-1610812387871-806d3db9f5aa?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb

API's

When programming the bot you need APIs to get market data and send orders to the exchange you are using. I used the Crypto.com API for my bot but other exchanges have APIs you can use as well. The most important thing is that the API supports sending buy and sell orders.

To get market data is used TAAPI.IO they offer technical indicator data from different Cryptocurrencies. You can ask for Moving averages or some chart patterns to integrate in your bot.

A Strategy

The most important thing a trading bot needs is a strategy. For my bot I used a strategy based on moving averages and the RSI indicator. You can choose freely what you want, You can pick a strategy you saw on YouTube or something you use yourself when trading. Just make sure it is achievable to actually code.

If you want to backtest a strategy I recommend coding it in pinescript first and test it on Trading View to see how it performs.

https://images.unsplash.com/photo-1621264437251-59d700cfb327?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb

Telegram

You can use the telegram-send library to send messages to your phone to see what the bot is doing. I used it to send error messages to me when the bot runs into an error and send a message when it opens and closes a trade.

Issue's you can run into

It is possible for the Raspberry pi to overheat when it is running 24/7 when you get issues with this it is recommended to buy a usb ventilator for the pi.

Invalid Nonce error while using the exchange API. This is caused due to a time difference in your pi you can fix this by resyncing with the NTP servers.

Closing off

Thank you for reading this article. I hope you got a better idea on how to get started with developing a trading bot. If you would like a more in depth article on how to do this please let me know.

How do you rate this article?

6


Maretti0x
Maretti0x

Hello, I am Maretti. A 20-year-old Cybersecurity student Living in Belgium. I write articles about Crypto.


MarettiCrypto
MarettiCrypto

News posts and price predictions of cryptocurrency’s View my substack -> https://maretticrypto.substack.com/

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.