html menu by Css3Menu.com

Case Study

The Search for the Holy Grail Trading System : Part 1 by David Samborsky

Click here for The Search for the Holy Grail Trading System : Part 2

Disclaimer

The following case study is for educational purposes only and is no endorsement of any of the concepts described in this article. The results provided in this case study are not indicative of, and have no bearing on, any results, which may be attained in actual trading. Results of past performance are no guarantee of future performance. It should not be assumed that you would experience results comparable to that reflected by the results described in this article. No assurance is given that you will not incur substantial losses, nor shall Compuvision Australia Pty Ltd be held liable if losses are incurred.

Most traders view the Holy Grail of trading systems as one that produces profitable trades 100 percent of the time. However, a trading system that produces profitable trades 100 percent is akin to being able to predict the future movements of the market. Since this is not practical under any circumstances this leads to the following statement which should always be emphasized :-

“Nothing and no one can predict the future movements of the markets.”

If anyone tells you otherwise then they are trying to mislead you. A lot of people using technical analysis often think that it is a substitute for crystal ball gazing. Some traders go to great efforts seeking the Holy Grail of indicators in order to outwit the markets: - I'm sorry to say there are none! However at best we can only talk in terms of probabilities and not absolutes. What we are looking for is a way of giving us a market edge so that the balance of probability is in our favor whether or not we are trading in unfavorable market conditions. This does not mean that we need to be concerned about exactly what trades will be profitable and what ones won't be. As long as the losses are constrained with good money management strategies what we can be assured of is that in the long run we can be trading with a reliably profitable and robust trading system that can be used across a broad market and one that will survive during periods of adverse movements in the market.

For those who are skeptical about using technical analysis to design a profitable trading system or one that works well in all market conditions across a broad market group you may want to reconsider your own philosophies regarding trading system design after reviewing the following trading system. I took an existing trading system out of the Metastock toolbox and modified it. In this case I took the Equis Bollinger Band Expert and modified it by replacing the BBand entry with a random entry strategy, which mimicked the outcome of tossing a coin. For example a trade was taken if you tossed a coin and the outcome was a head. The Equis BBand exit condition was not changed in anyway.

A true portfolio-trading simulator called TradeSim was used to back test the system in order to accurately model actual trading conditions. Metastock was used to generate trade data for the simulator and the simulator used this data to back test the system in a way that matched the way a trader would trade the system in real life according to a fixed set of trading rules and parameters that were not altered throughout the course of trading.

To generate the trade data a special Metastock Exploration was used to generate a trade database from a portfolio of securities that contained the top 200 stocks from the ASX. Note that some securities in the current ASX200 list may not have existed in the past in which case no trade data would have been produced before that time for that particular security. The resulting trade database was generated over a 16-year period starting from 1985 and spanning all of the way to July 2001. In this period over 3500 trading candidates were generated but not all of these trades are taken during any one trading simulation just as would be the case in real life. I also included an initial stop parameter based on the average true range which was used to generate position sizing for the risked based position size model that I used when simulating this trading system. No money management stop was used - the trade exit being totally dependent on the Equis BBand exit trigger. To make the trading system more realistic I included a 40-dollar total transaction cost and redefined the entry and exit triggers so that a trade was entered and exited on the day after the triggers at the worst possible prices in order to model the worst case slippage.

The Trade Database Exploration

A special Metastock Exploration was written to generate a trade database using an external plug-in which contains a random number generator as well as a special function which is used to write all of the trading candidates out to a proprietary database file. The exploration used to generate a trade database is shown below. This set of indicators used in the exploration is called once for every security in the exploration security list and the relevant trade information is written out to a proprietary database file, which is later used by the trading simulator for analysis. The Metastock Exploration security list is designed to match the securities in the portfolio of interest, which in this example are the S&P ASX top 200 stocks.

 

{ The exploration below uses five basic parameters which define a framework for the whole trading system. These are the entry and exit triggers and price as well as an optional stop loss parameter, which we use to size trades for risked based position size models}

{ The entry trigger was replaced with a random entry strategy that mimicked the outcome of tossing of a coin }

EntryTrigger:=ExtFml("TradeSim.Rand")>0.5;

{ The exit trigger was taken directly from the Equis Bollinger bands Expert in Metastock }

ExitTrigger:=Abs(13-BarsSince(Ref(C>BBandTop(C,20,S,2),-1) AND
H<=Ref(H,-1) AND Ref(H,-1)>=Ref(H,-2) AND
Ref(RSI(14)>65,-1)))<=7 AND
Ref(C>BBandTop(C,20,S,1.25),-1) AND Ref(C<BBandTop(C,20,S,2),-1) AND
H<=Ref(H,-1) AND Ref(H,-1)>=Ref(H,-2) AND
Ref(RSI(14),-1)<ValueWhen(1,Ref(C>BBandTop(C,20,S,2),-1) AND
H<=Ref(H,-1) AND Ref(H,-1)>=Ref(H,-2) AND
Ref(RSI(14)>65,-1),Ref(RSI(14),-1)) AND
BarsSince(C<BBandTop(C,20,S,1.25))<BarsSince(Ref(C>BBandTop(C,20,S,2),-1) AND
H<=Ref(H,-1) AND Ref(H,-1)>=Ref(H,-2) AND
Ref(RSI(14)>65,-1)) AND
BarsSince(C>BBandTop(C,20,S,2))>BarsSince(C<BBandTop(C,20,S,1.25));

{ To make the trading system more realistic I redefined the entry and exit triggers so that a trade is entered or exited on the next trading day at the worst possible prices on the day so that we can model the worst case slippage }

ActualEntryTrigger:=Ref(EntryTrigger,-1);

EntryPrice:=HIGH;

ActualExitTrigger:=Ref(ExitTrigger,-1);

ExitPrice:=LOW;

{ The initial stop parameter is only used to generate position sizing for each trade and is not used as a money management stop }

InitialStop:=Ref(C-3*ATR(10),-1);

{ The following indicator is where the trading candidates are written to a proprietary database file so that they can later be used by TradeSim }

ExtFml( "TradeSim.RecordTrades",
"Rand Entry & Bollinger Bands Exit",
LONG,
ActualEntryTrigger,
EntryPrice,
InitialStop,
ActualExitTrigger,
ExitPrice,
START);

Results from a true portfolio simulation

TradeSim was used to run a true portfolio trade simulation using the resulting trade database and the following trade parameters.

Trade Parameter

Value

System Type

Random Entry + Bollinger Bands Exit System

Initial Stop Parameter Used

Yes

External Money Management Stop Used

No

Portfolio

ASX 200

Earliest Trade Entry Date

1985

Latest Trade Entry Date

2001

Position Size Model

Fixed Percent Risk Model

Pyramid Profits

Yes

Initial Trade Capital

$50000

Portfolio Heat

100%

Total Transaction Cost per Trade

$40

Fraction of Capital Risked per Trade

1.00%

Position Size Limit

100%

The trading simulator would trawl the database for suitable trading candidates based on the entry date and then enter a trade if the position size and available trading capital allowed it to do so. Multiple positions would be taken if the available trading capital allowed it and a 100% portfolio heat allowed all of the trading capital to be allocated to as many trades as the available trading capital would allow. In essence the trade simulation was mimicking the way that a real trader would trade a system using a portfolio of securities. Contrast this to the way that most back testers only test a trading system on one security thus only generating twenty or so trading candidates, which is hardly enough to make any sort of accurate statistical hypothesis.

The trade simulation executed 289 trades from the total database of 3546 trades which were taken in chronological order and were sized according to the position size model used and available trading capital. The resulting trade simulation produced a Trade Log (this takes a while to load), which contains a log of all of the trading details on a trade-by-trade basis. A comprehensive Trade Simulation Report, which is shown below, was also generated which contains details of all the relevant parameters for a single portfolio trade simulation. The system produced a 1903% increase in equity over the 16-year period which is equivalent to an average annualized compound interest rate of 20.7%. Peak drawdown was contained to 14% which is quite a remarkable result considering that we are only using one trading system across a broad group of market entities over a long period of time.

Looking at the equity chart below you will note that an exponential rise in the equity curve over sixteen years which is attributable to profit pyramiding. There was no major short-term drawdown in equity, which also proves that this system is immune to aberrations in the market conditions. Note specifically how the 87-crash and more recently the tech stock crash of April 2000 had very little impact on equity. The drawdown chart shown later also verifies this. This is a very remarkable result in itself considering that the system was tested under the worst possible slippage!

There was no more than 14% peak-to-valley drawdown in equity as shown in the equity chart below and the October-87 crash did not produce the peak drawdown.

The average negative Reward/Risk ratio of -0.97 and the Reward/Risk ratio chart shown below shows how risk was contained, which suggests that the exit strategy contains, built in risk management.

As shown in the yearly net profit chart below most of the annual periods produced profits. Note how the largest profit was produced in 2000 with the Bull Run up to the tech stock crash. This illustrates good capital preservation as well as immunity to market aberrations, which is a hallmark of any robust trading system.

Click here for The Search for the Holy Grail Trading System : Part 2

 

Summary

While it appears that we may have developed a fairly robust trading system and one that fits the practical definition of a Holy Grail trading system we must still ask yourself whether or not results from this trading system could have been repeated by another trader trading the same system using the same portfolio of securities for the same period of time. One thing to bear in mind is that although we have generated a trading database with over 3500 trading candidates would another trader obtain the same or similar results if they had of picked a different set of trading candidates from the trade database - or would they have made a net loss? To answer this question we need to look at the whole trading system from a statistical point of view and this is what we explore in Part 2 of this article.

Goto The Search for the Holy Grail Trading System : Part 2