- July 18, 2021
- Posted by: Algovision
- Category: Auto-trading
How To: Backtest a Cryptocurrency Trading Strategy
Crypto trading bots have become a hot topic for millions of cryptocurrency users around the world. Looking for ways to automate their strategy and outperform the market. After dipping your toes into this fascinating market for the first time, you surely came across references to trading bots. To facilitate your voyage into cryptocurrency trading bots, the following comprehensive guide will act as your definitive resource for getting started.
By the time you’ve concluded this guide, you’ll not only better understand why trading bots are useful, but how to build your own trading bots, which trading bots currently lead the market, and what defining features to look for when picking a trading bot.
An Intro to Trading Bots
A cryptocurrency trading bot is a software program that automatically trades on exchanges. Instead of manually entering each trade into the exchange, the trading bot is able to access data from a users’ exchange account and automatically place trades. The process is managed through computers, which offers a level of speed and precision that isn’t possible with humans.
The strategies that these bots implement are capable of doing anything from trading to construct custom indexing strategies to advanced real-time arbitrage across exchanges. The possibilities are nearly endless. Each trading bot generally implements a trading strategy that relies on algorithms that were created by the application developer.
How Trading Bots Work
Cryptocurrency trading bots work by accessing data on the exchange for a user. Each user is able to provide access to their account to the trading bot by giving the bot their API public key and API private (AKA secret) key. These two pieces of information are used as a way to tell the exchange that a bot has authorization by you to access your exchange account information.
APIs are a way for applications or services outside the exchange to access the data or features inside the exchange. Through these APIs, trading bots can request the latest market data, place a trade for a user, or collect information on the amount of funds in a user’s account. Access to a user’s account is only granted when a user explicitly provides API keys to an application. At any time, access can be withdrawn by deleting the API keys on the exchange, providing a secure way to always maintain control over who or what can access your exchange account.
API Key Settings
API keys for trading bots usually have a variety of different settings. The two core settings required for trading bots is the ability to collect “Balance” data from your exchange account as well as the ability to “Trade”. Each exchange offers varying levels of control over these two parameters, but generally, all of the settings under these two categories should be enabled for the trading bot.
Please note that no trading bot generally requires access to “Withdraw” funds. If a trading bot requires this access, be very hesitant to place your trust in this trading bot. The result could be you losing all of your funds.
The Purpose of Trading Bots
The core purpose of trading bots is to automate actions that are either too complex, time-consuming, or difficult for humans to execute manually. The sophistication of these tasks ranges from automating a single trading strategy on a single trading pair to intelligently routing trades between any asset for a diverse portfolio. Without continuous effort, some bots can let users implement a complete portfolio management strategy, saving immense amounts of time. Instead of requiring you to be online constantly to manually place trades and adjust your portfolio, bots can take control to execute on your strategy day or night.
Quality trading bots can save you money by offering improvements over a manually implemented strategy. Bots are faster at collecting data, more precise when placing orders, and can crunch numbers faster than any human.
When to Use Trading Bots
The possibilities are endless when it comes to bots. There are bots for rebalancing, portfolio management, data collection, smart order routing, or anything in between. Whatever it is you want to do, there is likely a bot out there somewhere which does it.
Now, that doesn’t mean we should be using a specialized bot to accomplish every little task we want to do. In fact, that would surely end up being more work than just doing it ourselves. The goal is to find big tasks that consume the most amount of your time or are the most complex to implement yourself. Those tasks are ripe for the pickings when it comes to automating with trading bots. You can still manually perform the tasks that are infrequent or easy.
Before we start looking for a bot, think about the most cumbersome aspects of cryptocurrency trading for you. Consider each of the tasks you do throughout the day. Come up with a small list of the largest tasks which you wish could be automated, so you can spend less time with your cryptocurrency portfolio.
In order to help you think through tasks that can be automated with trading bots, the next sections will describe different ways that trading bots improve upon us, lowly humans. Consider each of these aspects to find the perfect tasks for automation.
Repetitive tasks suck. Doing the same thing over and over again just means you’re consuming more of your time with that task than necessary.
Imagine there was a real life way to copy paste work. Essentially, copy the work you just did and repeat it again the next time.
That’s basically what we’re doing with a trading bot. By doing the work one time by setting it up with the trading bot, you can then copy that work over and over again until the end of time. You would be right to be excited by that concept.
Bots don’t have a problem with the mundane repetition. In fact, that’s one of the first reasons software engineers will automate a task, in this case rebalancing. Create the bot once and automate your portfolio forever. No more repetitive tasks!
Trading is a game of precision. New traders may not mind the imprecision of moving into and out of positions on a whim, but as we gain experience, many traders begin to grasp the necessity for being precise. Every trade can have an impact, so carefully select trades. Bots don’t have the concept of being careful, but they are precise.
Let’s consider an example scenario. Say we want to sell DOGE when the price of Bitcoin reaches exactly $100,000. Doing this manually would require incredible skill and patience. Manually implementing this strategy would probably end up with us accidentally missing the mark and selling DOGE when Bitcoin hit $100,010. That’s not bad, but it wasn’t the strategy we wanted to implement. Our imprecision meant we didn’t end up following the plan.
Executing a precise strategy is simple for bots. The bot can easily monitor the market for this condition and execute the trade when the time is exactly right. Bots are precise, quick, and reliable for this sort of execution strategy.
Everyone has things to do – life is chaotic. We don’t have time to be at the computer every waking moment ensuring our portfolio is on track.
In one of the previous examples, we discussed portfolio rebalancing every hour. This is an example of something that could easily take 15 minutes or longer for each rebalance. If you have a diversified portfolio, it will take even longer. Not only would this be repetitive, but it would also be time-consuming. Countless trading strategies are cumbersome in this way.
Trading bots aren’t like you. They don’t have anything better to do. All they want to do is implement these time-consuming strategies for you. Since they run on computers, calculations happen in an instant, trades process in the blink of an eye, and they never get tired. Time-consuming tasks then get simplified to set it and forget it. Automating a time-consuming task can be done by configuring a few things in a trading bot and letting the trading bot implement the strategy for you.
The cryptocurrency market never sleeps. Not for a second. Exchanges don’t close down at night. Even when one exchange goes down for maintenance or updates, there are still hundreds online still humming along. This 24/7 market makes it impossible for you to always be able to monitor your portfolio. Eventually, you will need to sleep, and we all know assets have an affinity for dumping as soon as we look away. At least it feels that way.
Once you realize you can’t always be ready to take action, there are two options: deal with the consequences of not being around to handle every situation for your portfolio or automate your strategy with a trading bot. Most will take the option that allows them to sleep easy at night.
Now, that doesn’t mean our strategy needs to be the same around the clock. It might be that you have a portfolio strategy during the day and a different strategy at night which will act as a safety for your portfolio while you’re sleeping. Whatever your strategy, bots can help you automate that strategy so you can spend less time worrying about the “what ifs” while your laying in bed at night.
Trading is Complex
At the end of the day, even if the repetition, time commitment, and precision weren’t enough to drive us towards trading bots, there is still the factor of complexity. Some strategies would be physically impossible to implement for a human due to the sheer complexity.
Taking smart order routing as an example. The requirements for effectively routing trades through numerous trading pairs intelligently are countless. Starting from the top we have the need for monitoring every trading pair across the exchange in order to determine the optimal time, asset quantity, and price for a trade. Next, we need to factor in the time restrictions to complete the routing before the market conditions change. Then we need to actually execute the trades to fill this first stage of our order. Finally, rounding it off by starting from the top again because we were only able to move $100 in the last order and need to move $100,000 in total.
Cryptocurrency trading is an intricate skill set that is developed through continuous self-improvement, overcoming mistakes, and forging forward in the face of uncertainty. Even with experience under our belt, some strategies are still out of reach to even the most advanced traders if attempted manually.
Complex strategies need to be automated using trading bots. Without these bots, the strategy wouldn’t be possible. The lesson is to use trading bots to implement trading strategies that are too complex to execute manually.