Sunday, October 28, 2007

Customised systems

Make a list of everything that can go wrong and determine how you will respond to that situation. That will be the key to your success - knowing how to respond to the unexpected - Van K. Tharp

One of the benefits of designing your own system -- as opposed to buying one -- is that you can include the features you want and exclude that which you do not. The system can be, and should be, customised to suit your personal preferences. This also helps you to stick to the plan in those inevitable periods of drawdown.

So from the word go, from when you begin the systems design process, you should already know what sort of system you want to design, and which features are more important to you than others.

If you like a smoother equity curve, then have a shorter holding period (higher stock turnover) for your positions. This can be accomplished by having a tighter trailing exit (probably at the expense of profits).

If you cannot handle long losing streaks, then a way around this is to design a system with an entry which will give you a higher win%.

I was looking at improving my win% yesterday by using different universes as I currently use the whole market. So I tried the all ordinaries, ASX100/200/300, small ordinaries, and dividend paying securities.

Testing was the first 3 quarters of this year, 01-01-2007 until 30-09-2007, in an attempt to minimise inclusion bias (indices couldn't have changed too much throughout the course of the year). Nevertheless, it's only for relative measure anyway.

Results were as follows:

All Ords (488 stocks)
#Trades: 32
MaxDD: 2.73%
Return: 17.83%
Win% = 59
R/R = 2.06

Small Ords (199)
#Trades: 26
MaxDD: 3.97
Return: 14.58%
Win% = 50
R/R = 2.60

ASX100
#Trades: 37
MaxDD: 17.33%
Return: -15.79%
Win% = 23
R/R = 0.63

ASX200
#Trades: 41
MaxDD: 9.87%
Return: 6.84%
Win% = 37
R/R = 2.58

ASX300
#Trades: 39
MaxDD: 3.39%
Return: 21.51%
Win% = 61
R/R = 2.30

Div paying (645)
#Trades: 37
MaxDD: 4.65%
Return: 23.13%
Win% = 54
R/R = 3.08

Whole market (1951)
#Trades: 43
MaxDD: 4.57%
Return: 23.75%
Win% = 63
R/R = 1.93

The best returns were from the whole market, dividend paying securities, and the ASX300.

So I did 1000 monte carlo runs of each of them with the results as follows:

The format for profit is max/average/min/std deviation/%of portfolios profitable.
And for maxDD max/average/min.

Whole market
Profit: 55/18/-7/9.68/97.8
MaxDD: 17/6/1
Dividend paying securities
Profit: 43/12/-11/8.78/93.5
MaxDD: 17/6/1
ASX300
Profit: 43/12/-14/10.34/88.9
MaxDD: 17/6/1

The last figure on the profit column is one I pay the most attention to. 100% would be ideal.

To give some sort of benchmark the XAO (All ordinaries) was up by 12.5% over this 9-month period.

So it seems from this test that we can't expect an improvement by trading an alternative universe, at least from the options tested.

I will be adding $20,000 of trading capital to the system this week just to make it compound quicker as we are approaching the month of November. November to April is traditionally a very strong period for equities.

From the weekend scan, the full list of possible candidates are as follows:
AQA, BEC, BLY, BKN, CPB, CEY, DWS, FLT, GMI, JBH, LEI, LGL, MSL, MIN, NCM, NOD, RCR, SMX, SDG, UGL, WTP, WOR, WTF.

I applied 3 filters. The chart has to be good. Clear uptrend and not in a trading range.
This narrowed it down to AQA, BEC, BLY, LGL, BKN, MIN, NOD, RCR, SMX.

Then I checked if any were under takeover. None were.
Then I picked the lower price securities or the ones I liked. LGL a gold play I just had to buy it.

MIN and BKN even if they didn't trigger, I could pyramid because i have reached 15% profit (that's what was backtested).

Since I could probably afford 3 more positions, I'm going with LGL, NOD, and BLY.

Here is a website I check to see Broker consensus. It's another filter I've added. I like to see a minimum rating of buy or strong buy.

Remember the system is robust and well tested so it doesn't matter HOW we pick the stocks from the candidates spat out by the scan. All the testing initially was done by picking random trades (monte carlo analysis).

Ranking by price and even pyramiding trades, only adds 1-2%p.a.

Friday, October 19, 2007

Portfolio Update 20/10/2007




Seek and you shall find

The single most important element to being successful in the markets is having a plan. First, a plan forces discipline, which is an essential ingredient to successful trading. Second, a plan gives you a benchmark against which you can measure your performance - Howard Seidler.

It really is amazing how much good information is out there on the internet. And the best part is that most of it is free. All we have to do is look for it. I feel I have learnt a great deal from online forums and other resources available over the internet. This post is simply a list of material that I have used and that others may find useful.

I have started numerous threads over at Aussie Stock Forums, including topics such as:

*System Robustness
*Drawdowns
*Would you trade this system?
*Outside the "Blueprint"
*Systems testing

And read the whole thread. Don't focus on what I write, but rather, on the responses, which are mostly from seasoned professionals.

This is an interview with author and hedge fund manager Robert Pardo. I think it's very good and I found it useful. He covers several important aspects of systems development.

Chuck LeBeau's presentation on exits is another resource I would highly recommend.

On Nick Radge's forum, there is so much knowledge you would not believe.

Tech/a has shared the discussion regarding the full design and development of his system and traded it live and answered questions for the last 5 years. Any question you have on systems development chances are somebody has asked it and it has been responded to. I would recommend reading the whole folder (about 50 threads).

Also, in the Trading Systems section, go to the very end, and read anything by Stevo and OPM and tech/a. A search may be helpful here.

And lastly, I just stumbled across another forum recently, called Elite traders. This thread by Acracy is pure gold. I would regard it as the next level of system development. He goes beyond entries, exits, and money management.

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.

Sunday, October 14, 2007

Speaking my language

Some people say, "I can't sell that stock because I'd be taking a loss." If the stock is below the price you paid for it, selling doesn't give you a loss; you already have it - William O'Neill.

It's nice to see somebody else speak your language. I was reading this week's BRW and there was an interview (pg.78-82) with a hedge fund manager named Karl Siegling. Below are some of the things he had to say about the way he trades. His fund's gross return is up 75.98% over the last 15 months (inception) and about 32% for the last 6 months for Australian shares.

"A falling share price is not a buying opportunity, but a clear warning from the market that something is wrong. Repeated new highs for a stock are not evidence of a missed opportunity or an overpriced company, but rather an invitation to buy more shares."

"I believe that there is no sense, no matter how compelling our fundamental belief may be, in buying into a stock as it is falling in value."

"I believe that the words "contrarian investor" are often used out of context, and that a contrarian strategy of constantly buying and adding to a falling position and constantly selling or shorting a rising market leads an inexperienced investor into making costly mistakes."

"The market can be irrational and sell down a stock for no reason - no reason based on the fundamentals of a business. But it's not for us to say when the market will stop being irrational."

"I will buy shares at, for example, $1, then $1.10, and then $1.12, but if I have just paid $1.12 for a stock then I will not pay $1.10 if the price falls a few days later. That's because I like buying shares that are going up."

So do I, Karl!

Based on these sounds principles, his strong performance comes as no surprise.

Saturday, October 13, 2007

Not an exact science

You've got to know when to hold 'em; know when to fold'em; know when to walk away; and know when to run - Kenny Rogers.

Backtesting is not an exact science, and has its limitations. At times, it can be said that the best computer is the the one between the ears.

One limitation that I only discovered recently was regarding company M&A. I realised yesterday that 2 out the 10 companies that I purchased this week were under takeover offers. So I was wondering how TradeSim handles these situations, because, I want to stick to the plan which was backtested with the least degree of deviation as possible; so I have the most chance of realising similar results.

Well TradeSim is only as good as the data that you feed to it; and data is simply 5 values for each bar. It cannot in any way account for company decisions. So when a company is delisted i.e. stops trading for any reason (merger with another company, script takeover, cash takeover, change of stock code, bankcruptcy), then TradeSim will close the position on the last bar it traded, the trade will be found in the TradeSim trade database as an open trade, and the price will be at the price it last traded (regardless of how long ago that was).

It will be marked as an open trade to differentiate from those trades that were closed out because they hit the protective stop or triggered a normal exit.

So it is upto me how to deal with these company M&A situations. I think at least for now, I will just leave the positions as they are, but will reassess the situation periodically.

I will not be updating the portfolio this week because all exits (as are entries) are delayed by one bar, I will have to check at the close of the next bar, which is next week, to see if any stops or exits were triggered. And I won't be running a scan (exploration) for any new candidates because all my capital is already in open trades anyway.

I notice there's some media articles regarding next week being the 20th anniversary of the 1987 crash. Some commentators say that this may well be a cause of market "jitters" next week. I guess that sort of news sells newpapers.

Thursday, October 11, 2007

Exits

Two of the cardinal sins of trading - giving losses too much rope and taking profits prematurely - are both attempts to make current positions more likely to succeed, to the severe detriment of long-term performance - William Eckhardt.

I can relate somewhat to what Eckhardt is saying in the above quote because I tried profit targets for my system sometime ago. They didn't work very well. What was initially supposed to increase win % in fact did not, but instead, reduced the size of average winners substantially. I was effectively cutting winners short.

My whole thinking behind it was because I don't like seeing winners becoming losses, as this (sometimes) happens in long-term trend following systems, that by definition give back alot of open profits. But clearly, the flip side of the coin of cutting winners short made the trade-off rather unfavourable.

Thinking about it now, the idea did not make sense at all, as I'm cutting (potentially) big winners in an attempt stop small losses. Losses are always small because of the my stop loss. Big winners, however, can often be the difference between a great system and an average one. If I were to remove the best 10 trades from the trade database, returns fall by almost 10%p.a.

What could work is a profit exit based on rate of change (ROC), designed for stocks that rise very rapidly. If a stock rises X% in a N number of bars, then the exit is taken. But more work had to be done here before I can make any conclusions.

Howard Bandy discusses exits in a section of his book. He mentions there are 5 types;

1. By the action of an indicator or recognition of a pattern, similar to what caused the entry.

a. The parameters can be the same as those that caused the entry, but in the other direction.

b. The parameters can be different for exit than for entry.

c. Some other indicator can be used.

2. By the price reaching a profit target.

3. By the time in the trade reaching a maximum holding period.

4. By the price falling back to the level of a trailing stop.

5. By the price falling back to the level of a maximum-loss stop.

He goes onto mention that the fifth type is the worst i.e. the maximum stop loss level. Those that have designed and traded mechanical systems would agree with this. During testing, we try and aim for the highest percent possible of trades exited in profit. Exits taken with a loss, and these are mostly those that hit the protective stop, should ideally be no more than 10-15% of the total exits.

Initial stops don't always help the system. For example, for my system, that I've just began trading live on this blog, I tried several but couldn't find an initial stop that improved the bottom line (doesn't mean there isn't one). I wanted an initial stop to calculate position sizing so ultimately I decided to place the initial stop at the trailing exit.

Maximum holding periods I must admit I haven't put enough research into this area to have an informed opinion but it just doesn't make sense to me. I believe the time in a stock should be determined by its trend. You want to spend the most time in the winners because profit increases as time in trade increases. At the same time, you want to spend as little time as you can in the losers, so you can take the loss and use the money for another trade (an opportunity cost issue). The problem is that you never know beforehand whether the trade will be a win or a loss, so it would be difficult (impossible?) to deduce the optimal holding time which would outperform other types of exits.

Wednesday, October 10, 2007

Randomly skipping some trades part 2

I had to learn discipline and money management. I decided that I was going to become very disciplined and businesslike about my trading - Paul Tudor Jones.

I didn't really explain the chart in my previous post as well as I should have.

The test was conducted over 9.5 years. In that time, there were about 2900 trades in the trade database. Those are all the possible trades picked by the system over that time.

Due to capital restraints and position sizing, I only traded between 400-500. I say and position sizing, because this is what keeps the number of trades down. Even if I started with 500k, if my fixed percent risk was 1.5%, I would still be taking about the same number of trades.

As you can see, I'm only taking about 15% of all the trades that are triggered anyway. So it doesn't matter how I pick them or even if ignore a vast majority of the trades, the results aren't affected significantly, as monte carlo runs have shown.

Randomly skipping some trades


Trading provides one of the last great frontiers of opportunity in our economy. It is one of the very few ways in which an individual can start with a relatively small bankroll and actually become a multimillionaire - Jack D. Schwager.


I was having a discussion with tech/a over at ASF the other day. He uses discretion (eyeballing the chart) to choose which candidates to buy from the stocks that have triggered. I thought that's fine -- until I found out that sometimes he doesn't trade at all because the candidates don't pass his filter.

Initially I was thinking that this was playing with fire because such a strategy cannot be backtested with TradeSim. I mean, having 10 candidates and picking any 4 because you have capital to take 4 trades is fine. Discretion can be applied here and shouldn't matter which 4 we pick as this is what monte analysis takes into account -- the different portfolio combinations and permutations.

It has been brought to me attention that TradeSim actually can test for this. This post was inspired by some good work by Stevo. You can actually program a code as part of the EntryTrigger and tell TradeSim to randomly only take X% of the trades that trigger.

So I did just that, to see if my system held up even if I missed some trades. And it does quite nicely. That said, I don't plan to ever do this in practice. You never know which trade will be the big winner.

For the above test, market orders were used to account for slippage and 200 monte carlo simulations were run each time, with the average return tabulated and shown in the above chart.

Tuesday, October 9, 2007

Every great journey begins with the first step




I realized that this chipping away approach was what I should be doing, not putting myself at big risk, trying to collect a ton of dough - Tony Saliba.

(Disclaimer: Just to re-iterate that I am NOT giving recommendations to buy or sell any of the securities mentioned in this blog.)

The first purchases were made this morning. We need to remind ourselves that this system is not supposed to work overnight. It's a long term weekly system, designed to make consistent money, over the long term. In fact, even in backtesting, the first year is often not profitable. So I would expect a single digit gain or loss on closed equity in the first year. That said, we should expect some nice open profits at this stage (after 12 months). Professional traders don't consider open profits as their own.

Start up is hard for long term systems because the trades that are closed out first are often the losers, and we need to give winners time to run. From testing, the average holding time for a winner was about 200 days, compared to 60 days for a loss. And the really big winners (which are the trends we are trying to catch) often run for much longer than a year.

The Total Trading Capital column in the spreadsheet is the money allocated to existing trades minus brokerage fees plus money in the bank. This is what TradeSim uses to calculate position sizing so I will do the same. MIN I paid double in brokerage because I made a mistake with the position sizing and bought less than I should have the first time around.

Monday, October 8, 2007

Waiting for opportunity

Although the cheetah is the fastest animal in the world and can catch any animal on the plains, it will wait until it is absolutely sure it can catch its prey. It may hide in the bush for a week waiting for just the right moment. It will wait for a baby antelope, and not just any baby antelope, but preferably one that is also sick or lame. Only then, when there is no chance it can lose its prey, does it attack. That, to me, is the epitome of professional trading - Mark Weinstein.

This post will have nothing to do with the title but I really liked that quote and has to fit it in somewhere!

There was another tweak I made to the system over the weekend that added a few percent to the results, that I haven't yet mentioned here.

All this time, I had the box in the TradeSim Preferences window "Accept partial trades if inadequate capital", unchecked. This only came to mind when I was thinking about this week's buy orders. After buying 9 stocks, each with a parcel size of about $4,500-4,700 (worked out from fixed percent risk), I would not actually take the 10th trade because i would fall sort of the required parcel size by a few hundred dollars. Then I thought why not take the trade anyway. But that hasn't been backtested. So I ran the tests again, to quantify the benefit (if any).

As suspected, the profit results were greater, by 3-4%p.a. over the various timeframes. Drawdowns were not affected significantly, about 1% higher. I'm happy with that. Number of trades increased by about 20%, naturally, so instead of 149 trades in the 6 year test, there were 179 trades. And instead of 84 trades in the 3.5 year test, there were 101 trades.

So now, the method will allow me to clean up the account if I don't have enough cash to take the full sized trade. This means that my money is in the market more often, which is a more efficient use of trading capital. And 3-4%p.a. is nothing to scoff at. Over a number of years, due to the effect of compounding, the increase in profit is quite substantial.

Maximising performance part 3

I have found that the greatest traders are the ones who are most afraid of the markets - Mark Weinstein.

I found a flaw in my testing method when ranking trades due to price, well, not a flaw as such, but the study design could've been structured better. Because I was ranking by lower priced stocks, this should mean, in theory, that there is only one possible route of trades to take. So everytime I ran a single portfolio simulation (with original ordering), all else being equal, the results should be exactly the same.

But they weren't, and I soon realised this was due to slippage. The variability would come from the randomness generated by the market orders which would buy a price anywhere between the low and the high of the entry bar and exit through any price between the low and the high of the exit bar.

As this wasn't a sound method of testing, I started again. For the purposes of this test, I ran monte carlo simulations (20,000) this time using default order slippage. Then I ran a single simulation through with the ranking giving preference to lower priced securities, also using default order slippage. So there's only 1 possible outcome. Then I compared this to the average portfolio result generated from monte carlo. The results are as follows.

01-01-1998 to 31-12-2003
Monte carlo average: 37.4%p.a.
With trade ranking: 38.9%p.a.

01-07-2001 to 01-03-2003 (The worst - XAO loses 18%, peak to trough of the bearmarket)
Monte carlo average: 1.5% (non-annualised)
With trade ranking: 13.56% (non-annualised)

01-01-2004 to 30-06-2007
Monte carlo average: 31.1%p.a.
With trade ranking: 44.6%p.a.

I don't think its coincidence that the more recent we go, the more wider the gulf becomes. I suspect it's due to not many stocks back in the 90s getting past my liquidity filter, though this hypothesis has not been tested. You can see this from the trade database. For the 6 year test between 1998 and 2003, there were 1234 possible trades, and for the 3.5 year test between 2004 and 2007, there were 1647 possible trades.

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.