Broadly speaking, there are 3 main types of risks in algorithmic trading: Research, Market and Operational risk.
Research risk relates to risk of inaccuracies during the testing phase.
Eg. Does the market inefficiency exist for a fundamental reason? Did you use proper testing methods? Is your data clean? Did you mistake correlation for causation? Is there error in your code?
Minimising Research Risk
- Understand what market inefficiency are you exactly exploiting.
- Make sure you have clean (enough) data.
- Use backtests to understand how your strategy works in different market conditions.
- Prevent Curve Fitting – don’t overfit variables to “maximise” tests returns. (See: 10 Ways to Minimise Curve Fitting)
- Run walk-forward optimisations.
Market risk involves risk related to your trading strategy.
Eg. Have you hedged away unwanted risk? Is your position sizing too large? What if a black swan event like World War 3 happens? When do you know the strategy has failed? Do you have enough margins?
Minimising Market Risk
- Know what risks you want and hedge everything else away as much as possible (i.e. in general, short something else if you are long, and vice versa).
- Try to avoid strategies with unpredictable and unmeasurable risks (aka uncertainty)
- Size your positions accordingly to the expected value of the trade.
- Make sure you have enough margins/funds for expected drawdowns.
- Backtest your strategies through extreme events (Dot-com bubble, 9/11 and 2008 Global Financial Crisis).
- Know when your strategy has failed by understanding the reason for your trade and by comparing your live performance to backtests.
- Alert yourself/a human and examine the situation if your algorithmic trading strategy or the market is behaving out of whack.
In addition to managing market risk, you need to look at operational risk.
Eg. System crashes, loss of internet connection, poor execution algorithm, high spreads and slippage, counter-party risk, broker insolvency and theft by hackers etc
Minimising Operational Risk
- Make sure you have an auto-restart capability to reboot your systems when a computer/server crash happens
- Run your strategies on reliable servers.
- Secure your code. Encrypt them.
- Minimise counterparty risks – know who is taking the other end of your trades.
- Use established exchanges and reliable brokers when possible.
- Make sure your API calls to exchanges/vendors are stable, timely and that the information transmitted are accurate.
AlgoTrading101 is a online algorithmic trading course with over 30,000 students from over 160 countries.