Monday, April 21, 2008

Even a monkey could write a great novel

I have been reading Fooled by Randomness by Nassim Nicholas Taleb. It’s a challenging read, but worth the effort by anyone that is into system design. I haven’t finished it yet.

To quote p.163;
“Beset with insomnia, the computerized day traders become night testers plowing the data for some of its properties. By dint of throwing monkeys on typewriters, without specifying what book they want their monkey to write, they hit upon hypothetical gold somewhere. Many of them blindly believe in it.”

The reference to “monkeys on typewriters” relates to the theory that if enough monkeys are put in front of typewriters eventually one of them will write War and Peace. I strongly suspect that the number of monkeys required would be impossible to find, let alone feed!

Any results need a good dose of scepticism – even a monkey can write a great novel!?

Trading is not just about making the maximum profit. “The greater the profit the greater the chance of going broke. “ (stevo 2008). Well maybe – I am not really into hard and fast rules. If I try for 100% plus returns using leverage then I might make it 3 out of 4 years, but the 4th year will wipe me out. If I plug for 20% I am less likely to self destruct.

Then there is the ride taken. I did some work on a fairly simple system. The equity curves are shown below. The system was developed using data from 1999 to 2003 so the walk forward equity curve looks pretty good.

Figure 1 Basic System

The first curve is the basic system from 1999 to March 2008. It looks pretty good considering I am not pyramiding profits into the system, just trading with a flat amount. The second equity curve has an index filter added to turn the buy signals off if the market looks weak. The equity curve is still pretty good, but total profits are down compared to the system without the index filter.

Figure 2 With index filter

But when I look at the period from Jan 2007 to current a different picture is painted. Without the index filter the equity curve is south of the zero line for most of the period, whilst the index filter version looks much more tradeable. . I always remember starting up a system back in 2002 and immediately losing money. Startup is always hard! Starting this system up at the beginning of 2007 would have been tough.

Figure 3 Basic system from 2007


Figure 4 With index filter from 2007. Note that a lot of the money was made in just a couple of trades, but at least it wasn’t given back as in the basic system.

Over the last 5 years from 2003 to 2008 turning off a system when the occasional market dip occurred didn’t really help make money. It was better to be in the market all the time.

But it’s not only about CAR (compound annual return) it’s about the ride taken. Measuring the ride can be difficult, but the equity “curve” paints a picture that most people can understand

stevo

6 comments:

Nizar said...

Hi Stevo,

Iv been reading the same book!

Alot of irrelevance -- but it really is a great read.

The sequel (Black swan) is even better.

Nizar.

stevo said...

I didn't know there was a sequel.

With regards to in and out of sample testing. I in-sample tested up to 2003. The out-of-sample test was from 2003 to current. These periods were quite different. Since the system is long only running an out of sample test in the strong market conditions that we experienced may not have been a very good test. That's why I zoomed in on various parts of the equity curve and different starting positions.

It might have been useful to develop the system from 2003 to 2008 and then out-of-sample tested 1999 to 2003.

stevo

Cameron said...

If you are saying that an index filter is likely to adversely affect CAGR over the longer term...then I agree. This is what I found. If one is prepared to expose an LTTF to the elements with filters like only buying when a certain index is in gear, then over the longer term you can get superior CAGRs. The problem is that such a system is far more sensitive to issues of start-date bias.

Altough, when compounded the superior CAGR when not using a filter can stack up to a significant difference in dollars, particularly as you get further down the track. I think that this could lure some budding system traders/designers who think that 20% p.a is the slow-path.

As you say, the ride (for some) is all important. This is why I liked your idea of testing the system in blocks of a few months, stepping forward a month at a time to simulate startup at different intervals. Was this your suggestion? Anyhow, I did it and found that this is where an index filter, or some other filter that stops the system loading up too rapidly, was of benefit.

"It might have been useful to develop the system from 2003 to 2008 and then out-of-sample tested 1999 to 2003."

I actually did system development this way. Then Howard Bandy came along and said that you can't out-of-sample test with data from the past. I don't agree with this though. Not as it applies to LTTFs. I think an LTTF can be somewhat un-optimised, and on the flipside robust, and therefore be designed to tackle any kind of market conditions. For me the key factor is the market conditions, not when they occured. Not being able to test using 99-03 because you developed using data from 03 to 08 is just denying yourself the benefit of testing on dissimilar market conditions IMO.

ASX.G

Cameron said...

"If one is prepared to expose an LTTF to the elements with filters like only buying when a certain index is in gear, then over the longer term you can get superior CAGRs."

Actually, that was meant to say:

If one is prepared to expose an LTTF to the elements WITHOUT filters like only buying when a certain index is in gear, then over the longer term you can get superior CAGRs.

stevo said...

ASX G
Maybe an approach is to use a more conservative approach on startup - to use trainer wheels if possible. Things like taking trades only when the market, or market segment, is heading in the right direction, or maybe even reading about the company and (am I really saying this!) looking at the fundamentals.

Once the system is up and running nicely it is then possible to be a little more aggressive by taking off the trainer wheels and giving the system a bit more risk.

stevo

Nizar said...

Hi guys,

Another conservative startup is to trade the system at the lowest possible (or lower then full) position sizing or capital allocation. Then, after seeing the system work in real time, you could go "all in".

Nizar.