Pattern Recognition/Computer Artificial Intelligence

How do you know when a trend has started? Ended? This forum is for discussions about trend indicators and signals.
Post Reply
jklatt
Roundtable Fellow
Roundtable Fellow
Posts: 79
Joined: Sat Feb 17, 2007 11:51 am

Pattern Recognition/Computer Artificial Intelligence

Post by jklatt » Mon May 26, 2008 2:22 pm

Does anyone have any experience in this area?

There is a specific pattern that I really like to trade and it has worked rather well on a discretionary basis, but the pattern comes in similar yet different shapes and sizes and it's time consuming to flip through a lot of different charts and timeframes looking for this pattern. I also miss out on some (probably a lot more than I even realize) of the setups because I simply didn't look at that specific trading vehicle or that specific timeframe.

What I'm looking to do is something similar to teaching a computer to recognize the number "8". There are a lot of different ways the number 8 can be written (by humans and by computers -- all of which are valid "8"s) and the computer needs to be "taught" what is an "8" and what isn't in order to be able to scan through the data and find the pattern.

I'm not sure where to start when it comes to tackling this problem so I thought I'd write a post here to see if anyone might have some thoughts or be able to give me a nudge in the right direction.

sluggo
Roundtable Knight
Roundtable Knight
Posts: 2986
Joined: Fri Jun 11, 2004 2:50 pm

Post by sluggo » Mon May 26, 2008 2:28 pm

If you are thinking about paying someone to help you with the job, a visit to this web page might provide a lead: http://www.tradingblox.com/tradingblox/ ... rtners.htm

7432
Roundtable Knight
Roundtable Knight
Posts: 199
Joined: Wed Dec 31, 1969 7:00 pm
Location: sandy, ut

Post by 7432 » Mon May 26, 2008 5:07 pm

or maybe these guys already have your pattern, or something close, in their system.

http://www.autochartist.com/index.htm

teppum
Contributor
Contributor
Posts: 3
Joined: Tue Sep 08, 2009 3:12 am

Post by teppum » Mon Sep 14, 2009 9:35 am

You need to break down the elements that make up that number 8. For example a Hammer candlestick pattern can be broken down into where along the days range the high and low fall. I would say for example that the open was within the top 5% of the range and the close was lower than the open but within say the top 25% of the days range.
You could then tell it to look for such candles after a downtrend. The downtrend could be signified in any way you like such as is the close more than x number of ATR's below n number of days ago close for example.
This is easy to programe in Visual Basic for example.

danZman
Roundtable Knight
Roundtable Knight
Posts: 117
Joined: Thu Mar 10, 2005 10:07 am
Location: Newport Beach,CA

Post by danZman » Tue Sep 15, 2009 4:45 am

I've been going over this problem as well. My original idea just caught the pattern over one time frame with very basic pattern matching definitions. Sort of a zig zag indicator where the computer looks for peaks and valleys on the charts...makes for simple recognition:

p1 < p2, p1 - v1 > (p2 - p3) * 2 etc...

I think the next step I will take is to find a book on OCR.

http://www.amazon.com/s/ref=nb_ss_0_17? ... +character

D[/url]

jklatt
Roundtable Fellow
Roundtable Fellow
Posts: 79
Joined: Sat Feb 17, 2007 11:51 am

Post by jklatt » Tue Sep 15, 2009 1:10 pm

I've actually been working on this the past few months.

I've been normalizing the data into coordinates on an imaginary rectangular "cork board" to mimic what I typically see on the screen when I look at a chart. From there, I looked at a lot of different charts and I took examples of the pattern I've traded/would have liked to have traded and plotted the data on the cork board. I then placed imaginary coordinate "pegs" in various spots on the cork board to get the general shape of the pattern and from there I've used some true/false statements to check and see if I have a valid pattern.

Then... I fed the pattern matching algorithm a lot of data. I used a range of 20 day to 240 day time frames across the all liquid portfolio and I got a lot of matches! The output took a while to create and it was a lot to digest in one sitting. So... since then I've backed off the range of time frames to a static 60 days and I've been making progress. The 60 day excursion ratio for the 60 day pattern across the all liquid portfolio is around 2.3. That's pretty good in my opinion and it's substantially better than anything I've found using moving averages and bbands and what not.

What I ultimately envision is checking to see if there is an edge at most of the time frames from 20 to 240 (or even higher) and blending these entries as they come in to generate positive expectancy trades with low correlated trade outputs. I think, in general, that's what one is really after.

sluggo
Roundtable Knight
Roundtable Knight
Posts: 2986
Joined: Fri Jun 11, 2004 2:50 pm

Post by sluggo » Tue Sep 15, 2009 2:00 pm

klatt_attack wrote:... to generate positive expectancy trades with low correlated trade outputs. I think, in general, that's what one is really after.
viewtopic.php?t=6880&highlight=

Post Reply