Australian (ASX) Stock Market Forum

Developing a mechanical system from scratch

/* Clean up database*/

/*there are the string functions to help with these
run the explore, save all to a watchlist then in Assignment Organizer
delete them

example*/

Filter= StrRight(Name(),3)==".AX" OR StrLen(Name())>4;
AddTextColumn(Name(),"name");

I use the above code to clean out any symbols that are longer than than 4 letters.

I use two ASX databases.

Adjusted EOD data I get from Premium Data which assigns the data to the various watchlists automatically at the end of day when updating.

The second database is unadjusted data that includes warrants and options and is intra day. I use the above code to clean it up. The data originally was sourced from Yahoo, and the code was designed to get rid of the .AX extension.

I have just ordered the Quantitive Trading Systems book myself and am interested in your comments. I've had AB for some years now, however, my programming skills are still pretty rough.

Anyway, came across this thread by accident and am finding it an interesting read. Keep up the good work guys.

Cheers
IJW

Thanks heaps for that IJ!

Say...i've started using the latest beta verson and it won't save my watchlists....any ideas?

Also, when i try and filter to backtest only ASX200, i get no results??:confused:

As far as the book goes, its a bargain!

Love to know if anyone else has read it...

Thanks Wayne for the update, i'll try to get something together worth testing again this week, and you can run it on the US data....

Sheesh Bandy is real fussy about data!

Cheers,
 
Shorter term systems work, but I think they have to be a bit less mechanical lest they underperform longer systems.

Anyone else coming up anything different?

Nope, I concur this. My testing suggests that when talking about really short term ie. out to about 5 days, but could be as short as buy today, sell tomorrow, based on EOD signals, you can get up to a few percent annualised. Hardly staggering, although as Nick pointed out, the exposure factor is also very low...sometimes you're in the market just 1-2% of the time. The opportunity factor of the system can be increased by exposing it to more markets.

Although it seems you can only crank up the 'heat' factor so much as it appears that it is inherent in these systems that every so often you get a big multi-R loss. Makes sense when you think about it. A gap down through your stop loss and your ability to control and limit loss to 1xR is smashed. If you had 1R set at 2% of your account and you had concurrent exposure to 10 markets and you were suddenly hit with 10 x 2R losses, you'd experience a drawdown of 40%. The recovery factor of these systems is relatively low, so you'd be taking a while to bounce back from that one.
 
Nope, I concur this. My testing suggests that when talking about really short term ie. out to about 5 days, but could be as short as buy today, sell tomorrow, based on EOD signals, you can get up to a few percent annualised. Hardly staggering, although as Nick pointed out, the exposure factor is also very low...sometimes you're in the market just 1-2% of the time. The opportunity factor of the system can be increased by exposing it to more markets.

Although it seems you can only crank up the 'heat' factor so much as it appears that it is inherent in these systems that every so often you get a big multi-R loss. Makes sense when you think about it. A gap down through your stop loss and your ability to control and limit loss to 1xR is smashed. If you had 1R set at 2% of your account and you had concurrent exposure to 10 markets and you were suddenly hit with 10 x 2R losses, you'd experience a drawdown of 40%. The recovery factor of these systems is relatively low, so you'd be taking a while to bounce back from that one.

ASX.G.

You'd be very unlucky for that to happen.
When a stock opens below your stop thats what you call a black swan event, its supposed to be rare.

And 40% Max.DD is acceptable to some people. William Eckhardt's $250million fund has 40%ish max.DD and he makes around 28% annualised. A fair effort.

Even though its rare, it happened to me on a few stocks coz i was on holiday at the beginning of the year, and went back into the market on guess what day.... yep.... February 26th.... one day before the correction.... :banghead:
Hows that for timing :eek:

But nice discussion about exposure factor...
Thanks for that....
 
ASX.G.

You'd be very unlucky for that to happen.
When a stock opens below your stop thats what you call a black swan event, its supposed to be rare.
Not really. Stock distributions of returns are leptokurtic i.e. they have fat tails. This means Black Swans happen more often than you would think.

It is this that makes trend following systems work, and it is this that means you get crunched in a gap down more often than normal distribution suggests.

In this market traders are just used to the upside fat tail and have been relatively unexposed to the downside fat tail.

This will also eventually regress to the "mean" and traders will get more frequent unexpected and unwelcome price shocks at some point in the future.

Be prepared for that. :2twocents
 
You'd be very unlucky for that to happen.
When a stock opens below your stop thats what you call a black swan event, its supposed to be rare.

You mean like LTCM rare?? :p:

And 40% Max.DD is acceptable to some people. William Eckhardt's $250million fund has 40%ish max.DD and he makes around 28% annualised. A fair effort.

From memory Eckhardts style is more trend following. This is not that technique. Its not likely for you to bounce back from a 40% drawdown using this technique...the expectancy tends not to be high enough.
 
Black Swans:

As luck would have it, TradeKing Blog just posted an article on Black Swans, Taleb etc

Understanding Highly Improbable Events
from The TradeKing Blog
Over on the EconTalk blog, Russ Roberts interviews Nassim Nicholas Taleb, author of the recently published The Black Swan as well as the best-selling Fooled By Randomness. As Taleb points out over the course of a one-hour conversation, traders need to be able to cope with uncertainty and understand the underlying probability of events actually happening. Using a metaphor involving Mediocristan (a place where nothing much out of the ordinary occurs) and Extremistan (a place where highly improbable events are a fact of life), Taleb outlines the impact that outlier events (i.e. Black Swans) often have on final outcomes:

“Nassim Taleb talks about the challenges of coping with uncertainty, predicting events, and understanding history. This wide-ranging conversation looks at investment, health, history and other areas where data play a key role. Taleb, the author of Fooled By Randomness and The Black Swan, imagines two countries, Mediocristan and Extremistan where the ability to understand the past and predict the future is radically different.

In Mediocristan, events are generated by a underlying random process that is normally distributed. These events are often physical and observable and they tend to cluster around the middle. Most people are near the average height and no adult is more than nine feet tall.

But in Extremistan, the right-hand tail of events is thick and long and the outlier, the seemingly wildly unlikely event is more common than our experience with Mediocristan would indicate. Bill Gates is more than a little wealthier than the average. The civil war in Lebabon or the events of 9/11 were more worse than just a typical bad day in the Beirut or New York City.

Taleb's contention is that we often bring our intuition from Mediocristan for the events of Extremistan, leading us to error. The result is a tendency to be blind-sided by the unexpected.”
 
Canaussieuck,

I take it we're talking about v 4.96 beta?

I don't know why you would be having a problem saving the watchlists. The whole new approach to managing them is a lot easier. But I guess that isn't much good if you can't save the damn things.

I'm sure Thomasz will have the answer.

Cheers
IJW
 
Hi Nick,

I would tend to concur with both Wayne and Asxg. I have found it a big challenge to build a sufficiently profitable short term (1 day hold) mechanical system based on EOD data. By that, I mean using only recent price bar information to identify a setup and then to initiate either a non discretionary buy or short at the open of the next day and to terminate the trade one day later (once again at the open). When one includes the round-trip commission, I have found it difficult to make any form of meaningful return.

Your earlier suggestion regarding the 3 consecutive contracting bars is very useful in identifying a situation whereby subsequent price is likely to be more volatile. My testing has shown this to be the case and to that end, it has served its purpose well. However, my problem (well one of my problems) is that I have not been able to identify consistently well the direction to take when the prices really start to move, especially when the trade is to last only one day. I cannot find a good enough edge for a one day buy/hold mechanical system. :banghead::banghead:I have noticed that if I let the trades run a little longer (say 3 - 5 days hold), I can build more of an edge but still nothing to write home about.

The more I think about it, the results that I have obtained would seem logical. We all know that casinos have a statistical edge over players. This statistical edge becomes more pronounced as the number of games played is increased. Therefore the casino accepts that there will be periods whereby they lose money, but in the end, if they are able to keep the players at the table long enough, they will clean up.

There is a lot of similarity between the casino analogy and our attempts to build a very short term mechanical EOD system, with the exception that we are now trying to be the casino in implementing a system with a statistical edge. Like the casino, this statistical edge should be more pronounced with more time in the trade, giving time for this statistical edge to play itself out. By trying to develop a one day buy/hold system is akin to the casino receiving a number of players hitting the tables with single large bets (as opposed to a series of small bets) – something which casinos are not really keen on as it reduces the effectiveness of their statistical edge.

It therefore makes sense to me that the shorter the time frame for our mechanical system, the bigger the edge you need to make it work. Like I said before, I have not been able to define a big enough edge to make it work. Perhaps I have not been able to adequately read the latent message in the price and volume bars leading up to the setup. With the two separate set of results that you have presented, it would appear that you obviously have found a usable edge. I would appreciate your comments on these two systems regarding :

1) Whether they use any of the “micro-pattern” setups that you described in Adaptive Analysis?
2) Do they look only at the price action immediately preceding the setup or do they scan back many months, eg to see where the previous all time high might be
3) Are there specific markets whereby they work better than others (liquid stocks, illiquid stocks, futures, commodities etc etc)
 
Just to clarify:

My comments are specifically about short/medium term trends verses longer term trends.

One day holds are an area I haven't even touched on in a mechanical sense, so cannot comment based on my own (non) research. Nick's mech system mentioned is a corker, I followed it when he was posting the trades live on his site. Tried to reverse engineer it too :eek: Too tricky for me. ;)

A whole 'nuther bowl of wax IMO. :2twocents
 
I would tend to concur with both Wayne and Asxg

That's fine. However, I've just shown 500+ real time trades based on a system using a single bar that has made in excess of 100% per year after costs and slippage.

I have found it difficult to make any form of meaningful return.

What people don't grasp, I assume, is that I do this for a living. I do it hours on end and have done so since the mid-90's. I don't mean a lazy Saturday aftrenoon, I mean hours every single day. These things don't happen over night. They take time and commitment. The edge exsists - you just need to keep looking and thinking differently. My biggest problem is that I lack imagination which is why I spend a lot of time skimming the net and looking for idea's. You'd be amazed what can turn up. I read forums. I visit sites. I even buy systems and courses at times. I need to see what others are thinking. From their work I can build my systems to suit me.

This said, I completely, 100%, agree, that the best edge is generated from a longer hold time. Another post in this forum discusses "Elite Traders", Seykota, Dennis et al, and the thing that is missed is that most, if not all, of these elite traders are trend followers. 90% of managed money within alternate asset classes are managed by trend followers and 99% of those are systematic.

1) Whether they use any of the “micro-pattern” setups that you described in Adaptive Analysis?
My experience shows that a momentum based strategy will outperform a contrarian strategy at this level. A trend following strategy, such as my Growth or Growth Plus Portfolio's within The Chartist also work very well using 1 min bars. If you can be bothered to sit there, you'd do very well. I've said on numerous occassions, if you understand why the profits are being made, then you can start to think very differently. Applying an EOD trend following system to 1-min data to increase trade frequency is one example.

2) Do they look only at the price action immediately preceding the setup or do they scan back many months, eg to see where the previous all time high might be
They concentrate on recent activity, especially volatility, which is why I mentioned the 3-inside days.

3) Are there specific markets whereby they work better than others (liquid stocks, illiquid stocks, futures, commodities etc etc)
The issue with stocks/CFD's (rephrase; Australian stocks/CFD's) is the cost of doing business. I have several excellent short term systems that trade stocks or CFD's. I can get $33 comm's for $200k worth of stock, but I can't get the leverage. To get the leverage via CFD's means paying the percentage. The percentage takes a big lump off the bottom line, but the systems still make money. It makes me want to become a CFD provider rather than trader though. People wonder why every man and his dog has a CFD platform now - its money for jam. My personal preference is futures. No where can you get the leverage for the cost. In another post on this forum, someone discusses the cost of index CFD's. They mention 2bps r/t, which to me is $100 per trade. I pay $5 r/t to trade the SPI. Why would I ever pay a CFD provider?

The only downside with futures is trade frequency on an EOD basis. I can run my short term system across 3 -4 futures markets, but I can run it across 10 - 15 stocks. With 10 - 15 stocks I can get a much smoother equity curve and build the account a lot more. Problem is that the CFD provider makes more than me...:banghead:
 
Hi Nick,

Many thanks for your detailed reply. I guess its all part of the journey in learning about what works and why it works. There is no question in my mind that having a profitable very short term trading system running in the background is an extremely useful tool to have in any traders armory, to complement any longer term strategies that you may have.

The development of a profitable shorter term system is unquestionably more complex than a long term system. The fact that you have managed to develop several of these system would give those of us aspiring down the same path some much needed encouragement and we thank you for that.

Back to the grindstone !!!
 
Below are a couple of patterns that may be of interest or an idea for a system.
 

Attachments

  • Arrow and Popgun Patterns.jpg
    Arrow and Popgun Patterns.jpg
    13.3 KB · Views: 188
Below are a couple of patterns that may be of interest or an idea for a system.

Are the ranges the only important factor in these Lesm? Is that why there are no O/Cs?

Cheers,
 
Is this the type of entry you're looking for with the system?

Looks like a pennant with three inside candles to me, or do they have to be within the full body.

Or am I in the wrong thread? :confused:

(Not holding)
 

Attachments

  • GRR.gif
    GRR.gif
    45.1 KB · Views: 129
Thats the one.

I'm on holidays :D now so i'll fire up the discussion Monday morning.

Cheers,
 
But hey, thats a weekly right. We're looking for that pattern on a daily...but thats not to say that it wouldn't work, maybe a longer term...food for thought.

Cheers,
 
But hey, thats a weekly right. We're looking for that pattern on a daily...but thats not to say that it wouldn't work, maybe a longer term...food for thought.

Cheers,

This what i have maintained the WHOLE TIME.

But everyone was like, nah thats been done with techtrader and focussed on short term systems.

So whats it gonna be? Short term or longer term.

My personal interest is on longer term systems -- i think they outperform short term systems, at least for stocks. Im my opinion.
 
This what i have maintained the WHOLE TIME.

But everyone was like, nah thats been done with techtrader and focussed on short term systems.

So whats it gonna be? Short term or longer term.

My personal interest is on longer term systems -- i think they outperform short term systems, at least for stocks. Im my opinion.
For a pure mechanical system, and REALLY LARGE accounts, I think I agree.

But depending on a host of factors, short term trading can WAY outperform long term systems.
 
Top