Algorithmic Trading from an insider

I have been asked if I want to help shed light on how professional algorithmic trading is taking place, as well as comment on the doubtful industry in the area in the Danish corner of the internet, where amateurs throw themselves into algorithm trading with highly dubious strategies.

There is quite a lot to comment on, so hopefully I can return with more details in later articles.

My background in algorithmic trading

My own background is that I have worked with professional algorithmic trading in international hedge funds since 2003 after taking a master’s degree from, Economics, and Management).

Most of my career has taken place in London – with some years in Switzerland. I have been a Oxford University in the subject of Engineering, Economics, and Management (Engineering partner in a number of financial companies since 2005 and currently writing a couple of joint ventures in the field of algorithmic trading. I have traded stocks, bonds, forex, and commodities, both with and without derivatives (options and futures) for very large amounts for international customers.

When amateurs play with algorithmic trading

We can begin the story with window-washer Heine Andersen’s algorithm, who has lost a million kroners on the recent flash crash in GBPUSD, ie the value of the pound measured in US dollars. This is the cross termed “cable” in the foreign exchange market, because in due course it was through the first transatlantic cable. Since then, the market has become electronic and can be traded 24 hours a day, 5 days a week. However, the introduction of the machines has led to situations where the price can move very quickly in both directions, which also happened the other day. The explanation for it may be enough for a separate article later.

What happened to the algorithm? It certainly looks like investing in accordance with the Martingale principle. That’s where you increase your bet if you lose money.

For people who have not studied statistics, it could sound sensible; There is always an amount you can bet to win back the lost money again. The problem, however, is that you can quickly get up to sizes where you risk losing the entire capital.

Let’s take an example

Let’s say you have 30 kroner in your pocket. We bet on coin tosses, where you either win or lose the same amount every time you guess correctly. If we start to bet 1 kroner and lose, yes, you only win 2 kroners afterwards, so you get up to 31 kroners if you win first or lose first and then win the next time. And so on.

However, it is not very hard to see that if you lose four times, you are down to 30 – 1 – 2 – 4 – 8, ie 15 kroners. Then you’re down where you bet the rest of the store to get back at 30 – or you’re done.

But how likely is it to lose 5 coins in a row? It might sound like a good idea to do that, since 0.5 in the 5th potency is 0.003125. That’s just over 3%. But that’s the probability of 5 throws. You might have done it 100 times and so hope you never encountered a series of 5 wrong ones?

It’s a little more complex calculation, but luckily we have the internet (see source).

They find that in a series of 100 coins, you have more than 80% chance to run into a series of five losses in a row! If we do it 200 times, then it’s 96% probability.

It should be quite understandable that you can not make money simply by varying the effort. It may be that you earn a little bit at a time with an upward curve, but the longer you keep on, the greater the risk of zeroing. It is almost a universal law.

You need an edge in the market

What is absolutely fatal is that we lack something that traders call “edge”, that is, benefit. A coin toss where you have a 50% chance to guess correctly and win twice the money again is one where you have no advantage. On the other hand, there is no harm to it either. In the right market you have trading costs, so if you only trade random 50-50 trades, you lose money over time.

What could be an advantage then?

Yes, if you find a guy that will give you 2.5 times the money again, then you had an advantage. You only lose 1 penny half of the throws, and the other half earn one and a half crown, so every two throws you earn half a kroner on average.

It’s the kind of trades that algorithm seekers try to find.

When we are now about the size of trades, what do you do when you have found a beneficial trade? You can not bet all in, as you still have the likelihood of losing. There has been thought about it and the answer is that there is an optimal level of risk per bet. More about the Kelly Criterion and Risk Management another day.

And what do you do to find this kind of deal? As Jeremy Irons describes in this 3-minute video clip:

Cheating

I myself have worked with people who have cheated. If they’ve cheated me personally, I can not say, but I’ve had to work with people who have tinkered with LIBOR. So they exist and it worked for them, but that’s not quite interesting for this story, so let’s leave that part.

Be first

I am in an office at one of my joint venture partners where they never lose money. Frankly, I do not exaggerate. They have never had a day where they lost money. How does it work? Speed. They have written some software that is very fast. They have networks that have the straightest cabling between different buildings. Microwaves. They constantly have the fastest servers that can be purchased. If I were to describe that part of my work, it would be quite unknown to most people within investment. Here I am talking about cache coherence, kernel bypass, cut-through switching and other terms that have a lot more to do with technology than it has to do with finance in the common sense. There is not anyone in the office that can not program. Most of my day is also going to look at c ++ code, rather than looking at stories about companies.

And just that skill will also be useful to people who will try the other way.

Be smarter

Yes, if you do not have an infrastructure for millions, what do you then do? It must be said that most do not – even well-known companies – invest quite large sums.

Basically, you look for patterns. There are a lot of generic ideas in the area.

– Value investment

The basic idea is quite simple. Some companies are undervalued compared to what they should cost. And if you buy them, it’s better than a coin toss that you can earn money on them.

You can take the idea that some variables affect others in many directions. Do economic figures influence the stock market? Is the bond market tied with commodities?

– Momentum

A commodity like oil, for example, could keep going up after a period when it went up. You could come up with different thoughts about why it should be, but the idea is quite simple. If it is true that things keep moving in the same direction, one has to resort to empiricism. It could be quite the opposite, so things that had gone down in the recent period went up afterwards.
Common to all these ideas is that you have to collect a lot of data and analyse them.

It is also going to take a couple of articles to explain that.

This was my first article here on DaytraderLand. You are very welcome to ask questions below.

 

Charles Phan

Charles Phan works professionally with high-frequency tradingfor major hedge funds in the City of London and have been developing trading algorithms for more than 15 years.

Leave a Reply

Your email address will not be published. Required fields are marked *