Can the markets be cracked? “Probably not,” said my Dad a million times – last summer, I tried it anyway. I wrote a computer program to download and organize financial data, and test various trading strategies.
Beginning with a generalized trading strategy, the program would generate thousands of variations and historically back-test each one. The best-performing algorithms and their results were stored. The results were promising: my program found trading algorithms which outperformed the S&P 500 Index for the past 30 years running.
Here’s an example of the functionality. Begin with a simple trading structure: e.g. if a stock goes down by x percent in the past y days, then buy it and hold for z days (actual algorithms were more complicated, and had about ten parameters). Wind the clock back 30 years, throw in the 500 stocks of the S&P, and iterate through time, swapping portfolio allocation like lightning according to the pattern of choice — and rinse and repeat for every permutation of our parameter set we could desire. Each 30-year iteration took about a second. I used to let it run overnight.
So am I rich yet? The markets are more chaotic than I ever realized. Picture the above-described optimization procedure over a 30-year window: I receive perfect results, my computer feels rich, and all is well. Let’s try again over the past 10 years: even more virtual money is piled up; the parameter set this time, however, is entirely different. Optimize over 5 years: another parameter set. No successful strategy, it turns out, remains successful over a different time window; each time window, it turns out, delivers a separate trading strategy. The markets are pure chaos.
Four separate result-algorithms – each tracked after the fact in my personal “horserace” – all took a nosedive as the optimization window ended. Four algorithms ran in close competition for years, until Jan. 1, 2012 – then they began to lose money.
Is all hope lost? Probably – but I “learned something”, as they say. Firstly, the markets are chaotic and most attempts at “technical analysis” (i.e., anticipating stock movements from nothing other than the shape of the price curve itself) are dubious at best. Secondly, supplementing my pure price data with actual accounting data (earnings, income, etc.) might be a promising next step with some scientific backbone. Finally: computational power is excellently put to work in financial economics. Maybe, some day, the markets will be cracked.