Price Patterns

520 views
Skip to first unread message

DaveA

unread,
Jun 9, 2012, 3:33:26 AM6/9/12
to Adaptrade Builder
I think the price patterns AB comes up with are very simplistic. I
work with very short term strategies exclusively and my partner works
on trend-following systems. I use another program called Price Action
Lab and my partner uses AB but we are both familiar with both
programs. Our aim is to develop a system that will perform well in
both choppy and trending markets. My partner selected only price
patterns from the indicator list and the program generated every time
very simple entry rules of the following form:

ntCondL = C[NL1] >= H[NL2];
EntCondS = L[NS1] <= H[NS2];

EntCondL = H[NL1] >= L[NL2];
EntCondS = H[NS1] < H[NS2];

EntCondL = L[NL1] <= C[NL2];
EntCondS = O[NS1] - O[NS2] <= H[NS3] - O[NS4];

EntCondL = L[NL1] - H[NL2] > H - L[NL3];
EntCondS = L[NS1] <= L[NS2];

For example, this is what I get for NinjaTradercode for the same
symbol and search parameters from Price Action Lab just for the long
entry part:

( High[1] > Close[2] && Low[2] > High[0] && Close[2] > Low[2] &&
Close[0] > Close[1] && High[0] > Close[0] && Close[1] > Low[0] &&
Low[0] > Low[1] ) OR ( High[2] > High[1] && Close[2] > Low[2] &&
High[1] > Close[2] && Low[2] > High[0] && Close[0] > Low[0] && High[0]
> Close[0] && Low[0] > Low[1] ) OR ( Close[0] > Low[1] && Low[2] >
Low[5] && Low[1] > Low[2] && Low[5] > Low[3] && Low[3] > Low[4] ) OR
( High[1] > High[0] && Close[0] > Close[1] && High[0] > Close[0] &&
Close[1] > Low[0] && Open[1] > Low[1] ) && Low[0] > Open[1] OR
( Close[0] > Close[1] && High[4] > High[3] && Close[1] > High[4] &&
High[3] > Close[2] && Low[4] > Low[3] ) && Close[2] > Low[4] OR
( High[1] > Close[1] && Close[1] > High[2] && High[2] > Close[2] &&
Close[2] > Low[1] && Low[1] > Low[2] && Low[2] > Close[0] && Close[0]
> Low[0] ) OR ( High[3] > High[1] && High[5] > Low[0] && High[1] >
High[5] && Low[4] > Low[2] ) && Low[0] > Low[4] OR ( High[3] >
High[2] && High[1] > Low[2] && High[2] > High[1] && High[0] > Low[0]
&& Low[2] > High[0] && Low[0] > Low[1] )

My question:

Is there an easy way to plug the patterns we get from Price Action Lab
into AB and let the latter program use those with our trend-following
indicators? Note that in the above example the individual patterns are
separated with an OR condition. If this is not possible we are even
thinking about a custom interface to accomplish this.What would
something like that involve in terms of time and money?

Mark Knecht

unread,
Jun 11, 2012, 12:14:57 PM6/11/12
to adaptrad...@googlegroups.com
Hi Dave,
I've been reading Al Brooks books (very hard reads from just a
reading POV) and have been trading Price Action by hand over the past
few months. It's interesting stuff. I also tried building some Price
Action only strategies in Builder and didn't have much luck.

My thought is to do some Price Action indicators in EasyLanguage
and then pass the indicator data to Builder as a custom indicator and
see what Builder does with that information. The problem with Builder
in this regard is it's a lot of work to pass in these indicators, but
it is possible. I don't expect to work on that much in the next couple
of week but my targets are the a few of the basic ideas in Brooks
books. TTBOMK Builder cannot today do anything more than what you've
discovered. I think that's consistent with what the Builder help file
says it does so I don't think it's a bug, just a limitation.

BTW - If you are the author DaveA then I quite enjoyed your book.
If not then no problem.

Cheers,
Mark

Michael R. Bryant

unread,
Jun 11, 2012, 12:16:20 PM6/11/12
to adaptrad...@googlegroups.com
You can get more complex patterns in Builder by increasing the tree depth.
In theory, Builder is capable of producing the same pattern you show from
PAL. However, I would be skeptical of a pattern that is so complex. It's
much more likely to be curve-fit than a simpler pattern. Generally speaking,
you would not want to restrict Builder to just price patterns, as that will
limit its ability to find good strategy logic.

Builder has a custom indicator feature that could enable you to enter the
price pattern you found in PAL into Builder. You can read about this feature
in the user's guide. I also have a video on the web site about it.
Basically, you would plot the PAL condition as a true/false indicator on the
TS chart and read it into Builder along with the price data.

Mike Bryant
Adaptrade Software

DaveA

unread,
Jun 11, 2012, 2:42:26 PM6/11/12
to Adaptrade Builder
Mike,

What I posted is not a single pattern but a number of patterns/
conditions connected with the OR operator. Actually I just noticed I
made an error when preparing the code and || must be used in the case
of NinjaTrader instead of the OR used when backtesting in Multicharts.
Anyway, PAL finds 10 - 15 patterns on the average per search given my
parameter settings and although one could use the custom indicator
feature that turns out to be a lot of work for 20 or more instruments.
I will try it for just one search output and see what comes out of it
and how much work it will involve at the end of the day. Thanks.

On Jun 11, 12:16 pm, "Michael R. Bryant" <m...@BreakoutFutures.com>
wrote:
> something like that involve in terms of time and money?- Hide quoted text -
>
> - Show quoted text -

Michael R. Bryant

unread,
Jun 11, 2012, 4:54:14 PM6/11/12
to adaptrad...@googlegroups.com
I understand. Builder uses "or" when constructing patterns, so it can come
up with patterns of that type. In other words, Builder would consider that
to be one large pattern.

Mike Bryant


-----Original Message-----

Subject: Re: Price Patterns

ZigZag

unread,
Jun 13, 2012, 8:49:42 PM6/13/12
to Adaptrade Builder
Dave
I had AB evolve a system on daily ES using only Patterns and At-Market
Entry and Exits and ATR stop and this is an excerpt of the resulting
code:
{ Entry and exit conditions }
EntCondL = O[NL1] - H[NL2] >= L - C[NL3];
EntCondS = H[NS1] <= L[NS2];
ExCondL = (((((L[NL4] < O[NL5]) or (L[NL6] < O[NL7])) and (L[NL8] >=
C[NL9])) or ((L[NL10] - O[NL11] < L[NL12] - O[NL13]) and (O[NL14] <
O[NL15]))) and ((((O[NL16] < O[NL17]) or ((((((L[NL18] - O[NL19] <
L[NL20] - O[NL21]) and (L[NL22] >= L[NL23])) and (((L[NL24] - O[NL25]
< L[NL26] - O[NL27]) or (O[NL28] - O[NL29] < L[NL30] - O[NL31])) and
(O[NL32] < O[NL33]))) or (L[NL34] < O[NL35])) and (L[NL36] >=
L[NL37])) or ((L[NL38] - O[NL39] <= L[NL40] - O[NL41]) and (L[NL42] <
O[NL43])))) and (L[NL44] - O[NL45] <= L[NL46] - O[NL47])) or
(((((L[NL48] - O[NL49] <= L[NL50] - O[NL51]) and (((((O[NL52] <
O[NL53]) or (L[NL54] - O[NL55] < L[NL56] - O[NL57])) and (L[NL58] -
O[NL59] <= L[NL60] - L[NL61])) or (((L[NL62] - O[NL63] < L[NL64] -
O[NL65]) and ((O[NL66] < O[NL67]) and (O[NL68] < O[NL69]))) and
(L[NL70] - O[NL71] < O[NL72] - O[NL73]))) and (L[NL74] < C[NL75]))) or
(O[NL76] < O[NL77])) and (L[NL78] < O[NL79])) and (O[NL80] <
O[NL81])))) and (L[NL82] - O[NL83] <= L[NL84] - O[NL85]);
ExCondS = O[NS3] < C[NS4];

Many of the numeric parameters for the number of bars to look back
(ie, NL1, NL2,...., etc) are the same.

IS equity curve looks good and OOS equity curve looks OK. If complex
patterns is what you are looking for, I think that the code above
would qualify.

I would attach the .gpstrat file but I am not sure how to do it here.

Rgds
ZigZag

DaveA

unread,
Jun 14, 2012, 3:02:03 PM6/14/12
to Adaptrade Builder


On Jun 13, 8:49 pm, ZigZag <leoja...@yahoo.com> wrote:
> Dave
> I had AB evolve a system on daily ES using only Patterns and At-Market
> Entry and Exits and ATR stop and this is an excerpt of the resulting
> code:

Thanks. However I have some problems with the code. As you can see,
the two entry conditions and the short exit condition are simple. It
is the long exit condition that makes use of a complicated function of
price patterns and that appears to me like a horrible fit. Usually,
people use price patterns for the entry part, not for the exit. It
seems to me that the system fits the returns to the simple long entry
signal using a group of complicated exit signals based on price
patterns that are fitted to the series.

Ask yourself a simple question: why is it that the long exit condition
is that complicated and the short is not. The first thing I look in a
system is reasonable symmetry. If the system lacks reasonable
symmetry, the probability it is fitted is not very high but maybe too
high. Especially in the case of ES, which is an efficient and liquid
market, symmetry should be expected. Regardless, I do not see the
meaning of that complicated exit function apart from it being a fit.

Michael R. Bryant

unread,
Jun 14, 2012, 3:32:00 PM6/14/12
to adaptrad...@googlegroups.com
I believe the point is that, unlike previously suggested, Builder is capable
of complex price pattern conditions. Whether you prefer them in entry or
exit is up to you. You can enforce symmetric long/short conditions by
clicking a check box option on the Strategy Options tab. Personally, I think
you would have to test any price pattern of that complexity very carefully
over many bars of data comprising many trades, including on true
out-of-sample data, to be confident it was not over-fit.

Mike Bryant

-----Original Message-----
Subject: Re: Price Patterns

Robert K

unread,
Feb 10, 2015, 6:57:17 AM2/10/15
to adaptrad...@googlegroups.com
Hi
This is a very interesting discussion as I am now weighing up purchasing both adaptrade and PAL. It would help my decision making greatly if I knew i could introduce some of the fidings from PAL into Adaptrade for further refining.?

It would be even better if I found out that adaptrade could be used to find the price patterns - as then I would buy Adaptrade alone

Lawrence Lewis

unread,
Feb 10, 2015, 8:10:56 PM2/10/15
to adaptrad...@googlegroups.com
Robert...

Well, you asked.

I own Adaptrade, and I do not own, but have looked at the code generated by PAL. Ideally, you would be able to search the space of all possible trading systems to find the "best", based on your own personal criteria for "best". But, that would take forever. So, both PAL and Adaptrade have methods which reduce the size of the search space in an "intelligent" way.

However PAL reduces it much more, by far, than Adaptrade..OTOH, .Adaptrade can look at far more possibilities.

The thing that bugs me about PAL, and all systems which claim to look at "just price patterns", is the arbitrary definition of a "price pattern", as if that definition were somehow written in stone as a provable way to have more profitable systems. What is a "price pattern"? As far as I can tell, it is just a rule restriction that limits your possible system rules to things like "if high[-5] > low[-2] and close[-2] > close[0] then go long". The thing you don't notice is the implied constant of 1.0. Let me re-write this: if 1.0*high[-5] > 1.0*low[-2] and 1.0*close[-2] > 1.0*close[0] then go long. Identical formula.

But why is 1.0 written in stone? Why do you think restricting the constant to 1.0 is somehow "better"? Why not: if 1.1*high[-5] > 1.2*low[-2] and 0.9*close[-2] > 1.3*close[0] then go long? Why not: if movavg(high,5) > 1.2*low[-2] and 0.9*close[-2] > 1.3*close[0] then go long? Exactly what do you know about the stock market that precludes these minor changes to the "definition" of a price pattern?

Beyond just how each system generates possible rules, you also have to look at how each system tries to verify that the simulated results are not overfit. That's another thing that bugs me about PAL. The claim that it is not data mining. Sorry, but everything I can find about PAL indicates to me it is absolutely data mining. But, the thing is, THAT'S NOT BAD. As long as you take well know precautions to prevent over fitting. Data mining has provably worked in the real world at everything from image recognition to fraud detection.

Just my opinions and the opinions of everyone that agree with me...


--
You received this message because you are subscribed to the Google Groups "Adaptrade Builder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adaptrade-buil...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robert K

unread,
Feb 11, 2015, 2:19:44 AM2/11/15
to adaptrad...@googlegroups.com
This is very helpful Larry!

Did you read my questions on the thread i posted earlier (google groups doesn't work well with android so I can't seem to post the link).
Would love to hear your comments


Robert K

unread,
Feb 11, 2015, 8:03:57 AM2/11/15
to adaptrad...@googlegroups.com

Red

unread,
Feb 14, 2015, 7:58:48 AM2/14/15
to adaptrad...@googlegroups.com

As to the difference between AB and PAL - after reading comments on this thread and other threads in the AB group, my observation ( correct me if wrong) is that PAL seems to focus on the "Win Rate" as a performance measure and the use of its proprietary "p-Indicator" for "sifting" for solutions. 

Also,there is one other consideration, Mike has included Price Patterns and other indicators - whereas, I gather that PAL doesn't appear to include indicators as an option?

My question for Mike, does it make sense to also include an option to include the weekly Open,H, L, Close parameters (i.e., HighW, etc) in the Price Pattern routine or would that make things too complicated?  

Thanks to Mike and Thread Contributors  - getting quite an education!

Red



 

Red

unread,
Feb 14, 2015, 11:05:20 AM2/14/15
to adaptrad...@googlegroups.com

Of interest, I revisited Mike's article on Price Pattern Strategies - Jan 2012.  From Jan 2010 to the end of Mar 2012 - looks great.  After Mar 2012 on out to  Feb 2015 - not so much.  Rises up for another 4 months and roll overs.  Adding a $2,000 Stop doesn't help.     The premise behind price patterns is that it should be resistant to changes in market behavior - at least that is what PAL explains?  Which begs the question, does any of this stuff work?  


Red



Michael R. Bryant

unread,
Feb 14, 2015, 3:04:03 PM2/14/15
to adaptrad...@googlegroups.com

I think the question isn’t so much “does it work?” but “for how long?”. You said it yourself: “Rises up for another 4 months”. No one should expect a strategy developed on 10 minute bars in January 2012 to still be working today, at least considering that I only used two years to data in-sample. Interestingly, the out-of-sample period was a total of 4 months, the same length of time it held up following testing. I know traders and strategy developers whose approach is to routinely and regularly throw everything away and build new strategies from scratch every 6 months for that very reason.

 

Mike Bryant

Michael R. Bryant

unread,
Feb 14, 2015, 3:11:46 PM2/14/15
to adaptrad...@googlegroups.com

If Builder included weekly price indicators, such as the weekly high or close, those would most likely be included in the price patterns as well, just as the day prices (day open, day high, etc.) are currently. However, I suspect most traders who use price patterns in Builder are looking at smaller bar sizes, such as intraday data, where weekly prices are of less interest. At least, I haven’t received many requests for weekly price functions.

 

Mike Bryant

 

From: adaptrad...@googlegroups.com [mailto:adaptrad...@googlegroups.com] On Behalf Of Red
Sent: Saturday, February 14, 2015 4:59 AM
Subject: Re: Price Patterns

 

 

As to the difference between AB and PAL - after reading comments on this thread and other threads in the AB group, my observation ( correct me if wrong) is that PAL seems to focus on the "Win Rate" as a performance measure and the use of its proprietary "p-Indicator" for "sifting" for solutions. 

Rich Sternal

unread,
Feb 15, 2015, 2:28:46 PM2/15/15
to adaptrad...@googlegroups.com

Mike, thanks very much for your replies.  After I made my post got me  thinking about the "half-life" of a strategy. As u mentioned, it is related to the amount of data used and the grainulity of the data.  6 months on average, dang, constantly on that mice wheel. Don't like the sounds of that!?

--
You received this message because you are subscribed to a topic in the Google Groups "Adaptrade Builder" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adaptrade-builder/0S5iHHFr9HY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adaptrade-buil...@googlegroups.com.

Michael R. Bryant

unread,
Feb 15, 2015, 2:36:47 PM2/15/15
to adaptrad...@googlegroups.com

I didn’t mean to imply there was any kind of typical half-life, let alone 6 months. As you said, it will depend on the amount of data used, the bar size, the market, and the type of strategy logic, among other factors. These are the same issues every strategy developer faces, regardless of whether you build strategies the hard way or using Builder. For the strategy you mentioned, I only used a short history on 10 minute bars, so it’s not surprising it didn’t hold up all that long. That was my choice for that article. You can make different choices depending on your requirements and goals.

 

Mike Bryant

Michael Collison

unread,
Feb 15, 2015, 9:54:30 PM2/15/15
to adaptrad...@googlegroups.com

On 2/14/2015 5:58 AM, Red wrote:

As to the difference between AB and PAL - after reading comments on this thread and other threads in the AB group, my observation ( correct me if wrong) is that PAL seems to focus on the "Win Rate" as a performance measure and the use of its proprietary "p-Indicator" for "sifting" for solutions. 
I own Adaptrade Builder and Price Action Lab (PAL). PAL has three different modes of operation:

1. You can search for historical price patterns that you can use in a automated system. T
2. You can scan for patterns as of the last bar. This is suitable for discretionary traders
3. You can scan for patterns using the p-indicator as of the last bar. This is suitable for discretionary traders

Also,there is one other consideration, Mike has included Price Patterns and other indicators - whereas, I gather that PAL doesn't appear to include indicators as an option?

PAL does not use other indicators that is correct. Also PAL does not generate a complete program the way Builder does. It generated code fragments for inclusion into a strategy you write yourself.

Finally PAL expects the user to do alot of OOS testing using other features of the program such as OOS portfolio testing and parameter robustness testing.


My question for Mike, does it make sense to also include an option to include the weekly Open,H, L, Close parameters (i.e., HighW, etc) in the Price Pattern routine or would that make things too complicated?  

Thanks to Mike and Thread Contributors  - getting quite an education!

Red



 
--
You received this message because you are subscribed to the Google Groups "Adaptrade Builder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adaptrade-buil...@googlegroups.com.

mandelmus

unread,
Feb 20, 2015, 10:10:31 AM2/20/15
to adaptrad...@googlegroups.com
Adaptive Trading Systems recently referenced both Adaptrade and PAL.
"Inspiration for the Rubric Pattern Predictor came from the Adaptrade Price Pattern Strategies and Price Action Lab."

I expect trading systems to run out of steam at some point as the market shifts.  Most of the intraday-trading systems I have created with Builder last between 2 to 6 weeks before fizzling out.  Some strategies recover a few weeks-to-months later.  So, after fizzling out, I usually just continue monitoring those strategies in simulator mode and use an equity crossover approach to switch them back on.  Kevin Davey does a lot of research and offers training in this area.

Rich Sternal

unread,
Feb 20, 2015, 8:20:06 PM2/20/15
to adaptrad...@googlegroups.com

Mendelmus,  thanks for your input. What are your systems primarily based upon, indicator, price action, a mix or something else?

--
You received this message because you are subscribed to a topic in the Google Groups "Adaptrade Builder" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adaptrade-builder/0S5iHHFr9HY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adaptrade-buil...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages