Australian (ASX) Stock Market Forum

What do you reckon about this trading strategy?

Joined
8 November 2009
Posts
51
Reactions
0
Having thrown away 10s of thousands of dollars in 07-08 using a buy and hold strategy I finally realised that there must be a beter way of doing things. So I bought some books, started reading this forum and invested in some software. So far this is what I have come up with, it is still a work in progress and I am interested to hear peoples opinions (Good and bad) on this possible system. So far I am only about half way through developing this. The basic premise of the strategy is that there a 3 basic market phases, bull, bear and consolidating (Trading a range), since it is impossible to accurately predict which way the market will head I plan on using 3 strategies, one for each market type and bias my trading strategy towards what the current market is. I.e If in a bull market make 60% of trades using the bull system 20% using the bear system and 20% using the consolidating system etc. Ideally I want all 3 strategies to make money in all 3 markets but this is obviously proving difficult, so at the very least I want the losses to be minimal and the system to outperform the market. The one strategy that I would currently be happy to trade is the bull market strategy. It is based on the method used by the Turtles, that is get on board a trend and sell when the trend stops. It is very simple and has me buying in when a share hits a 22 day high and selling when it hits a 22 day low (Timings still to be optimised), there are a couple more simple rules but that is basically it (Seems maybe a little too simple but that's what I like about it). No stop loss is currently used but I am experimenting with this, if used it will be a fairly loose stop based on ATR as I have found a tight stop (at about 3-4 ATR) is not letting the profits run and getting me out of the stock early. So, this is the system that I am most interested to hear peoples opinions on. Being to tight to purchase Tradesim or some other system that can do MonteCarlo backtesting I have simply used Amibroker set the PositionScore to random and run 100 tests in the date range 17/09/2001 - 11/12/2009. The results are as follows:
Testing the ASX300 (All ords gives similar results, but if I trade this system I will be looking at the ASX300 for peace of mind)
XAO increase in this time - ~52%
Smallest Return using trend system - 111% (As in just over double)
Largest Return using trend system - 4746%
Average return using trend system - 1145%
Results from a typical Backtest are as follows:
Net Profit - 988%
Annual return - 33.55%
No of trades - 377
% winners - 34%
% losers - 66%
Avg profit - 46%
Avg loss - -10%
Max trade % drawdown - 50%
Max system % drawdown - 56%
CAR - 0.6
RAR - 0.67
Risk reward ratio - 0.79
Sharpe ratio - 0.28
K ratio - .0411

Good points from this data:
Large profit increase
Relatively small number of trades

Bad points form this data:
Everything else, in particular,
Win/Loss ratio - Low, usually a bit higher (about 40/60)
Trade and system draw downs - Large, these obviously occured in 07/08 so don't worry me too much, if my system evolves as desired I would pull most of my money out and put it into my bear system (When I perfect it/get it to a reasonable level). The system still consistantly outperforms the index during this period. Stop loss will also help this.
CAR/RAR - Based on system draw downs as mentioned above.
Sharpe and K ratio - Interested to hear opinions on these.

So like I said there are some bad points to the system and it would require alot of discipline to trade but it consistently out performs the market and at the end of the day it is annualised returns that I am looking for and this provides them. Things I am still working on:
Stop loss
Position sizing - Will look to set up such that it doesn't allow me to lose more that 2% of total equity based on the 22 day low at the time of purchase or on my stop loss.
If multiple buy signals are given on any one day I will use Fundamental Analysis (Mainly looking for EPS and profit increases over the last few reporting periods, agian, still working on it).
Sorry for all the words but I have found this forum to be invaluable in setting up and testing different strategies, it has pointed me to some good resources such as the chartist and different books and also my choice of trading software in Amibroker which has been great, hence why opinions from this site will be highly valued.

Cheers,

Harro
 
No stop loss is currently used but I am experimenting with this, if used it will be a fairly loose stop based on ATR as I have found a tight stop (at about 3-4 ATR) is not letting the profits run and getting me out of the stock early. So, this is the system that I am most interested to hear peoples opinions on.
Harro
I have recently started experimenting with system backtesting. Backtests can be tricked up anyway one wishes. I can turn 10k into billions or I can crash it. Depends on what settings I use.
 
Hi harro,

thank you for sharing your ideas and system.

Can i ask you please, have you tested this system over;

(a) the last 10 months
(b) the last 2 years

If so what have your results been?

My next question is, how are you identifying whether you are in a bull, bear or range trading market?
 
I have recently started experimenting with system backtesting. Backtests can be tricked up anyway one wishes. I can turn 10k into billions or I can crash it. Depends on what settings I use.

I want to know what superero will be on your Avatar next?

Im guessing Hulk?
 
I have recently started experimenting with system backtesting. Backtests can be tricked up anyway one wishes. I can turn 10k into billions or I can crash it. Depends on what settings I use.

I agree, I have been very careful not to use any future data etc. Seems as I will only be trading after hours (Due work) I have set the settings to buy and sell at the open of the day after recieving a signal. I have accurately set up my commision rates etc. So, as far as I can tell, the backtesting should be 100% what I would have expected had I been trading the system. The obvious limitation is that I am using current day ASX300 data however I have backtested the All ords and results have been similar. I have seen a few strategies on the net (Including on this site) that when backtested give amazing results however when you delve into it there is a line of code in the buy signal stating buy = close > open, obviously with the settings set to buy on open you could achieve pretty impressive results using this. Other systems I have seen utilise the current days close to create and indicator but have you buying on the current days open. I am confident I have not done any of this.

Hi harro,

thank you for sharing your ideas and system.

Can i ask you please, have you tested this system over;

(a) the last 10 months
(b) the last 2 years

If so what have your results been?

My next question is, how are you identifying whether you are in a bull, bear or range trading market?

Backtesing over the last 10 months gives a pretty consistent ~140% increase as compared with the XAOs 35% increase.

Backtesting over the last 2 years gives about a 100% increase as opposed to the XAOs 29% loss. It seems almost too good to be true for such a simple strategy hence why I am constantly searching for an error like mentioned above.

I do not currently have a mechanical system for determining if we are in a bull, bear or range trading market and would love to hear some suggestions. As such I am currently using the Marbo the constitution and the vibe. For example I believe we are currently in a range trading market, when the All Ords moves above 4900 I would switch to a bull market (Due previous resistance). If it drops to below 4500 I would call it a bear market (Due previous support).
 
Harro, can you post up a small sample of the trades from the backtesting?

With those types of results I'd say there is a glitch in there somewhere.
 
My next question is, how are you identifying whether you are in a bull, bear or range trading market?

Was going to ask the exact same thing. If you can program something on the overall market and overlay that with your 3 sub systems then it will take a good amount of guess work out of it.

And if you are keen to mix in fundamental analysis, you can always filter the stock universe by gearing ratio or no EPS growth less than -10% or something like that. It might improve your results?
 
Harro, can you post up a small sample of the trades from the backtesting?

With those types of results I'd say there is a glitch in there somewhere.

Thanks for the feedback, that is what I'm worried about as it does seem too good to be true. That said, the Turtles obviously made millions trading a similar system.
Attached is the charts showing the equity (Trading the ASX300) and the buy/sell signals (That would have been generated if trading only XAO) from early 2006. I have optimised the time paramaters to buy in at a 27 day high and sell at a 23 day low (This has been optimised based on data from 2001 not just the 06-09 period). I have also attached a sample of the trades. Is this what wou're after Nomore? Let me know if you want me to attach something else.

SKC, I'd like to incorporate something similar to what you've mentioned. I've only had Amibroker for a month or so but I don't think it can scan fundamentals (Requires more research). It may pay to invest in some software that does fundamental analysis. I'm currently reading How to make money in stocks (Don't like the title but the content is OK) by William O'Neil, he uses a method he calls CANSLIM which looks at accelarating EPS growth, Accelarating earnings increases, Volume, Institutional sponsorship etc. This fits in well with a trend following system so I am looking to incorporate these techniques into the system. I will allow the mechanical system to filter through the ASX300 and I will use the Fundamental method to determine which of these stocks are likely to perform best.
 

Attachments

  • Backtest.png
    Backtest.png
    53.3 KB · Views: 21
  • Trades.png
    Trades.png
    59.1 KB · Views: 29
Your system uses the ASX300 index as entry and exits?
If you are trading intraday, beware of the staggered open.
Your system equity seems to refect the index moves heavily. Do a regression against the XAO and see how high the correlation is.

Cheers
 
Just realised that the list of trades I provided probably was not the most representative sample. As with any trend following system the majority of profits comes from a small sample of trades. So attached is the next group of trades
 

Attachments

  • Trades.png
    Trades.png
    89.2 KB · Views: 28
Your system uses the ASX300 index as entry and exits?
If you are trading intraday, beware of the staggered open.
Your system equity seems to refect the index moves heavily. Do a regression against the XAO and see how high the correlation is.

Cheers

All trades occur at the open of the day after the signal is recieved so I would put in an order the night before when the market is closed, this is reflected in the backtesting. I assume this is what you mean by staggered opens.
Sorry, my post was a little misleading. The data I have provided is based on trading stocks in the ASX300 not the index itself. The graph of XAO shows when the system would have given buy/sell signals for the index only not the stocks in the index.
Thanks.
 
The backtest settings are critical in my opinion.

What amount of account is allocated to each trade? 100%
What amount of risk per trade? You mention no stop loss. So 100%
 
Have you tried Howards Bolly Bands formula? :)

If not, could you give it a go and tell me what the results are like please? :)

// BBandBreakout.afl
//
// A trend-following breakout system
// based on the Bollinger Bands.
//
// Buy when the closing price rises through the
// upper Bollinger Band, Sell when the price
// drops back into the Bollinger Bands.

PosQty = 4; // You can define here how many open positions you want
SetOption("MaxOpenPositions", PosQty );
PositionSize = -100/PosQty; // invest 100% of portfolio equity divided by max. position count

BBLookback = Optimize("BBLookback",12,2,30,2);
BBWidth = Optimize("BBWidth",2.8,1,3,0.1);
BBT = BBandTop(C,BBLookback,BBWidth);
BBB = BBandBot(C,BBLookback,BBWidth);
Buy = Cross(C,BBT);
Sell = Cross(BBT,C);
Short = Cross(BBB,C);
Cover = Cross(C,BBB);
e = Equity();
Plot(e,"Equity",colorBlack,styleLine);
//Figure 9.13 Bollinger Band Breakout
 
The backtest settings are critical in my opinion.

What amount of account is allocated to each trade? 100%
What amount of risk per trade? You mention no stop loss. So 100%

Position sizing is set at 10% of total equity, this is an arbitrary number and I plan on firming this up.
That's right there is no stop so risk is 100% of that trade, so therefore 10% of total equity.
 
Have you tried Howards Bolly Bands formula? :)

If not, could you give it a go and tell me what the results are like please? :)

// BBandBreakout.afl
//
// A trend-following breakout system
// based on the Bollinger Bands.
//
// Buy when the closing price rises through the
// upper Bollinger Band, Sell when the price
// drops back into the Bollinger Bands.

PosQty = 4; // You can define here how many open positions you want
SetOption("MaxOpenPositions", PosQty );
PositionSize = -100/PosQty; // invest 100% of portfolio equity divided by max. position count

BBLookback = Optimize("BBLookback",12,2,30,2);
BBWidth = Optimize("BBWidth",2.8,1,3,0.1);
BBT = BBandTop(C,BBLookback,BBWidth);
BBB = BBandBot(C,BBLookback,BBWidth);
Buy = Cross(C,BBT);
Sell = Cross(BBT,C);
Short = Cross(BBB,C);
Cover = Cross(C,BBB);
e = Equity();
Plot(e,"Equity",colorBlack,styleLine);
//Figure 9.13 Bollinger Band Breakout

No Probs,

I ran it straight away with my current settings and it gave a 33 digit profit. Like you say backtesting settings are critical and this is one of those methods where you must have your entry timing settings correctly. I had them set to buy on open and sell on open, naturally, I had a winning ratio of almost 100%. I changed the formula to that shown below:

PosQty = 4; // You can define here how many open positions you want
SetOption("MaxOpenPositions", PosQty );
PositionSize = -100/PosQty; // invest 100% of portfolio equity divided by max. position count
PositionScore = Random();
BBLookback = Optimize("BBLookback",12,2,30,2);
BBWidth = Optimize("BBWidth",2.8,1,3,0.1);
BBT = BBandTop(C,BBLookback,BBWidth);
BBB = BBandBot(C,BBLookback,BBWidth);
Buy = Ref(Cross(C,BBT),-1);
Sell = Ref(Cross(BBT,C),-1);
Short = Cross(BBB,C);
Cover = Cross(C,BBB);
e = Equity();
Plot(e,"Equity",colorBlack,styleLine);

This has you placing buy/sell orders during market close after recieving a buy/sell signal, thus the trade is executed at the following days open (With the entry/exit timing settings set to this). This give a less impressive return, ~70% loss. Using the original formula and setting it up such that trades are executed at close on the day the signal is generated gives an ~80-90% loss. I've examined the settings for my system 1000 times and am fairly confident that they are correct, unless there is any other common gotchas that people are aware of in Amibroker.
Thanks for the heads up though, I imagine that it is very easy to get some good returns during backtesting and get dollar signs in the eyes, only to start trading the system, lose alot of money and realise that you were using future data in your backtesting.
 
This has you placing buy/sell orders during market close after recieving a buy/sell signal, thus the trade is executed at the following days open (With the entry/exit timing settings set to this).
I thought the "settings" in Auto Analysis were the final criteria that the analyser uses when back testing.

Buy and Sell on market open.

The formula says Buy cross Bollinger Band Top. So if the settings in Auto Analyser are 'Buy open' then that would be a buy on the market open.

Same with Sell Bollinger Band Top cross. Signal initiates a sell so when the market next opens the sell is executed.

This could be wrong.
 
I thought the "settings" in Auto Analysis were the final criteria that the analyser uses when back testing.

Buy and Sell on market open.

The formula says Buy cross Bollinger Band Top. So if the settings in Auto Analyser are 'Buy open' then that would be a buy on the market open.

Same with Sell Bollinger Band Top cross. Signal initiates a sell so when the market next opens the sell is executed.

This could be wrong.

We may be saying the same thing but just to clarify. Using the BBand formula as an example:
You are buying when the price closes above the top BBand line, if you have the settings in automatic analysis set to buy on open this is incorrect. If the price closes above the top BBand line the price is more than likely (I won't say certainly) going to rise from open to close, therefore you are using the close price to generate a signal and than telling it to buy on open. You could write a formula saying buy = close > open, sell = close > open and set the settings to buy on open and sell on close, you would have a winning percentage of 100% and make billions according to the backtester.
In my system, I will be examining the buy signals at night when the market has closed and placing orders for the next days open. To replicate this in the backtester I have said:
Buy = Ref(Close > Ref(HHV(Close,27),-1),-1)
The ref(HHV(close,27),-1) is such that it is looking at the previous day for the highest high value in 27 days (Otherwise it would never generate a buy signal as the current days high would be equal to the 27 day HHV not greater than (I probably could have solved this by making it equal to instead of greater than, but it's done now))
The ref(..........,-1) that encompasses the whole formula is to satisfy the backtester. I set the settings to buy and sell at open and using the ref function it is buying or selling at open the day after the signal is generated.

I hope that made sense.
 
Harro26,

Instead of doing the Ref(...,-1), could you try this:
SetTradeDelays(1,1,1,1); //ie, look at data today then buy tomorrow on open
BuyPrice = SellPrice = Open;
Buy = Close>= Ref(HHV(Close, 27), -1);

As I understand it, this says
- after close of today, check buy signals, ie, you come home from work and it run this and it generates a buy if Close is made over last 27 days. However, the actual buyprice is tomorrow on open.
See what results you get with this.

Your returns do seem a bit high for a basic high > high last 27 days. Also, the drawdowns are very high, could you physcologically (excuse the spelling!) handle this sort of drawdown? Wouldn't you keep 2nd guessing yourself whether you've coded your system accurately (as you're doing now) when you start losing a lot of money?
If you then put stops on the system you will most likely reduce your return so it's a always a tricky balance.
 
SKC, I'd like to incorporate something similar to what you've mentioned. I've only had Amibroker for a month or so but I don't think it can scan fundamentals (Requires more research). It may pay to invest in some software that does fundamental analysis.
If you are still around. This is a stock scanner that isolates your chosen criteria from the XAO. It will give up a stock list and then you have a universe of stocks that meet the fundamental criteria. Not brilliant but it narrows down the field. I also use it to create a universe of pennies under 20c for example.

http://www.ascii-data.com/index.html
 
Top