Tuesday, October 16, 2007

Don't be fooled by randomness

All great traders are seekers of truth - Michael Steinhardt

The whole purpose of systems development is to find a method of trading that gives us an edge. An edge in terms of trading can be defined as probability of making profit which is greater than random chance.

If our probability of being profitable is the same as random chance, then any gains we make can be attributed to luck. That said, luck is also an important and often underrated factor when it comes to trading. We can see this from the difference in the results between the minimum and maximum of thousands of monte carlo simulations. This is why we should aim to design systems with enough rigidity so that the distribution of results is nice and tight. But this is another topic.

Here is nice definition of an edge: "If you make only bets on which you have an edge, you will win and you will lose but in the long haul your winnings will overwhelm your losses."

A good way to test a system is to compare it to another system which is based on randomness. ASX.G has done significant work on this. I ran one test but it was enough to confirm the work he had done. An random system with 10% chance of entering on any bar and 20% of exiting on any bar returns about 1%p.a. greater than the market, on average. The luckiest bastard made many thousands of percent.

In addition to this, I did a bit of testing to attempt to see whether the edge in my system was in the exit or the entry. And from my work, I can say that entries are very underrated.

The testing period was from 01-01-1998 to 31-12-2003.

The market as a whole underperformed it's long term average significantly during this time, with a compounded annual return (CAR) of only 3.82%p.a.

My whole system returned 38.90%p.a.

My system with my entry and random exit: 28.00%p.a.

My system with my exit and random entry: 7.74%p.a.

Random entry/exit was defined as a 10% chance of entering/exiting on any given bar.

My system with my entry and random exit: 15.95%p.a.

Random exit here was defined as a 5% chance of exiting on any given bar in an attempt to extend holding time to that similar to the original system which is 20 bars. It looks like the trailing stop becomes increasingly important in this instance.

But still, it seems most of the edge lies in the entry.

6 comments:

buggalug said...

Hi Again Nizar,

Amazingly enough, my system returned similar over the same period.

I've tried the same thing with entry/exits. One thing though is that my system had an average hold of around 85 bars. So for a similar comparison shouldn't your chance of exiting on any bar be closer to 1 or 1.5%?

buggalug said...

Oops thats 85 days, so 17 weeks, so around 5 or 6%.

Nizar said...

Hi buggalug.

Yes you are correct.
My system has an average hold of around 140 days.
Which is 20 bars??
I think 1 bar = 7 days??

I have run it again using ExitTrigger:=ExtFml( "TradeSim.Rand")<0.05.

Nizar.

buggalug said...

Good questions, I'm using Amibroker so it might be a bit different to yours. I assumed it was just using the base data which in my case is daily, so usually 5 bars per week. I'll have to look that up.

For reference my average hold is 85 bars, 140 for winners and 23 for losers.

Nizar said...

I just found out, for TradeSim, 140 days = 20 weekly bars or 100 daily bars.

Average hold for me for comparison purposes is 140 days, for a winner 220 days and a loser 57 days.

200 days is only about 31 bars (or 155 daily bars). Can you double check that you really hold winners for 140 bars on average?? That's 2 years+ Or do you mean days? or daily bars?

In either case, since you hold winners far longer than losers, I would expect your system has a very high profit factor. Much higher than mine which is about 4.3.

Nizar.

buggalug said...

Looks like amibroker is the actual bars, so all my hold periods are pretty close to yours. Profit factor is 3.9 over the period your testing here, 4.5 from 1998 to now.