Rnd Entry or Rnd Exit - Different Sides of the Same Coin

Discussions about the testing and simulation of mechanical trading systems using historical data and other methods. Trading Blox Customers should post Trading Blox specific questions in the Customer Support forum.
Post Reply
svquant
Roundtable Knight
Roundtable Knight
Posts: 126
Joined: Mon Nov 07, 2005 3:39 am
Location: Silicon Valley, CA
Contact:

Rnd Entry or Rnd Exit - Different Sides of the Same Coin

Post by svquant » Mon Mar 26, 2007 9:42 pm

The posts regarding random entries or random exits and their effectiveness got me thinking that perhaps we are just testing the same hypothesis two different ways. This hypothesis is that "trend following works" on average

Sluggo went about looking at the oft quoted saying that entries don't matter it is the exit and trying to see if that was true. Based on his work and posted code one can see that entries do matter too. In fact we have both cases working well:

Case 1: random entry, good exit
Case 2: good entry, random exit

As I said this got me thinking and one part I noticed is that the entries are trend following in Sluggo's work and the exits in previously published work are trend following too, eg let profits run if we randomly pick the right direction and cut losses if we do not. Thus, I think we are just testing if trend following either implemented by entries or exits work.

To test this I modified the random-entry random-exit blox/system that Sluggo provided and created my own portfolio manager blox that basically filters instruments by a set of moving averages (code attached). Some may think this is the same as the 2MA system entry of Sluggo - but I think not. I still keep a random delay on the entry and of course random number of bars before the exit. In examining some trades this leads to some really bad trades, eg entries the day before a cross over to the opposite direction would occur and then watching a market move 20 days in a row opposite your position :shock: You can say between this delay and the short holding period this is a sub-optimal trend follower that just cuts out random sections of the trend move.

Now I have not mastered the image capture etc like Sluggo so you'll have to read more text. I ran a 10 commodity portfolio (includes S&P and BP which are not trend friendly), 50 test runs, $100 slip/comm for 10 years of data etc. The trade direction filter I used in the portfolio manager was a 1/200 moving average. Nothing too magical at all.

The results:
  • 10 yr avg CARG ~3.2%
    42 out of 50 runs profitable
    Max CAGR 10.5%
    Min CAGR -2.2%
Not as good as some of the other runs done by people but I think it demonstrates my point. Perhaps this is similar to Nickmar's results? You can play with your favorite 10 commodities or parameters as you see fit.

Be interested in hearing other people's thoughts on my opinion that we are all just testing trend following and not per-say any true entry or exit criterion. Or at best we are testing a joint hypothesis.

Enjoy,
Marc

Thanks to all that contributed code and ideas that this post was build off of!
Attachments
Just Trend Portfolio Manager.tbx
Portfolio manager for performing trend based filtering.
(3.63 KiB) Downloaded 595 times

sluggo
Roundtable Knight
Roundtable Knight
Posts: 2986
Joined: Fri Jun 11, 2004 2:50 pm

Post by sluggo » Tue Mar 27, 2007 8:29 am

svquant, I agree with your assessment. I think test1 (random entry, trendfollowing exit) and test2 (trendfollowing entry, random exit) do in fact explore two complementary pieces of the same big picture hypothesis: Trendfollowing has a systematic advantage, an "edge", which generates statistically significant positive profits after commissions and slippage. Unfortunately, Van Tharp's book doesn't discuss test2; it only talks about test1. I think this is the reason he and many of his worshipful followers have failed to see the big picture. So they focus, focus, focus upon exits.

Here's what Tharp's book says:
Tom was explaining that he felt the most important parts of his system were his exits and his position-sizing algorithms. As a result, one member of the audience remarked, "From what you are saying, it sounds like you could make money consistently with a random entry as long as you have good exits and size your positions intelligently." Tom responded that he probably could. (... and test results showed that he was right ...)
And I recommend he add these two new paragraphs to the next edition of the same book:
Sluggo explained that the most important parts of his system were his entries and his position-sizing algorithm. As a result, one member of the audience remarked, "From what you are saying, it sounds like you could make money consistently with a random exit as long as you have good entries and size your positions intelligently." Sluggo responded that he probably could. (... and test results showed that he was right ...)

Svquant explained that the most important facts about his system was that it followed trends, and used a sensible position-sizing algorithm. As a result, one member of the audience remarked, "From what you are saying, it sounds like you could make money consistently by trading randomly-chosen slices of your trendfollowing positions. After your trendfollower takes a position, enter some random number of bars later in the same direction (i.e. trade with the trend), remain in the position for a random number of bars, and then exit. Svquant responded that he probably could. (... and test results showed that he was right ...)

Forum Mgmnt
Roundtable Knight
Roundtable Knight
Posts: 1842
Joined: Tue Apr 15, 2003 11:02 am
Contact:

Post by Forum Mgmnt » Tue Mar 27, 2007 8:47 am

The recent series of conversations are very interesting as they hit upon what I consider to be one of the major breakthroughs in thinking about trading that I personally made a few years back. Namely that the big picture matters much more than the specifics.

Whether or not you traded using a 300-day moving average or a 287-day moving average may have made a lot of difference in your testing and it may mean a difference in your trading next year. But the fact that 287-days worked much better last year does not necessarily mean that 287-days will work better next year than 300-days will work next year. The margin of error for the testing process is very wide, too wide to make assessments of this sort.

The basic process of trend-following works but it works differently in the future than in the past. The past never repeats exactly like the future. This is why random entries and random exits work. There are no precise points where everything magically starts working and stops working. The process generally works and the edges are fuzzy -- double-entendre intended.

The best way to capture this consistently is, IMHO, using a fuzzy mixture of different systems that use the same general principles but with varying degrees of speed and sensitivity to volatility.

- Forum Mgmnt

Post Reply