Algorithmic Trading and Machine Learning for Crypto Traders
Algorithmic trading is a procedural method whereby a computer opens and closes trades based on a set of instructions. Simply put, it is the joining of a computer-based strategy with computer-based trade execution.
The goal is to eliminate you (the problematic human) from the process. Instead of staring at charts and sweating, you’ll just be able to sit back and count your cash. Sounds pretty good right?
But as you’ll see, the reality is algorithmic trading is a double-edged sword.
Ideally, algorithmic trading should result in faster, more accurate, and less emotional trades. Crypto-ML Trade History provides a good example of how systems can snowball your money particularly if the strategy focuses on minimizing losses (see The Surprising Cost of Trading Losses).
Let’s dive in.
Algorithmic Trading History
The infrastructure for algorithmic trading actually entered the scene in the 1970s and “program trading” began really building a foothold in the 1980s. Wikipedia provides an interesting read for history buffs.
Such trading has largely been for institutional players. But over recent years, the ability to run procedural trading has become increasingly accessible to individuals. More and more exchanges are embracing the concept and offering API connections to the average consumer
This is great news for the individual trader. We can now leverage advanced technology to improve our trading results.
While we will not be able to compete with institutions, we can play in different sandboxes. Institutions focus on high-frequency trading and other leading-edge approaches. Individuals can use algorithms to trade at slower timeframes quite effectively.
The “Algorithm” Behind Algorithmic Trading
As you might guess, algorithmic trading is only as good as the “set of instructions” telling it when to make trades. At its most basic, investors backtest particular technical indicator strategies and then allow the algorithm to run against those indicators.
This might be something as simple as generating a trigger when price crosses a moving average. More advanced strategies might look for arbitrage opportunities or temporary imbalances in order books.
However, markets evolve and change all the time, thus the effectiveness of algorithms tends to fade rather quickly. Algorithms are typically static and created to fit a specific set of historical data. As such, they likely won’t work perform as well as expected in live, dynamic market conditions.
Creating Your Own Algorithm
There are now countless tools available to create your own trading algorithms (see 9 Great Tools for Algo Trading on Hackernoon.com). While developing your own algorithm is becoming more accessible, a strong foundation in trading and statistics is highly recommended.
As you think about defining your algorithm, there are a deep set of questions to ask:
- What technical indicator(s) do I use?
- What values do I set for the indicators? Should I do a 200-day SMA, a 180-day EMA, or a 5.7836-day SMA?
- What historical data and timeframes are relevant for my testing?
- How am I sure my testing is valid and robust?
That’s just scratching the surface.
Our post How to Use Machine Learning to Trade Bitcoin and Crypto dives into these questions and other considerations in much more depth.
Managing Your Order Executions
Thus far, we have focused on the “algorithm” portion of the equation, but the other key consideration is the execution.
When your algorithm generates an alert, how will the message be passed to your exchange? Do you leave a program running on your home PC? What happens if Windows decides to update and restart your computer?
What happens if your API call fails and the order doesn’t execute? Do you retry or issue a warning message? What if price slips against you while your call stutters?
It’s important to have rock-solid systems both on the algorithm and the order execution side. It is indeed a challenge to architect an effective, reliable algorithmic trading system.
That said, the availability of web services (such as AWS and Azure) helps here considerably. With the right expertise, you can cheaply and effectively deploy web applications that manage order execution with exceptional reliability and speed.
Machine Learning for Algorithmic Trading
Apart from opening access to exchange APIs, there have been several other advancements in technology that greatly help individual traders:
- Web services
- Accessibility of machine learning technologies
- Large pools of data
As noted above, there are many questions to answer as you consider your trading strategy. The good news is we can take advantage of these advancements to help. Machine learning is a perfect tool to chug through massive amounts of data and permutations to truly identify a broad array of patterns and concepts that would otherwise be difficult or impossible for humans to derive.
This means machine learning can help answer questions such as:
- What are the best indicators for different situations?
- What is the best way to set indicator parameters?
- How should the indicators be mixed and weighted?
- What time frames should be considered?
- How should parameters and approaches change as conditions evolve?
By taking a machine learning approach, you can derive new mathematical approaches to interpreting data and generating trade signals.
Secondly, machine learning solves the problem of evolving markets. As new market patterns emerge, machine learning should be able to become smarter and more robust. The more situations it’s exposed to, the more situations it should be able to handle.
Whereas static algorithms get worse over time, machine-learning gets better.
Here’s a diagram of how Crypto-ML works:
Should Individuals Use Algorithmic Trading?
While we have discussed the pros of algorithmic trading, here are some considerations:
- There are still going to be standard trading risks involved.
- Past performance is not an indication of future performance. This is a standard disclaimer, but very valid.
- You should be a sophisticated trader with solid experience so that you can effectively evaluate a particular strategy and know if it suits you.
- You shouldn’t trade more money than you can lose.
- Trade executions may have faults or issues, particularly if your system isn’t highly available.
- Fees can quickly kill profits. If your algorithm has you trading too frequently, fees can be a real issue.
Ideally, you should seek to build trust with a system before adopting it. This may mean watching how the system performs in “live” conditions prior to putting real money in it. Oftentimes, you can do this with a paper trading account to ensure your numbers track well.
You may also consider using trade signals as one consideration in your larger trade strategy. Perhaps you don’t take all signals your algorithm generates, but instead, you consider the signals along with other factors and inputs. Effectively, the trade signals become just another tool in your arsenal.
Four Ways to Incorporate Algorithmic Trade Signals
Summing up the points above, here are four ways you can integrate algorithmic trading into your overall trading strategy with increasing levels of risk:
- Apply your algorithm to a paper account
- Add the trade signals into your overall strategy to confirm trade ideas
- Use a subset of your trading money in an algorithmic trading account, thereby automating a portion of your trades
- Use algorithmic trading to automate your entire trading account
Regardless of the strategy you use, ensure you closely monitor the account and can stop if should issues arise.
Create your own DIY machine learning model
If you want to go the more advanced route, creating your own machine learning model is actually not that challenging. You do not need to be a software engineer.
We provide a full guide: Bitcoin Price Prediction with DIY Machine Learning in Excel.
Algorithmic trading encompasses a fantastic set of technologies that is only getting better. However, it comes with considerable risk and is only as good as the system, maintenance, and people behind it.
What are your algo trading stories? Let us know in the Comments below or on the Community Forums.
Crypto-ML provides machine learning for crypto traders and investors. Gain crystal-clear signals and deep market insights. Add predictive capabilities to your toolbox. Learn more and join for free.