Sunday, October 7, 2007

Maximising performance part 2

To be a money master, you must first be a self-master - J.P Morgan

Thanks to an idea by rnr over at ASF, I decided to run some more simulations in my attempt to find a systematic method that will allow me to make gains similar to those at the higher end of the monte carlo range.

This time I ranked the stocks by their volatility (ATR(10)) and told TradeSim to give preference to the stocks with higher volatility. The results were less than flattering. Out of 50 runs, only 60% produced an annual return greater than the average from monte carlo. And only 4 (8%) produced gains which were significantly higher than average.

These results, unlike those produced by price ranking (see previous post), are inconclusive at best. In fact, if I were to run another 50 simulations, it could well be that the we could conclude that this method provides no edge over random selection.

Saturday, October 6, 2007

Maximising performance part 1

If I wanted to become a tramp, I would seek information and advice from the most successful tramp I could find. If I wanted to become a failure, I would seek advice from men who had never succeeded. If I wanted to succeed in all things, I would look around me for those who are succeeding and do as they have done - Joseph Marshall Wade

In a previous post, I mentioned how I had not yet quantified the benefit of picking lower priced stocks over those with a higher price. This post will address this issue.

From this week's candidates, after excluding 3 with my eye-ball filters, I have 16 left to choose from. From those 16, my capital would only be sufficient for 9 or 10. I had initially planned to trade the way TradeSim does by default (for single portfolio simulations), which is alphabetically. Then I thought it would be nice if I could test what benefit, if any, there is, by picking lower priced stocks.

In theory it makes sense that, say, a $3 stock, would get to $6 much quicker than you can see CSL (currently around $107) reach $220. But, being the trader I have now become, I don't go for hunches or opinions anymore, everything needs to be tested, validated, and quantified.

Using TradeSim, you can test this by using the SetVariableTradeRank function (see manual pg.115). I told TradeSim to rank the trades in the trade database by their closing prices. And then to give preference to lower priced securities. What I wanted to see is WHERE the results fell relative to the average profit values generated by the monte carlo analysis of the same system over the same timeframe.

So I ran 50 single simulations, and the results were conclusive. Of the annual returns from these single simulations, 49 (98%) were greater than the average return of the monte carlo. Also, 19 of the simulations (38%), gave returns that were significantly higher than the average return. Significantly higher was defined as an increase of more than 5%p.a. in annualised returns.

The above simulations were done on the 6-year period from 01-01-1998 until 31-12-2003. I also did some tests on the previously out-of-sample period which was used for the walk forward analysis. From 50 simulations using the ranking function to give preference to lower priced securities, 39 (78%) produced annual returns greater than the average from monte carlo analysis, and 23 (46%) produced gains that were significantly higher than the average return.

So clearly, there is a benefit in choosing lower priced securities, and the bang for buck theory has been verified and quantified for my system.

Now I have a very easy method of choosing stocks. Go for the lower priced share. Though I should clarify that rightly or wrongly I will still do my eyeball filters first! I just can't buy a share with a disgusting chart!

Next week's purchases will be, in order of preference, LRF, REX, SSX, STS, MIN, CSM, COA, PWK, IWL, BKN.

BKN may have to miss out. I'll see how I go with the position sizing. It looks to be either 9 or 10.

**EDIT: It has been brought to my attention that SSX has in fact been delisted (has merged with OneSteel). So the question must be asked, why was it still picked up by the scan? Because the last time it did trade, it did give a valid entry signal. The most recent data loaded for this stock was 3rd August 2007. So, i must keep in mind for the future to check the date the stock last traded. So BKN will be surely included now. Next in line would be JBH.**

Friday, October 5, 2007

Next weeks candidates




I did what will soon be my routine weekly scan and came up with 19 candidates to buy next week.


BKN, CPB, COA, CSM, HPX, IWL, JBH, LEI, LRF, LIP, MIN, PWK, REX, STO, STS, SSX, UGL, VGH, WPL.


My capital will run out at about 12 or 13 stocks.


TradeSim trades in alphabetical order so I will follow TradeSim in this sense except I will add a few more conditions:


*The stock must be in a clear uptrend. As you can see from the chart above, VGH is not in a clear uptrend and the chart is rather messy.


*The stock must not be trading in a tight range. HPX and LIP fall into this category. To be honest, I do not even know how LIP got past the volume filter. As for HPX, it had very large volume this week but still could not make a higher high. That tells me there's alot of sellers soaking up the volume and the buyers didn't need to chase.


So that narrows our list down to 16 stocks. A few will still miss out. I will update next week with what stocks I do decide to buy and at what prices.

Thursday, October 4, 2007

The ad that started the Turtle Legend

Trend Following

Don't think about what the market's going to do; you have absolutely no control over that. Think about what you're going to do if it gets there - William Eckhardt


I searched "trend following" on google the other day and one of the responses was from Wikipedia:


In finance, trend following is an investment strategy that tries to take advantage of long-term moves that seem to play out in various markets. ... Traders who subscribe to a trend following strategy do not aim to forecast or predict markets or price levels; they simply jump on the trend and ride it.


The last sentence is one of the main factors which drew me towards trend following, and mechanical systems trading in general. Prediction does not play a role. You do not have to know what is going to happen next in order to be profitable.


Prediction, or forecasting, is something that is subjective, or opinion-based. With trend following (or system development of any style) everything we do, every rule, every parameter, its not subjective or opinion based, but rather, its evidence based. If it can't be tested then you don't trade it.


The other day, just for practice, I ran a scan of the ASX using my entry criteria and I got about 20 signals! Due to the limited capital available, I can only afford maybe 12 or 13, so I decided to (hypothetically) buy the lower priced shares. Then i thought, hold on, i didn't factor a price filter into my entry filter during backtesting, so I have no reason to believe that lower priced shares will provide better gains. Hold on, let me rephrase that, while I actually do have reason to believe that lower priced shares provide better gains (through Nick Radge's "Bang for Buck" study), the benefit of employing this strategy for my system has not yet been quantified.


Regardless of which method I choose to pick the stocks to buy (out of those that gave entry signals), it shouldn't matter too much, and discretion can be applied here. This is the reason we do monte carlo analysis. Whether I study the charts or flip a coin, no matter how I choose, allowing for a margin of error (10-20%), the results should still fall within the minimum and maximum amounts returned from the monte carlo analysis of the out-of-sample data. Backtesting is not an exact science, but its the best tool we have. And applied correctly, it can give us a good idea of how a system is expected to perform.

Michael Covel has done some great work on trend following. In addition to his first excellent book, he has a second book coming out soon titled: "The complete turtle trader". Michael Covel also did a presentation about the turtles and trend following at a conference in Tokyo earlier this year. The videos can be found on YouTube. Well worth a watch.

Wednesday, October 3, 2007

Riding those big winners




95 percent of profits come from only 5 percent of the trades - Richard Dennis.


Once your onto a winner, its important to ride the trend for as long and as hard as you can. This holds true for all methods but even more so for those that lose more often than they win.


Ideally, you don't want to get out at small pullbacks, but rather when there is a change of trend. Of course, with testing we try and go for what works over a statistically significant number of trades over a long time. Then we know what parameters we use to trade. There will be exceptions that hit your stop then go to the moon but you just have to let these go. They'll probably trigger another entry anyway.


ATR exits I have found work very well on weekly charts, the multiplier I am using in my testing and in the above chart is 2*ATR(10). See how quickly it follows the price action and only moves in one direction -- North. The exit trigger is when the CLOSE is at or below the ATR trailing exit. Here the common exit for all pyramided positions was taken at $45.00, the bar after the exit was triggered.


I've got a new book. Leon Wilson's breakthrough trading. I've only read the first few chapters but I like it how the code is in MS/TradeSim language. I think the first chapter is a very good introduction to systems development.

Monday, October 1, 2007

Rigorous testing methods

Its important to thoroughly and rigorously test and really put the system through its paces during the testing phase. This is the only way you can have enough confidence in the system to stick with it through those inevitable periods of drawdown. And thorough testing and examining each trade, helps you understand what makes the system profitable. As Nick Radge always says, its important to understand WHY your system works.

A great trader once told me: "Try to make your system fail".

I didn't go into this in much detail beforehand, so will do now.

When I said my system was initially back tested in the 1998-2003 six year period, and optimised on this period, the testing did not stop there.

I also run the test through different 2-year blocks and even single year tests, though single year tests do not give an accurate representation of the profitability of long term weekly systems such as this one, as the big winners often run for much more than 1 year.

The testing through 1 and 2-year blocks was an attempt to try and address start and end date biases. You don't want 6 years to look good because of one or two great years.

All my testing always includes delisted securities. I never test on the current All Ordinaries or ASX300 Indices. Quite pointless, it will give you great results, but not realistic results, which is what we are after. What I was after when I started testing was dynamic indices, with historical index constituents. Now that would be handy. We include delisted securities to overcome survivorship biases. For example, if we test using the current ASX100, which includes ZFX, we would've bought ZFX a few years ago at $2. But ZFX actually wasn't included in the ASX100 in 2005, so we wouldn't have picked it up during actual trading as its not in our universe. Stocks that are listed today can easily become delisted. In fact, my system performs better with delisted securities than without. This test was only done for my own personal interest. Shows that those dogs were once champions. The trailing stop/exit is what saves you.

The system was tested through a period I'd like to call THE WORST. Its the closest we've ever come to a bearmarket in the last 15 years on the ASX. From 01-07-2001 until 01-03-2003, is as bad as its been for sometime. XAO lost 18% during this time (21 months), its pretty much peak to trough. My system was put through 20,000 simulations. More than 82% were profitable. The average portfolio gained 8%. Not bad.

During 2001, there were 2 price shocks. First the dot.com crash and then 9/11. So a very volatile year. Market actually gained 6.98% though. For my system, more than 99% of the portfolios were profitable, with the average portfolio gaining 16%.

During 2002, the market lost about 10%. Solid downtrend. 99.97% of my 20,000 portfolios were profitable. The average portfolio gaining more than 12%.

I also test the system using worst case slippage. I always buy the high of the week and sell on the low of the week. Profitability declines by about 40%.

Another thing I like to do is remove the best 3 and worse 3 trades from the TradeSim trade database. Hardly any difference in the results. I don't want one or two champion stocks to be responsible for me making money. The largest winner contributes about 10% of the overall profit of the system over the 6 year test. I'm happy with that. You don't want 20%+ coming from just one stock.