Automated Trading Machine (ATM) makes it simple to remove fear and greed from your trading. Automated trading is no longer just for the rich or nerdy. Our revolutionary software runs on your computer, using your trading rules, but none of your emotions. There's just one requirement - you know how to use a mouse. Learn more...
Help with Coding/Formulas and sets of rules for Patterms
- Login to post comments
This disussion is for help creating coding/formulas for the program but we all need to come up with a set of rules for Double bottoms, tops, head and shoulders bottom and top , flags, pennants, cup and handles, accending triangles and more. Together we can create a set of rules for each pattern that can be converted into coding for the software.
Recent blog posts
- New Release: v3.0.3 - Everything Except Autotrading
- Mid July 2010 Update
- Start of June 2010 Update
- New Release: v3.0.2 - Copy, better error message, more options
- New Release: v3.0.1 - The Stabilise-ening
- Ah, The First Bug [Fixed in v3.0.1]
- New Release: v3.0.0 - The Rewrite
- Start of February 2010 Update
- End Of 2009 Update
- New Release: v2.0.10
Recent comments
- good choice
21 weeks 2 days ago - Hello and welcome. I will
36 weeks 3 days ago - Of course...
42 weeks 1 day ago - Easy one (hopefully). You
42 weeks 1 day ago - Thanks for that. I learnt
48 weeks 5 days ago - Oops!
50 weeks 12 hours ago - Changing the windows date
1 year 4 weeks ago - Interesting problem you have
1 year 4 weeks ago - You want to use the Value of
1 year 7 weeks ago - A tick backtester will do it
1 year 12 weeks ago


First let me say congratulations on the summary of the task at hand. Brilliantly and succinctly worded.
But now let me explain the problem in the only way that I know how - with too much information :-)
Indicators are mathematical equations. The high/low/open/close/volume are all just numbers that feed into these equations. A simple moving average (SMA) over the last 20 bars is just the sum of those 20 values, divided by 20. The relative strength index (RSI) is a little bit more complicated, but it's the same theory.
Then we come to patterns. Patterns are normally easier for the human brain to interpret than a computer. We're really good at finding order amongst chaos. Captcha is a good example.
Candlestick patterns are already offered in ATM, but are calculated a little differently to the patterns mentioned in the original post. Candlestick patterns consist of sometimes just 1 bar, sometimes 2, 3, maybe 4. All of the bars that make up a candlestick pattern are next to each other. And candlesticks already have defined rules that can be resolved by a computer.
The patterns we're talking about here are harder for a computer to decipher. Take the head and shoulders pattern - it could consist of between 20 and 200 bars (or more). A lot of those bars are just noise. The line defining the shoulders could be horizontal or at an angle. The distance between the head and shoulders could be of varying size.
Double-top means that the price reached some level (X), fell away, went back to somewhere close to the original level (Y), and fell away again. X and Y don't have to be exactly the same. How much variation is ok? How far does the price have to fall away? How many bars have to be between the two peaks? How many bars are allowed to be between the two peaks?
A human can look at the chart and spot these patterns instantly. But to get a computer to do it, all this tiny detail has to be worked out. We can't tell a computer to "find a double-top", but we can give it a series of rules which we decide equals a double-top.
For example, an uptrend is a pattern too. We can look at a chart and normally determine if the chart is in an uptrend or not. But we can't tell the computer to find us an uptrend. We can however, decide that the close of the bar being above the SMA(20) equals an uptrend, and the computer can calculate that for us easily.
This thread is to generate some discussion as to what the series of rules should be for each of the patterns listed in the original post (and more if there are more). I suggest writing the pattern name in bold to make it easy to keep track of who's talking about what. Links to other websites with helpful info would also be appreciated.