Australian (ASX) Stock Market Forum

Looking for and testing short term patterns in the market

professor_frink

Moderator
Joined
16 February 2006
Posts
3,252
Reactions
5
Morning all,

Not sure how many people here use this type of analysis or not, so thought I'd throw something out there and see what bounces back:)

One thing that seems to get thrown around the forum quite a bit is to test out patterns and ideas before putting them to use. Even if you are a discretionary trader, extensive testing and investigation is an absolute must for short term trading. Whilst I have my own set of triggers to enter a trade which doesn't generally change that much, I'm also running the kind of analysis that'll be outlined below to help fine tune things/ find a bias for general market direction/keep track of the way the market is changing over time.

General idea is this: find a pattern/point of interest in price,volume,range, breadth,etc and then test it out as a buy signal. Instead of looking at a pattern and using a predefined exit to go along with it, the performance of the market following the pattern is logged to get an idea of what can be expected.

Generally, I'll use amibroker for this type of thing, but there's no reason why it couldn't be done in excel either.

So, onto a basic test. If we have a look at Friday's bar for the S&P500, we can see that it was an inside day(see chart here). So our first test will be to see if an inside day has typically lead to any strength or weakness in the past. So we will code up an inside day and run it as the buy signal by itself, and see how the market has performed 'x' amount of days out from one. Results below:

8 inside day.png

The left hand column is the number of days after an inside day has occurred, the rest should be self explanatory(for those who don't have ami, the payoff ratio is simply the avg win loss ratio).

Whilst that is interesting, we need something to compare it to. It's all well and good to say that 5 days out from an inside bar, there is a 55% chance that the market will be higher than it is now, but how does that compare to any old 5 day period? Results for that below:
1 random.png

If we look 5 days out here, results are pretty similar. Comparison of the two tests below:
2 inside day.png

There really isn't that much of a difference there at all. By itself, the inside day doesn't really add any kind of value as a standalone indicator of upcoming strength or weakness.

Another way of looking at these types of things that can impact on the results is the general positioning of a bar relative to where the market has been recently. Is the pattern occurring at a relatively high or low level? Are we in an uptrend or a downtrend? And on and on we can go. So for a few more tests to look a little further. In this instance, we have had an inside day that has occurred after the market was printing new lows. So to investigate further we'll go and test it out.

The next test:Today was an inside day after the market traded at it's lowest price over the past 20 bars yesterday. Buy today's close. Results out 'x' days from the signal below(the benchmark average on the right)

3.png

What stands out here is the relative outperformance immediately following this pattern, and that it falls away after that. Whilst I wouldn't exactly classify this as a strong upside edge for the following few days, it is slightly better than average over the short term and worth noting. The fact that it falls away quite quickly after that is also worth paying attention to.

To continue on looking at the positioning of the market, lets have a look at how an inside day performs at a relatively higher price. This next test will look at how the market performs after it made a fresh 20 day high before the inside day. I've left the test at a low point next to it, and the random average on the right to help compare:
4.png

Now it's starting to look interesting. Whilst the test for an inside day at new lows shows the potential for some strength immediately before returning to not being any kind of a signal at all, when it happens after the market makes short term highs, we can see slight underperformance 1-9 days out, before it outperforms the average from 10-20 days.

Have hit my attachment limit, so will post the rest in a minute.....
 
So we have a pattern that by itself is of no real interest, starting to show some differing results when looked at in different ways.

So the question then becomes why?

The inside bar by itself doesn't really show much in the way of performance(good or bad), so the difference in performance could have come from looking at the general positioning of the market at the time. To test that out, let's run a test with no individual pattern on any one bar, and have a look the general positioning of the market. If a test on the way the market behaves solely based on where it's currently positioned shows similar results to the prior test that combined market position with the inside bar, then we'll know that the inside bar is not worth paying any attention to whatsoever.


The next test: Today we printed a fresh 20 day high or low. Results out 'x' days below:

5.png

So we can see here that there is a fair difference in the way the market generally performs here. On face value it would appear that if you have a timeframe of 1 day to 4 weeks, then you'll be better off looking for short term weakness instead of looking to buy breakouts(that's another topic altogether though;)). Whilst this is all very interesting, it doesn't fully explain the results when combined with the inside day study above.

The chart below compares buying an inside day after a 20 day low with just buying any 20 day low:

6.png

Once again, it's showing the potential for short term strength, and longer term mild weakness, even when compared with buying any old short term low. So there may actually be something to it:2twocents

And now on to comparing high prices:

7.png

This is also showing up some interesting results. When you see a new 20 day high being printed, the expectation was for the market to underperform, but when the market makes a new short term high and then pauses by printing an inside day, this underperformance only seems to be in the short term before it begins to exhibit some fairly decent follow through.

So here we are after running a couple of tests on a rather basic chart pattern and looking at it from a couple of different angles, and there are a couple of interesting patterns/scenarios to look out for.


Hopefully my ramblings here have made sense:eek:

All thoughts, comments and criticism welcome:)
 
Interesting Prof

Some input from me.

Inside days which follow very high volume are the ones to be interested in.
Once the inside day is printed THEN (Regardless of wether the inside day is on an up or down bar) A long trade is taken if the high is taken out and a Short trade if the low is taken out---stops are at the opposite end of the inside bar - 1 tick.

Can you test this?
 
Interesting Prof

Some input from me.

Inside days which follow very high volume are the ones to be interested in.
Once the inside day is printed THEN (Regardless of wether the inside day is on an up or down bar) A long trade is taken if the high is taken out and a Short trade if the low is taken out---stops are at the opposite end of the inside bar - 1 tick.

Can you test this?

Probably couldn't test it out down to that kind of accuracy tech, my coding skills are rather average:eek:

Just to clarify a little, this type of analysis is largely a supplement to my regular trading(which is still a discretionary method), I'm looking at generating a hypotheses here, not trying to build a mechanical system.

Good that you mentioned volume though, as it does come into play quite a bit, and something I'll get into a bit later on. I didn't mention it or include it at all for the posts I made today, I was mainly trying to demonstrate the basic process involved and then see how things develop from there based on any response.

Cheers
 
Interesting Prof.

I find inside days useful after a run in prices. In your testing you are testing just 20 day highs and 20 day lows, however how it actually gets to those lows may reveal some interesting results. For instance if the new 20 day low was after only 3 or 4 days down, ie a big move, may have totally different results to something that has been going down gently for the last 10-12 trading days.

In other words is the inside day just a breather in a fast downwards move or is it at the exhaustion of a slow move. My research shows there is a big difference, but it is not done on a computer, maybe you could work out how to test it. I'm not very computer literate.

brty
 
Interesting Prof.

I find inside days useful after a run in prices. In your testing you are testing just 20 day highs and 20 day lows, however how it actually gets to those lows may reveal some interesting results. For instance if the new 20 day low was after only 3 or 4 days down, ie a big move, may have totally different results to something that has been going down gently for the last 10-12 trading days.

In other words is the inside day just a breather in a fast downwards move or is it at the exhaustion of a slow move. My research shows there is a big difference, but it is not done on a computer, maybe you could work out how to test it. I'm not very computer literate.

brty

An interesting take brty, and I definitely agree with you, how the market behaves leading up to a particular pattern(not just an inside bar) can have a dramatic impact on how a market behaves going forward. The example I gave earlier(putting the inside bar into context of how the market is positioned prior to it happening) was an attempt to illustrate something similar:)

Additional layers, such as the Rate of change of the preceeding few bars leading up to the inside bar would be one way of looking at this in a little more detail. Might be something to put on the to do list for the time being and have a look at later on.

Before this turns into a thread about inside bars, I'll throw something else into the mix.

When we made fresh lows last week, it was the 9th consecutive close that we had made below the 5 period moving average. Downside momentum like this without any kind of rally is something that we don't see to often.

Here's a little setup that I've basically copied off Rob Hanna over at Quantifiable Edges

Discussion on his time stretch system:

http://quantifiableedges.blogspot.com/search/label/Time Stretch

Basic setup I'll show here is this - we have just made a fresh 20 day low, and price has closed below the 5 day MA for the 9th consecutive day. Buy at the close of price on the 9th day, and sell when price closes back above the 5 day MA. Results are from 1990 until now, and it also has a 3 day time exit attached to it, ie if the market doesn't snap back quickly, then head for the hills!

Results below
10 - time stretch.png

What's interesting to note here, is that there have only been 19 times in the past 20 years where there has been such downside momentum in the market. With nearly 75% winners, this "system"(which I would never actually trade) is suggesting that there is a bounce coming. Considering that the average winning trade is in the market for less than 3 days on average, it's only looking for a short term bounce, and that's all that comes a lot of the time too.

This little number also lines up with the look at inside bars I went into this morning too: It looks like there is the distinct possibility for a bounce here, but both studies show that any bounce may be a short lived one:2twocents
 
Have been having a look at the charts from last night, wasn't exactly an awe inspiring performance after the US open!

Looking at the SPY, and found that a gap and fade day like we saw last night coming off a recent low hasn't exactly shown much in the way of bullish tendencies going forward. Chart below showing results:

11 gap and fade off a recent low.png

What was interesting though was when you filter the results based on volume. Out of the 30 results above only 8 of those gap days have occurred on higher vol than the day before. Of those 8 instances, 7 of them were trading higher after 3 days. So the bounce still may be on, but isn't exactly looking strong here.
 
Have been having a look at the charts from last night, wasn't exactly an awe inspiring performance after the US open!

Looking at the SPY, and found that a gap and fade day like we saw last night coming off a recent low hasn't exactly shown much in the way of bullish tendencies going forward. Chart below showing results:

View attachment 37809

What was interesting though was when you filter the results based on volume. Out of the 30 results above only 8 of those gap days have occurred on higher vol than the day before. Of those 8 instances, 7 of them were trading higher after 3 days. So the bounce still may be on, but isn't exactly looking strong here.

Ill throw something at you.
Open of trading has people covering O/N positions so if it was weak then longs will be covered so lots of selling.
If its likely to continue long then selling will be muted so fading that would be even more likely than fading high volume
The givaway today was the near Double top and the open low being taken out.
Subsequent lower lows just keep mounting up.
Ive been short again since 4260.
Will remain there.
 
Good idea for a thread Prof.

I used to do quite a bit of this type of testing on the XAO/BHP/RIO/CBA when I was trading stocks and the SPI more often then I am now but unfortunately I'm out of touch with most of it atm and it will take me a while to dig it all out.

I tested quite a few different things, how price reacted after:
3,5,10 days up/down in a row
certain % moves
moves to/from certain indicators I use
And a range of other patterns or ideas.

I then added different filters like overall trend, short term trend, exits after 1,3,5,10 days things like that as well as ideas around my custom built indicators. It is amazing how results change when certain filters are added.

While it didn't provide me with a lot of specific trade set ups (although I did get a few), it did provide me with invaluable information about how the market moves which would give me a heads up to be looking for longs/shorts or when to be giving certain patterns a miss.

Most people get caught up looking for specific patterns to trade without really having an understanding of how other market conditions affect that particular pattern and end up trading a pattern that might have a 70-80% win rate in certain conditions when it has only a 20-30% win rate in not so favourable conditions.

IMO understanding how the market moves is more important and beneficial then looking for Head & Shoulder patterns, triangles and all the regular TA crap that doesn't really provide any sort of decent edge.
 
Good thread prof.
I am a little concerned you are taking up bandwidth with a thread not dedicated to bashing the PM, but I'll take it :D.

Not sure how many people here use this type of analysis or not, so thought I'd throw something out there and see what bounces back:)

Must admit this sort of thing is not my cup of tea. It has been successful for many people though, Toby Crabel comes to mind. Anyway, some disjointed thoughts follow, read or disregard as you see fit.

Have a look at popular patterns and what are the results if you fade them? Some books are very popular and promote certain patterns as being reliable and profitable etc. Might be helpful to actually test these patterns, see how reliable and profitable they actually are, and if fading them is more reliable and profitable. I am also a fan of the short-term … patterns can ‘work’ if you don’t slavishly follow a ‘let-your-profits-run’ rule (apologies to all for the sacrilege, I will wear a hair shirt and abstain from chocolate for a month because of this outburst), or trade in and out of the position while the momentum ebbs and flows in your direction (this is really easy to say :D).

The other thing that comes to mind is to look at the really, really, really popular patterns (head and shoulders, triangles, wedges, the sort of thing you find in the books from Guppy, Bedford, etc.) and see how the market responds to these patterns. Failed head and shoulders, for example, can be a tremendous source of information about what direction the flows are in the market.
 
Good idea for a thread Prof.

I used to do quite a bit of this type of testing on the XAO/BHP/RIO/CBA when I was trading stocks and the SPI more often then I am now but unfortunately I'm out of touch with most of it atm and it will take me a while to dig it all out.

Cheers mate, look forward to hearing some alternate views on this type of thing:)

Good thread prof.
I am a little concerned you are taking up bandwidth with a thread not dedicated to bashing the PM, but I'll take it :D.



Must admit this sort of thing is not my cup of tea. It has been successful for many people though, Toby Crabel comes to mind. Anyway, some disjointed thoughts follow, read or disregard as you see fit.

Have a look at popular patterns and what are the results if you fade them? Some books are very popular and promote certain patterns as being reliable and profitable etc. Might be helpful to actually test these patterns, see how reliable and profitable they actually are, and if fading them is more reliable and profitable. I am also a fan of the short-term … patterns can ‘work’ if you don’t slavishly follow a ‘let-your-profits-run’ rule (apologies to all for the sacrilege, I will wear a hair shirt and abstain from chocolate for a month because of this outburst), or trade in and out of the position while the momentum ebbs and flows in your direction (this is really easy to say :D).

The other thing that comes to mind is to look at the really, really, really popular patterns (head and shoulders, triangles, wedges, the sort of thing you find in the books from Guppy, Bedford, etc.) and see how the market responds to these patterns. Failed head and shoulders, for example, can be a tremendous source of information about what direction the flows are in the market.

Timmy, feel free to bang in some PM bashing comments if you want, but being the strategies forum and considering the theme of this thread, you need to test out your ideas. Good luck getting past the security guys in the caravan:p:**

**disclaimer: I in no way condone the hitting of a woman, no matter what the colour of her hair is

Haven't tested out any of the more traditional/popular patterns like the ones you've mentioned, honestly I wouldn't know where to start when it comes to coding up something like a H&S or a triangle:dunno: Would love to see some results from anyone who has though.

I'm much more likely to view, say, the break of a down sloping triangle thingy-ma-jig as a break to new 'x' day lows('x' changing depending on what kind of state the market is in, hope that makes sense) and test from there. Partly due to me predominantly trading indicies(or is that indexes??) and not really feeling comfortable with the lengthy stories about battles between buyers and sellers, or guppies and sharks, that accompany the description of these types of patterns, and partly due to my average coding skills.
 
Interesting day's trade on the US markets o/n. We've had a 2 day rally and have closed back above the 5 day MA, so the initial studies I posted in this thread aren't really valid going forward, neither of them really showed anything interesting going out more than a couple of trading sessions:2twocents

Now, on to today's rally. It was up in the top ten for largest daily moves since the March 2009 bottom, which considering the amount of upside momentum shown since then, says quite a bit.

So, for a bit of testing. Firstly 3% up days.

12 3% up days.png

Note the differences in performance highlighted going out a few trading sessions. The first test includes the recent rally, results are even more skewed to short term weakness if you run the test up to the 2009 rally without including it.

What stood out for me when having a quick look this morning was that we had a 3% up day without any considerable gap up to get it going.

So I filtered the results and had a look at 3% up days that didn't gap up by more than 0.5%. Today was the first time that's happened since March 09, and when it happened twice in March 09, the market was in the process of making a 20+% move in roughly 3 weeks:eek:

So to have a look at results of a 3% day where we don't gap up by more than 0.5% on the open:

13 3% days.png

Results start getting interesting. It would appear that there is the potential for today's move to exhibit some degree of follow through in tonight's session before we pause, and possibly selloff the following day.
 
Nomore4s,

Most people get caught up looking for specific patterns to trade without really having an understanding of how other market conditions affect that particular pattern and end up trading a pattern that might have a 70-80% win rate in certain conditions when it has only a 20-30% win rate in not so favourable conditions.

IMO understanding how the market moves is more important and beneficial then looking for Head & Shoulder patterns, triangles and all the regular TA crap that doesn't really provide any sort of decent edge.

One of the best statements ever written on this, in this forum, or any forum.

As an example, I use support and resistance in my trading, you find a lot of this in the literature, but never does the literature separate different types of support.

I have/use what I call 'good support', it is bottoms in the recent uptrend. The time frame of 'recent uptrend' is hard to exactly define, a series of higher highs and higher lows in the time frame I wish to trade is how I actually use it. Instantly I have transformed a so-so technical tool into something that is differentiated into what performs better 'sometimes' (actually a lot of the time).
Then the trick is to work out when it performs better or worse. For me that is when something 'meanders' back to the support level, rather than accelerates to it, again working out how the market really works.

brty
 
Nice thread prof... thanks for the effort.

I think there is a book called The Encyclopedia of Chart Patterns which detail common patterns and what probabilty of success (however that is defined in each case) for them. But this type of analysis/observations need three more ingredients before they become valid tradable strategies.

1. Understanding the wider context where the pattern occur - bear market vs bull market, big events coming up that could fuel rallies / reverse trends, breath of advance, presence of gap etc...

2. Managing the risk - it's no different to trading seasonality. It's easy to calculate max adverse excursion, but quite another to find the right place for risk/reward.

3. Knowing when the strategy is no long valid - like the SPI tend to rise btw 4-4:30pm during a severe bear market, but doesn't seem to be doing that anymore... At what point do you draw the line?? https://www.aussiestockforums.com/forums/showthread.php?t=13387

Being able to run the analysis makes a good analyst. But it takes at least 3 more ingredients to make a decent trader.

What stood out for me when having a quick look this morning was that we had a 3% up day without any considerable gap up to get it going.

So I filtered the results and had a look at 3% up days that didn't gap up by more than 0.5%. Today was the first time that's happened since March 09, and when it happened twice in March 09, the market was in the process of making a 20+% move in roughly 3 weeks:eek:

So to have a look at results of a 3% day where we don't gap up by more than 0.5% on the open:

View attachment 37819

Results start getting interesting. It would appear that there is the potential for today's move to exhibit some degree of follow through in tonight's session before we pause, and possibly selloff the following day.

Very interesting observation. I am with you the absence of gap makes this 3% day significant. We are running into profit season and prices going up leading into the results is often telling...
 
Nomore4s,



One of the best statements ever written on this, in this forum, or any forum.

As an example, I use support and resistance in my trading, you find a lot of this in the literature, but never does the literature separate different types of support.

I have/use what I call 'good support', it is bottoms in the recent uptrend. The time frame of 'recent uptrend' is hard to exactly define, a series of higher highs and higher lows in the time frame I wish to trade is how I actually use it. Instantly I have transformed a so-so technical tool into something that is differentiated into what performs better 'sometimes' (actually a lot of the time).
Then the trick is to work out when it performs better or worse. For me that is when something 'meanders' back to the support level, rather than accelerates to it, again working out how the market really works.

brty

Just so I'm clear brty, you prefer price to meander back to the support, or accelerate down into it?
 
Meanders prof.

Think of a car cruising down the road looking for a side street, or a place to u-turn, in the fog. If it is accelerating when it gets there, it is very hard to stop and turn, often goes to the next opportunity.

Yet if the same car is going very slowly, relative to its normal speed, then it is much easier to change directions.

brty
 
Nice thread prof... thanks for the effort.

I think there is a book called The Encyclopedia of Chart Patterns which detail common patterns and what probabilty of success (however that is defined in each case) for them. But this type of analysis/observations need three more ingredients before they become valid tradable strategies.

1. Understanding the wider context where the pattern occur - bear market vs bull market, big events coming up that could fuel rallies / reverse trends, breath of advance, presence of gap etc...

2. Managing the risk - it's no different to trading seasonality. It's easy to calculate max adverse excursion, but quite another to find the right place for risk/reward.

3. Knowing when the strategy is no long valid - like the SPI tend to rise btw 4-4:30pm during a severe bear market, but doesn't seem to be doing that anymore... At what point do you draw the line?? https://www.aussiestockforums.com/forums/showthread.php?t=13387

Being able to run the analysis makes a good analyst. But it takes at least 3 more ingredients to make a decent trader.



Very interesting observation. I am with you the absence of gap makes this 3% day significant. We are running into profit season and prices going up leading into the results is often telling...

Cheers skc, thanks for the post, all very relevant points:)

Have heard of that book but haven't read it, would be interesting to see how they tested it(if it's going through charts manually think I'll give that sort of testing a miss:eek:)
 
Meanders prof.

Think of a car cruising down the road looking for a side street, or a place to u-turn, in the fog. If it is accelerating when it gets there, it is very hard to stop and turn, often goes to the next opportunity.

Yet if the same car is going very slowly, relative to its normal speed, then it is much easier to change directions.

brty

Cheers brty:)

I have found similar. In the US indicies, when looking at a set of consecutive falls as a buying trigger, results have been better in the short term(roughly 3-6 days out) when you look for the recent falls to be a smaller % than the previous one.
 
Think of a car cruising down the road looking for a side street, or a place to u-turn, in the fog. If it is accelerating when it gets there, it is very hard to stop and turn, often goes to the next opportunity.

Yet if the same car is going very slowly, relative to its normal speed, then it is much easier to change directions.

brty

Unless you see the guy who yanks the handbrake at high speed and it turns and goes back just as fast :D ;)
 
Nomore4s,



One of the best statements ever written on this, in this forum, or any forum.

As an example, I use support and resistance in my trading, you find a lot of this in the literature, but never does the literature separate different types of support.

I have/use what I call 'good support', it is bottoms in the recent uptrend. The time frame of 'recent uptrend' is hard to exactly define, a series of higher highs and higher lows in the time frame I wish to trade is how I actually use it. Instantly I have transformed a so-so technical tool into something that is differentiated into what performs better 'sometimes' (actually a lot of the time).
Then the trick is to work out when it performs better or worse. For me that is when something 'meanders' back to the support level, rather than accelerates to it, again working out how the market really works.

brty

A very important and misunderstood aspect of trading.

Nice hint brty

One of mine is finding old resistance acting as support and this one.
 

Attachments

  • S and R.gif
    S and R.gif
    34.9 KB · Views: 18
Top