- Monitor thousands of financial instruments simultaneously
- Trade consistently
Putting aside the requirement of humans taking breaks, and only being able to absorb so much data at once, I think that the second point is considerably more significant here. Performing consistently means performing consistently against a set of rules. The rules are defined as an algorithm based on a strategy, and this is the crux of the matter: you begin to trade consistently against a strategy that has an advantage rather than 'a feeling' - or worse a tweet from influencers - naming no names...
Algorithmic Trading Platform
The open-source Freqtrade project, which is crypto-currency algorithmic trading software developed in Python was perfect for my needs. The software provides a platform with numerous useful features, including:
- Ability to retrieve datasets from cryptocurrency exchanges (on any symbol pair or time-range supported by the exchange API)
- Develop strategies to optimise a strategy using machine learning on a historic dataset
- Run bots using the exchanges' APIs to trade
- Remote control for trading bots using Telegram to trigger hooks
If you have experience writing Python, then Freqtrade is a very modular system which allows you to build out and test strategies. It uses the 'Pandas' library dataframe to provide per period data, and relies on the 'TA library' as the toolset to perform these statistical calculations.
How To Find A Profitable Strategy
Cryptocurrency is particular volatile as an asset class, and my advice would be to search for a 'market-neutral' trading strategy. The idea essentially is to nullify the risk of the market dropping by X% and the value of your capital dropping along with it. By 'going long' and 'going short' on related currency pairs at the same time, it is possible to trade against the relationship between two sets of currency pairs to work in this 'market-neutral' manner.
Since finding effective trading strategies can be astronomically valuable, most online discussion appears to remain relatively theoretical. To get out there and test for yourself, if you are using Freqtrade, you can follow a tutorial on configuring a 'hyperopt' strategy and testing against a real dataset on the currency pairs you want to trade against.
A critical aspect to training the algorithm to find optimal trading parameters is 'over optimisation'. If you find what would have been a perfect time to perform trades in the past, it is likely that you are not describing a general pattern that will occur again.
To know the validity of a given strategy and its relative trading performance its possible to use standard investment metrics. In this case, the Sharpe Ratio and Sortino Ratio are particularly useful. These ratios determine the risk-reward ratio of a given set of a trades, by taking into account the volatility of the performance. Large variance between trades that win and lose make it difficult to achieve consistent gains, which is the end goal!
Ready, Set, Go!
Once I had optimised parameters, 'backtested' to check my algorithm was performing how I expected, and run my bot in 'dry mode' where all trades are virtual, I put real money into my account and started to bot on my home computer.
I think my advice would be to put fear and greed to one side, and treat the capital with respect. It is really difficult to know how the algorithm will perform in a production environment, and this makes responding to the production trading data valuable.
By tracking the incoming trades on the linked Telegram chatbot it was possible to determine the following issues (in order of seriousness!):
- Bot couldn't place more trades because maximum number of trades were already active
- Bot couldn't buy when it wanted to because the buy criteria used the current currency value, but the buy/sell spread was too large - meaning the trade didn't take place
- Bot couldn't sell when it wanted to because the buy criteria used the current currency value, but the buy/sell spread was too large - meaning it got stuck holding currencies that were dropping very fast and may never recover!
- All bots unresponsive, 5 open trades on the exchange. This one was due to a power cut while out of the house, and promptly led to using a VPS hosted by Linode
Off the back of these issues, the three things I wish I had been told in advance would be:
- it is possible to tweak order book trade configuration to affect how likely each trade is to complete (in both buy and sell direction)
- using a strategy to determine when to increase or decrease the amount of capital an algorithm is trading with removes human emotion from the decision making process
- you think that the electricity grid is bombproof until you are set to lose money if it is unreliable - cloud servers were literally made to avoid reliability issues power cuts!
Does Algorithmic Trading Work?
In short, yes! I didn't heed my own advice, and I traded a non-market neutral strategy of 'mean regression'. Over a period of four weeks, the trading algorithm out-performed market growth by 20% against the top 100 symbols by volume on Binance.
The dataset that had been used to train the algorithm with was particularly good in a bull market, however things reversed quickly on a couple of days with heavy market contractions over night. Ensuring the dataset included a mix of growing and contracting market behaviour would have reduced the risks the algorithm would have taken, and I believe this would have improved its performance considerably over the full period.
The advantage of trading against many pairs of currencies 24 hours a day means there are a lot more opportunities to trade your strategy meaning that less risk can be taken on the trades that you take. On Binance specifically, if you hold BNB coin you can save 25% on per trade costs which makes a big difference when you are making many smaller trades.
I like to think of the exploratory part of algorithmic trading like geology. You are seeking a vein of gold, and are reviewing locations (strategies) that hold merit. It's only when you start to dig in the right sort of areas looking for the right sort of clues that you have to the opportunity to find the value financial intelligence that can be traded for profit.
Conclusion
It would be amiss I didn't state the golden rule here: only ever trade with money you can afford to lose!
There are many of aspects to effective algorithmic trading: mathematics, programming, systems administration, business processes. However these are all in the grasp of a computer science graduate these days. I think that algorithmic trading is heading for the masses, since the barrier to entry is becoming lower every day.
Your investments are your responsibility
I do not accept any liability for any loss or damage which is incurred from you acting or not acting as a result of reading any of our publications. You acknowledge that you use the information I provide at your own risk.
Also on LinkedIn
