Ever since the release of Flash Boys by Michael Lewis, the interest in algorithmic trading has gone up another notch. But there is good reason for this because algorithms really are taking over the world and taking over Wall Street in particular.
Most people talk of algorithmic trading and automatically think of HFT (High Frequency Trading), however, the two are not always the same and algorithmic trading can occur on much longer time frames if so desired.
How dominant is algorithmic trading?
One interesting fact about algorithmic trading and HFT especially is that not everyone is sure how prevalent it really is in today’s markets.
Some claim that only 50% of trading volume can be attributed to HFT, which would be 20% less than in 2009. Others claim the figure is closer to 75%.
But the really interesting fact is that while 50% – 75% of trading volume can be attributed to algorithmic trading, around 90-95% of all quotes on the market are from algorithms.
In other words, HFT orders are everywhere but those orders don’t always execute.
Why could this be?
The reason for this is that algorithms are constantly working out ways in which to profit from the markets. Some times the algorithms move in above or below the price in order to influence the direction of the market.
This is a game of speed where the quickest algorithm is able to jump in front of all the others and make the trade. If the algorithm gets in first it makes the trade and wins. If it doesn’t, it misses out and some other algo trade makes the profit.
The result of this is that algorithms constantly compete with each other on speed and the businesses in charge of setting the algos up invest heavily in getting lightning quick connections to the exchange, utilising underwater fibre optic cables and that kind of thing.
I recommend taking 20 minutes to watch the following TEDx talk on algorithmic trading. Sean Gourley is a New Zealander who has spent a lot of time figuring out how algorithmic trading works and claims that we don’t really understand many of the things that these algorithms do.
Most interesting in this is Gourley’s discussion of augmented intelligence.
Sean talks about a chess tournament a few years ago where some of the most powerful computers in the world were pitted against some of the best human players.
While the computers were easily capable of beating the grand masters on their own, it was when humans teamed up with ordinary computers, that they were able to defeat the super computers consistently. Indeed, it seems that a reasonable group of players using an average desktop computer were able to defeat the super computers.
This gives rise to the notion that the future for us all is to work in conjunction with the machine in order to rise above the competition.
I suppose we knew this already. But this is more evidence to get creative with the process.
When designing a trading system there are a number of things traders need to be aware of if they want to avoid building a curve-fit system. Trading system selection bias is one of the most dangerous and seemingly misunderstood.
I spoke previously about the dangers of survivorship bias and the relevance of start date. I also spoke about the need to keep data out of sample and to keep the number of optimisable parameters as low as possible in order to avoid data mining. As well, I mentioned how the only true out of sample data is future data since we already have an awareness of what the market has done in the past.
Selection bias in trading systems
Recently, I have been reading David Hand’s Improbability Principle: Why coincidences, miracles, and rare events happen every day.
It’s a great book and reminded me of the problems of selection bias in trading systems.
Put simply, David’s book reminds us that improbable things happen all the time even though they have a statistically minute chance of transpiring.
In trading system development, this is a very real danger.
Optimising the system
Consider the process of testing and optimising a trading system. Using a computer and a trading platform it is possible to test hundreds and thousands of different combinations of settings.
Clearly, if you test enough different strategies you will eventually find one that gives huge returns and exhibits an equity curve to die for.
The problem is that this equity curve may only have come about by pure chance. The profit potential of the system is actually random, however, the inexperienced trader may believe that she has just stumbled across the ultimate winning trading system.
Eye-balling equity curves
Let’s say that you are in the business of trading systems and you’re looking for a system with low drawdowns, positive expectancy and a smooth equity curve.
If so, what do you think of the equity curve below?
Pretty nice chart I think you’ll agree.
But what if I told you that the curve was actually a result of 10,000 random coin tosses?
That’s right, random outcomes can generate beautiful looking equity curves. Just take a look at this coin toss generator and see for yourself all the types of outcomes that can result from randomness…
The problem is that an attractive equity curve can fool a trader into believing they have a profitable trading system that is not random. This is sometimes enhanced when the trader gets a positive equity curve in out-of-sample too, which may also have come about by pure chance!
Is your trading system random?
Knowing this information is extremely important but how can traders build trading systems that are not random?
Well the answer is not always simple and has a lot to do with statistics. But for starters we can make sure to employ some basic principles:
1) Make sure to base your trading system on theoretical principles before you begin to build it. Don’t search for profitable patterns within the data as you will be sure to find plenty of profitable patterns that are in fact random.
2) Always keep some data out-of-sample for cross-validation of the system. Once you have tested the system in-sample, test it just once on the out-of-sample data to see if it performs in a similar way.
Never go back to the in-sample data and adjust your system based on the out-of-sample results. This guarantees curve-fit results.
3) Keep the number of parameters as small as possible. Increasing the number of adjustable parameters increases the chance of data-ming exponentially. There are profitable trading systems out there that consist of just one adjustable parameter.
4) When optimising, don’t choose the best performing variable. Look for ranges of variables where the system performs well and pick something in the middle.
For example, if a system performs well on a 100 day breakout, it should also perform well on a 98 or 95 day breakout. Or a 102 and 110 day breakout. If it doesn’t perform with very similar variables then there’s a good chance the result is random.
Trading system selection bias: conclusions
In general then, it is important to realise that there are very few ‘edges’ available in the market that are exploitable for the average trader. Staying away from the dangers of curve-fitting is therefore a systems trader’s major concern. Trading systems should be simple and robustness should be preferred over outlandish returns.
I will be looking at some more ways to reduce the chance of curve-fitting in due course, just remember if something seems too good to be true, it almost always is.
Took a hit last week with a position in Intelliquent ($IQNT) which dropped 17% after a pessimistic revenue forecast. Fortunately, my other positions helped to soften the blow. I still think IQNT is a good buy, even more so now it has dropped. The company is in pretty good shape but it probably won’t head North for a while now.
Here’s some interesting material I found across the web this week:
Bill Ackman still not a Herbalife fan.
How has Herbalife kept the game going for so long?
Why you should sell 3D Systems and buy StrataSys.
How to lose 96% of your fortune and get fired from your own company. Dov Charney.
Mammoth list of finance sites and links.
That’s all for this week. Be lucky.
US stock markets moved higher on Friday as positive US earnings numbers overshadowed geopolitical concerns in Russia and the Middle East.
The S&P 500 had experienced its sharpest drop since April on Thursday but higher than expected revenue from Google – now the third largest company in the world by market cap – helped push stock markets to healthy gains.
This week promises to be one of the busiest for traders in terms of earnings releases with many US companies scheduled to report; including Microsoft, McDonald’s, Coca-Cola, Netflix, Caterpillar and Visa. While it is not easy to predict how individual stocks will react to their earnings figures, here are some trade ideas to look out for.
Mean reversion trade ideas:
Crown Crafts Inc ($CRWS)
Crown Crafts Inc is a leader in infant and toddler products and accessories and was founded in 1957.
Crown Crafts Inc is my stock market trading idea of the week since the stock is cheaply valued and in good financial condition with a PE of 12.47, PEG of 0.69 and current ratio of 3.70. Despite this, the stock is down 13% this quarter and now looks oversold with an RSI reading of 29. I can see the stock rebounding this week.
Zix Corporation ($ZIXI)
Zix Corp is a technology company that provides email encryption and email data loss prevention.
The stock is down 33% year to date and is oversold on a short term horizon with an daily RSI reading (14) of 29.48. This makes the stock ready for a short squeeze. The stock is now relatively cheap with a PEG of 0.84 and experienced a 20% increase in insider transactions last week.
Trend following trade ideas:
Lear Corp ($LEA)
Lear Corp is a manufacturer of assemblies for the automotive and aircraft industries since 1917. The company serves every major auto-maker in the world and reported a strong Q2 last week.
Lear has been a favourite for trend followers with its steady, consistent returns and last weeks earnings indicate there could be more good times ahead. Even though the stock has broken out to new 52 week highs, the stock is not expensive, with a PEG of 0.88 and trading at 10 times forward earnings.
Short sellers trade ideas:
Microsoft shares soared to new highs last week as CEO Satya Nadella announced 18,000 job cuts. The tech giant reports earnings on Tuesday but looking at the price chart shows the stock is overbought with an RSI reading of 80.10. Value wise, Microsoft is not cheap either with a PEG of 2.43.
This is not a guaranteed short, but Microsoft results do not beat expectations on Tuesday I expect to see a short term sell off.
I wrote on Thursday night that equity markets might not be too troubled by the events of Malaysian flight MH17. And that proved correct on Friday as US markets cruised higher with the Nasdaq gaining 1.57%.
I actually think equity traders should be more concerned over last week’s Fed comments suggesting the valuations of some small cap shares is stretched (particularly social media and biotech). For now, I’m not giving up on shares and will be watching earnings closely next week.
Until then, here are some interesting things I found across the web:
Dell has just become the biggest e-commerce business to accept bitcoin.
$300 million pump and dump stock scheme; 7 indicted.
Can Malaysia Airlines recover from this?
Does Rupert Murdoch bid spell the end for stocks?
How to code a Bollinger Band breakout in Amibroker.
More next week.