[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Pattern Recognition Exploration



PureBytes Links

Trading Reference Links


Paste the following in AA and explore All Stocks 
for 
the last date of your data.
In Results click twice a label , for example "a TR" andyou 
will collect
all ascending Triangles marked with an "1".
Patterns are
+Ascending Wedges "aW"
+Descending Wedges "dW"
+ ascending Triangles "a 
TR"
+descending Triangles "d TR"
+ascending channel "a //"
+descending channel "d //"
+almost horizontal channel "//"
+Converging Support and Resistance
+Diverging Support and Resistance
You may decrease sensitivity, changing per=3 with 4 or 
another
percentage.
 
/*Pattern Recognition Exploration*/ 
x = cum(1);per = 3;s1=l;endvalue = lastvalue( 
trough( s1, per, 1 ) );startvalue = lastvalue( trough( s1, per, 2 ) 
);endbar = lastvalue( valuewhen( s1 == endvalue, x, 1 ) );startbar = 
lastvalue( valuewhen( s1 == startvalue, x, 1 ) );aS = 
(endvalue-startvalue)/(endbar-startbar);bS = endvalue;trendlineS = aS * 
( x  -endbar ) + bS; 
s11=h;endvalue1 = lastvalue( peak( s11, per, 1 ) 
);startvalue1 = lastvalue( peak( s11, per, 2 ) );endbar1 = lastvalue( 
valuewhen( s11 == endvalue1, x, 1 ) );startbar1 = lastvalue( valuewhen( s11 
== startvalue1, x, 1 ) );aR = 
(endvalue1-startvalue1)/(endbar1-startbar1);bR = endvalue1;trendlineR = 
aR * ( x  -endbar1 ) + bR; 
filter=1;numcolumns=12;column0=aS;column1=aR;column0name="aS";column1name="aR";column2=ar>0 
and as>3*ar;column2name="a 
W";column2format=1.0;column3=ar<3*as and as<0;column3name="d 
W";column3format=1.0;column4=abs(aR)<0.002 and 
aS>0;column4name="a 
TR";column4format=1.0;column5=abs(aS)<0.002 and 
ar<0;column5name="d 
TR";column5format=1.0;column6=abs(aR-aS)<0.1*aS;column6name="a 
ll";column6format=1.0;column7=abs(aR-aS)<0.1*abs(aR) and 
aR<0;column7name="d 
ll";column7format=1.0;column8=abs(aR-aS)<0.1*abs(aR) and 
abs(aR)<0.01;column8name=" ll ";column8format=1.0;column9=aR<0 
and 
aS>0;column9name="Converging";column9format=1.0;column10=aR>0 
and aS<0;column10name="Diverging";column10format=1.0;
 
For your Indicator Builder, paste the formula
 
/*Pattern Recognition Graph*/
x = cum(1);per = 3;s1=l;endvalue = lastvalue( 
trough( s1, per, 1 ) );startvalue = lastvalue( trough( s1, per, 2 ) 
);endbar = lastvalue( valuewhen( s1 == endvalue, x, 1 ) );startbar = 
lastvalue( valuewhen( s1 == startvalue, x, 1 ) );aS = 
(endvalue-startvalue)/(endbar-startbar);bS = endvalue;trendlineS = aS * 
( x  -endbar ) + bS; graph0 = 
c;graph0style=64;graph0barcolor=1;graph1 = 
iif(x>startbar-10,trendlineS,-1e10);graph1style = 1;graph1color = 
8;s11=h;endvalue1 = lastvalue( peak( s11, per, 1 ) );startvalue1 = 
lastvalue( peak( s11, per, 2 ) );endbar1 = lastvalue( valuewhen( s11 == 
endvalue1, x, 1 ) );startbar1 = lastvalue( valuewhen( s11 == startvalue1, x, 
1 ) );aR = (endvalue1-startvalue1)/(endbar1-startbar1);bR = 
endvalue1;trendlineR = aR * ( x  -endbar1 ) + bR; graph2 = 
iif(x>startbar1-10,trendlineR,-1e10);graph2style = 1;graph2color = 
8;
 
Dimitris Tsokakis