Automatic Pattern Search

My system is a mix of regular and delayed entry patterns. I calculate the probability of a trade using a formula from statistics and based on signals delivered by the delay entry patterns followed by the regular patterns. In addition I have added two more TA indicators for confirmation and this works very well.
Ron

Ron, can you please explain why you consider first the delayed signals and then the normal ones, instead of the other way around?

I worked on a similar system in the past with the delayed signals used for confirmation. I am still monitoring the signals and it is doing well. I may start trading with it soon.

Alex
 
I need some help from APS experts: what values should I enter in the T/S file if I want APS to search for patterns in intraday forex data (eurusd) with 25 pip profit target and stop loss?
 
Sounds like a good approach. I would also recommend delayed entry patterns. After a lot of work I was able to get a good number of patterns for 15 min timeframe in EURUSD and 2 other pairs. Please allow me not to reveal my targets.

My system is a mix of regular and delayed entry patterns. I calculate the probability of a trade using a formula from statistics and based on signals delivered by the delay entry patterns followed by the regular patterns. In addition I have added two more TA indicators for confirmation and this works very well.

Keep in mind that to find a sufficient number of statistically significant 15 min patterns you need to search historical data with at leat 50,000 bars. The shorter the time frame the more bars you need in the file to get significant results. This takes a lot of time and I am seriously considering getting a quad core CPU machine and 4 APS licenses to run in parallel. The cost will be about $5,000 I was told by sales at tradingpatterns.com but if the system performs as expected I can recover it after a few trades.

Ron


I havent looked much at delayed patterns yet but as Alexander has mentioned wouldnt you be looking for signals given by the normal patterns followed by the delay patterns?

I experimented with a 20 pip profit/stop loss on EURUSD 15 min data with 70% profitable trades. I used 2006 data and set the number of search bars as 5000, the total number of bars in the dataset was much larger > 50000. APS does not seem to allow values for the search range >9999 so do you split your files when you talk about 50000 bars? I got 5 long patterns and 3 short patterns using a simple search (not extended). A trading system based on these patterns shows some profitably in the first quarter of 2007, the equity line is then flat for another 3 months, and steadily drops after.

I had some thoughts about your stats methods and came up with some ideas:

Event A = Regular entry signal
Event B = delay entry signal

Event C = A followed by B = A n B

Event W = winning trade

P(W|C) = P(W n C)/P(C)

P(C|W) = P(W n C)/P(W)

Simple form of Bayes' theorem: P(W|C) = P(C|W)P(W)/P(C)

Not sure how to use any of this and there may be a flaw in my logic but just throwing around a few ideas trying to think along the lines you mentioned. Any suggestions/comments welcome....

Its definately worth getting a quad core machine and the four licenses if your system performs. But are there are advantages of trading very short time frames over say >= 1 hour?
 
APS does not seem to allow values for the search range >9999 so do you split your files when you talk about 50000 bars?

Good post with nice ideas about using statistics. Excellent!

I think you do not need > 9999 bars in search range. I think search range is confusing label. It has do do with the most recent trade of found patterns and it must lie in the search range.

"This setting does not affect the number of price bars, or data file records, used when calculating the performance of patterns. APS uses all the available records in a data file to back-test patterns during a search and determine whether they fulfill the criteria specified on the workspace."

I was also confused but read this explanation first:

Using APS FAQ
 
Good post with nice ideas about using statistics. Excellent!

I think you do not need > 9999 bars in search range. I think search range is confusing label. It has do do with the most recent trade of found patterns and it must lie in the search range.

"This setting does not affect the number of price bars, or data file records, used when calculating the performance of patterns. APS uses all the available records in a data file to back-test patterns during a search and determine whether they fulfill the criteria specified on the workspace."

I was also confused but read this explanation first:

Using APS FAQ

Thanks, I read the help file and it makes more sense now. In a file containing one year of 15 minute forex data you have more than 60,000 bars so to ensure that the patterns you search for occur in the final month of the data a setting of 5000 for the search range would be required - 500 is possibly too restrictive for high frequency data but fine for daily data. I understand now that the entire file is used to search for patterns independent of the search range. Will continue playing around with the stats ideas to try and produce something useful....
 
Thanks, I read the help file and it makes more sense now. In a file containing one year of 15 minute forex data you have more than 60,000 bars so to ensure that the patterns you search for occur in the final month of the data a setting of 5000 for the search range would be required - 500 is possibly too restrictive for high frequency data but fine for daily data. I understand now that the entire file is used to search for patterns independent of the search range. Will continue playing around with the stats ideas to try and produce something useful....

How come you have more than 60,000 bars in one year of 15 minute bars?
There is 96 bars in a day. My provider gives me 24,934 bars for year to date.
Am I missing something?
 
How come you have more than 60,000 bars in one year of 15 minute bars?
There is 96 bars in a day. My provider gives me 24,934 bars for year to date.
Am I missing something?

Sorry I got my numbers wrong - I had 65000 bars in a file that had a couple of years data in it. EURUSD 15 min for 2007 gives me 24542 bars using the Metatrader platform. Thanks for pointing that out. So would require a search range of just over 2000 bars to cover the last month of data.
 
Its definately worth getting a quad core machine and the four licenses if your system performs. But are there are advantages of trading very short time frames over say >= 1 hour?

Good question. I think the answer is (probably) that on the contrary there are some disadvantages to that like the possibility of your stop getting hit during slow markets.

I will take a closer look at your probability equations and provide some comments. I also think that for about 25,000 bars a search range in the order of 4,000 bars is good enough. Maybe 2,000 bars is a bit restrictive.

As far as considering delay patterns first and then the ones without delay to calculate probabilities this is because I don't want to wait to execute the trade. However, I will run some tests with the reverse conditions as Alex pointed out.

mballagan, I think with just a few patterns it is very difficult to come up with a statistically significant system. If you cannot run an extended search due to execution time limitations try combining different timeframes. For example:

- 1 hour determines the trend
- 30 min is used for confirmation
- 15 min (I prefer 20 min by the way) is used for trade entry along the direction of the trend.

To me, this is the real power of APS, i.e. the ability to run different timeframes and configure different systems in just a few hours.

By the way, Michael Harris talks about timeframe combinations in his new book I don't recall the chapter but it was one of the best ideas I've ever come across.

Ron
 
Hi,

I am trying the latest APS demo version with the following parameters:

QQQQ last 10 years of daily bars. Total 2402 bars.
Split the file in two parts 80% for pattern search and 20% for forward testing:
So file #1 has 1921 bars, file #2 - 481 bars.

T/S file: 7,7
Exits: %
Inputs: Open
Delay: Off
Profitable for long: > 0.66
Profitable for short: > 0.66
Trades: > 20
Max conseq losers: < 4
(By the way, in my demo it says "conCecutive", which is strange for 7 y.o. product)

Search range: 500
Extended search: ON
Incl patts w/equal values: Off

2 hours later it found 39 patterns

Then I backtest each pattern using my second data file.

18 patterns remain profitable,
14 turned into losers
7 become even

So overall, the whole system become neutral.

I'd like to hear your comments





Further testing results:

same parameters as in first test, but Trades: > 30

(so now my parameters are the same as in the article Tradingpatterns.com Michael Harris article

8 patterns found

in forward test: 6 turned into losers, 1 remained profitable and 1 even
 
Last edited:
Hi,

I am trying the latest APS demo version with the following parameters:

QQQQ last 10 years of daily bars. Total 2402 bars.
Split the file in two parts 80% for pattern search and 20% for forward testing:
So file #1 has 1921 bars, file #2 - 481 bars.

Ten years of data cannot be just 2402 bars. You are probably missing about 150 data points.

Anyway, your results do not agree with the results shown here:

Tradingpatterns.com Michael Harris article

Concecutive:) I haven't even noticed that but a google search shows some people spell it that way. Here's an example:

WikiAnswers - What is the most concecutive home runs

I will run some QQQQ tests and report back.
 
Hi,

I am trying the latest APS demo version with the following parameters:

...........

8 patterns found

in forward test: 6 turned into losers, 1 remained profitable and 1 even

I just did the same test with the latest APS demo.

I used the QQQQ data file that came with the demo. I created 2 different files in 2 different directories as follows:

In sample: 19920409 - 20060222

out-of-sample: 20060224 - 20080222

Results of extended search with the same parameters you used:

48 patterns found (not 8 as you say).

In out-of-sample testing:

33 winners, 2 of them with 100% success rate, 9 of them have a profit factor > 1.70. Excellent results!

15 losers: 7 of them only marginally with success rate 50%.

This means you are left with at least 33 patterns to play with.

Results for regular search:

9 patterns found.

6 Winners

3 losers

You must have done something fundamentally wrong to get the results you got.
 
I just did the same test with the latest APS demo.

I used the QQQQ data file that came with the demo.

Well, maybe there is a difference. You are using data that came with the demo.
I was using real life datafeed provided by Tradestation. Their date range starts from 03/10/1999. By the way Yahoo Finance provides historical prices for QQQQ starting from 03/10/1999 as well. There is total 2402 daily bars until 09/23/2008.
Can you try the demo with the same data range and confirm my results?

Thanks
 
Well, maybe there is a difference. You are using data that came with the demo.
I was using real life datafeed provided by Tradestation. Their date range starts from 03/10/1999. By the way Yahoo Finance provides historical prices for QQQQ starting from 03/10/1999 as well. There is total 2402 daily bars until 09/23/2008.
Can you try the demo with the same data range and confirm my results?

Thanks

Why try with your data range when I have more data to try it on?

It seems that your data range is small enough to filter good patterns out and to get patterns with bad performance in out_of_sample data. Not enough bars in your file.

Also, neither yahoo finance nor Tradestation are considered very reliable daily data sources.

If you have the demo like you said you can try it yourself. I have to prepare for tomorrow's trading, it will be a volatile day it seems.

I think you should not put blame on APS when it finds patterns that do not perform well in out_of-sample data. The program value is in identifying those bad patterns and keeping the good ones. Even if none of the patterns performs well out_of_sample this is still valuable information. It maybe that you have to change your risk/reward criteria, increase your in_sample or forget about this particular market all together and try something different.
 
Well, I tried QQQQ data included with the demo using same in-sample, out-of-sample ranges you have.
in sample: 48 patterns found.

out of sample:
Only 23 remain profitable, including 2 with 100% success rate.

Are you counting patterns that become even as winners also?

I don't understand how you got 33 winners.
 
Well, I tried QQQQ data included with the demo using same in-sample, out-of-sample ranges you have.
in sample: 48 patterns found.

out of sample:
Only 23 remain profitable, including 2 with 100% success rate.

Are you counting patterns that become even as winners also?

I don't understand how you got 33 winners.

I use the profit factor and not the success rate alone. If the profit factor is > 1 then the pattern is profitable.

Still, I would only select the patterns with profit factor greater than 1.50 for example to develop a more robust system and keep the remaining in a separate system to monitor their signals. Some of the losers may return to profitability.

There is all kinds of strategies you can try. If you add a few short-term trend indicators to the system you may be able to come up with a neat trend following system based on price patterns like the ones described in this paper by Michael Harris:

Tradingpatterns.com Michael Harris article
 
I'm interested in buying this product, but I was hoping that someone could run a scan for me before I make my decision.

Can someone run a scan on EUR/USD (daily) with a 100 pip sl/tp? I would like to see some out-of-sample results for the last 2 years if possible.

There is actually a forex signal provider who I believe utilizes this software to generate his systems: hytechfx.com

Unfortunately, the past results don't always compare to future results.

Any help would be greatly appreciated.

Thanks
 
I'm interested in buying this product, but I was hoping that someone could run a scan for me before I make my decision.

Can someone run a scan on EUR/USD (daily) with a 100 pip sl/tp? I would like to see some out-of-sample results for the last 2 years if possible.

There is actually a forex signal provider who I believe utilizes this software to generate his systems: hytechfx.com

Unfortunately, the past results don't always compare to future results.

Any help would be greatly appreciated.

Thanks

You can download the demo and do that yourself:

APS Automatic Pattern Search Demo

You can export free day forex data from MetaTrader.
 
Good question. I think the answer is (probably) that on the contrary there are some disadvantages to that like the possibility of your stop getting hit during slow markets.

I will take a closer look at your probability equations and provide some comments. I also think that for about 25,000 bars a search range in the order of 4,000 bars is good enough. Maybe 2,000 bars is a bit restrictive.

As far as considering delay patterns first and then the ones without delay to calculate probabilities this is because I don't want to wait to execute the trade. However, I will run some tests with the reverse conditions as Alex pointed out.

mballagan, I think with just a few patterns it is very difficult to come up with a statistically significant system. If you cannot run an extended search due to execution time limitations try combining different timeframes. For example:

- 1 hour determines the trend
- 30 min is used for confirmation
- 15 min (I prefer 20 min by the way) is used for trade entry along the direction of the trend.

To me, this is the real power of APS, i.e. the ability to run different timeframes and configure different systems in just a few hours.

By the way, Michael Harris talks about timeframe combinations in his new book I don't recall the chapter but it was one of the best ideas I've ever come across.

Ron

I ran an extended search on EURUSD 15 min data for the year 2007 (24542 bars) with a search range of 4000 and a target profit & stop of 25pips with a 70% profitable target.
This gave 38 long patterns and 9 short patterns. A trading system was created based on these patterns as following:

Buy if two or more long patterns occur at the same time (target/stop of 25 pips)
Sell if two or more short patterns occur at the same time (target/stop of 25 pips).

Testing this system on the Metatrader platform on EURUSD 15 min data from 01.01.2008 - 11.08.2008 produced an equity line that was largely flat in the first quarter of 2008, moved up slightly in the second quarter but then trended down ending in a loss. The amount of the loss depended on the lot size traded on each trade.

As mentioned before there are many ways of combining patterns to form systems and there may be better ways to combine the patterns to form systems such as using delay patterns. I created a similar system on EURAUD 4HR data with a 100pip profit/stop loss and entered this system into the Automated Trading Championship. The patterns were extracted on data from 01.01.2008-19.10.2008. Unfortunately the system has lost money in simulated trading down from $10000 to just over $1000 in 10 days and will probably be eliminated from the competition.

I havent yet looked at the idea of multiple timeframe confirmation using APS but will explore this idea. So far I have not managed to achieve the kind of success you have described using APS patterns.

The other thing I have noticed is that the number of long or short pattens found by APS will depend on the trend of the market during the period being sampled. So for example the EURUSD was trending largely upwards in 2007 hence many more long patterns found than short patterns in the pattern search I described on EURUSD 15 min data.

This could cause problems if the market trend changes so for example the EURUSD went largerly sideways from March 2008-July 2008 and then trended down after. So if you have a system biased by a greater number of long patterns you may lose money in a falling market. My conclusion is there should be a way of determining the trend of the market before executing a trade based on a long or short pattern signal. I suppose the multitimeframe idea you have mentioned may be the way to do this.
 
I created a similar system on EURAUD 4HR data with a 100pip profit/stop loss and entered this system into the Automated Trading Championship. The patterns were extracted on data from 01.01.2008-19.10.2008. Unfortunately the system has lost money in simulated trading down from $10000 to just over $1000 in 10 days and will probably be eliminated from the competition.

There are roughly 10 x 4 x 5 x 6 = 1200 4H bars in that period.

This is a number that is very small for statistical analysis purposes. You need to consider a time span where there is at least one primary uptrend and a primary downtrend and extract your patterns from there. In this way you cover both longs and shorts.

I hope the 10K was virtual money because a 90% loss in 10 days/4H bars is a clear indication of overtrading and non-existent risk management. Basically, in 60 bars you lost 90% of your account. Based on your pip stops I will assume that each trade was closed in maybe 2 to 3 bars minimum. I will also assume that you stayed flat for at least 1 bar so this sums up to about 4 bars.

Summary: I estimate that in about 15 trades or less you lost 90% of your account. This is not related to trading technique but to risk management. Your loss shouldn't have exceeded 15 - 20% max drop from high mark.

I risk 0.5% of my account on each trade and in your case that would account to maybe a 10% drop and you would have plenty of time to change/modify system and maybe end up with making a profit.

Risk management is more important that trading system. System may be good but in the process of experiencing a drawdown and if one is overtrading often it is given no chance of recovering.
 
Top