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

RE: [amibroker] Pattern Formula ( Key Reversal Up Pattern )



PureBytes Links

Trading Reference Links


 <FONT color=#0000ff 
size=2>Anthony,
<FONT color=#0000ff 
size=2> 
I wrote the 
following some time ago.
<A 
href="">http://www.amibroker.com/library/formula.php?id=118
<FONT color=#0000ff 
size=2> 
numcolumns =12;
/*Short Term Reversal Signals Automatic Analysis*/
/*Closing Price Reversals Automatic Analysis
by Larry Lovrencic*/

CPRbuy=O<(L+0.2*(H-L)) AND C>(H-0.2*(H-L)) AND H<ref(H,-1) AND L<ref(L,-1) AND C>ref(C,-1);
CPRsell=O>(L+0.8*(H-L)) AND C<(H-0.8*(H-L)) AND H>ref(H,-1) AND L>ref(L,-1) AND C<ref(C,-1);
column0 = CPRbuy;
column0name = "Closing Price Reversal BUY";
column1= CPRsell;
column1name= "Closing Price Reversal SELL";

/*Hook Reversals Automatic Analysis
by Larry Lovrencic*/

HRbuy=O<(L+0.2*(H-L)) AND C>(H-0.2*(H-L)) AND H<ref(H,-1) AND L>ref(L,-1);
HRsell=O>(L+0.8*(H-L)) AND C<(H-0.8*(H-L)) AND H<ref(H,-1) AND L>ref(L,-1);
column2 = HRbuy;
column2name = "Hook Reversal BUY";
column3= HRsell;
column3name= "Hook Reversal SELL";

/*Island Reversals Automatic Analysis
by Larry Lovrencic*/

IRbuy=ref(L,-2)>ref(H,-1) AND L>ref(H,-1); 
IRsell=ref(H,-2)<ref(L,-1) AND H<ref(L,-1);
column4 = IRbuy;
column4name = "Island Reversal BUY";
column5= IRsell;
column5name= "Island Reversal SELL";

/*Key Reversals Automatic Analysis
by Larry Lovrencic*/

KRbuy=O<ref(C,-1) AND L<ref(L,-1) AND C>ref(H,-1);
KRsell=O>ref(C,-1) AND H>ref(H,-1) AND C<ref(L,-1);
column6 = KRbuy;
column6name = "Key Reversal BUY";
column7= KRsell;
column7name= "Key Reversal SELL";

/*Open/Close Reversals Automatic Analysis
by Larry Lovrencic*/

OCRbuy=O<(L+0.2*(H-L)) AND C>(H-0.2*(H-L)) AND H<ref(H,-1) AND L<ref(L,-1) AND C<ref(C,-1);
OCRsell=O>(L+0.8*(H-L)) AND C<(H-0.8*(H-L)) AND H>ref(H,-1) AND L>ref(L,-1) AND C>ref(C,-1);
column8 = OCRbuy;
column8name = "Open Close Reversal BUY";
column9= OCRsell;
column9name= "Open Close Reversal SELL";

/*Pivot Point Reversals Automatic Analysis
by Larry Lovrencic*/

PPRbuy=ref(L,-1)<ref(L,-2) AND ref(L,-1)<L AND C>ref(H,-1);
PPRsell=ref(H,-1)>ref(H,-2) AND ref(H,-1)>H AND C<ref(L,-1);
column10 = PPRbuy;
column10name = "Pivot Point Reversal BUY";
column11= PPRsell;
column11name= "Pivot Point Reversal SELL"; 

buy=CPRbuy or HRbuy or IRbuy or KRbuy or OCRbuy or PPRbuy;
sell=CPRsell or HRsell or IRsell or KRsell or OCRsell or PPRsell;

filter= CPRbuy OR CPRsell OR HRbuy OR HRsell OR IRbuy OR IRsell or KRbuy OR KRsell OR OCRbuy OR OCRsell OR PPRbuy OR PPRsell;


==============================================================================================================================Also,http://www.amibroker.com/library/formula.php?id=121
or with dots to 
highlight reversals:
<FONT color=#0000ff 
size=2> 

<FONT face="Courier New" color=#008000 
size=1>/* Short Term Reversal Signals with alerts by Larry 
Lovrencic */
<FONT face="Courier New" color=#008000 
size=1>
/*Closing Price Reversals*/
CPRbuy=O<(L+<FONT 
face="Courier New">0.2<FONT 
size=1>*(H-L)) AND C>(H-<FONT 
color=#ff00ff size=1>0.2*(H-L)) AND 
H<Ref<FONT 
size=1>(H,-1) 
AND L<Ref<FONT 
size=1>(L,-1) 
AND C>Ref<FONT 
size=1>(C,-1<FONT 
size=1>);
CPRsell=O>(L+<FONT 
face="Courier New">0.8<FONT 
size=1>*(H-L)) AND C<(H-<FONT 
color=#ff00ff size=1>0.8*(H-L)) AND 
H>Ref<FONT 
size=1>(H,-1) 
AND L>Ref<FONT 
size=1>(L,-1) 
AND C<Ref<FONT 
size=1>(C,-1<FONT 
size=1>);
/*Hook Reversals*/
HRbuy=O<(L+<FONT 
face="Courier New">0.2<FONT 
size=1>*(H-L)) AND C>(H-<FONT 
color=#ff00ff size=1>0.2*(H-L)) AND 
H<Ref<FONT 
size=1>(H,-1) 
AND L>Ref<FONT 
size=1>(L,-1<FONT 
size=1>);
HRsell=O>(L+<FONT 
face="Courier New">0.8<FONT 
size=1>*(H-L)) AND C<(H-<FONT 
color=#ff00ff size=1>0.8*(H-L)) AND 
H<Ref<FONT 
size=1>(H,-1) 
AND L>Ref<FONT 
size=1>(L,-1<FONT 
size=1>);
/*Island Reversals*/
IRbuy=<FONT 
color=#0000ff size=1>Ref(L,-<FONT 
color=#ff00ff size=1>2)><FONT color=#0000ff 
size=1>Ref(H,-<FONT color=#ff00ff 
size=1>1) AND L><FONT color=#0000ff 
size=1>Ref(H,-<FONT color=#ff00ff 
size=1>1); 
IRsell=<FONT 
color=#0000ff size=1>Ref(H,-<FONT 
color=#ff00ff size=1>2)<<FONT color=#0000ff 
size=1>Ref(L,-<FONT color=#ff00ff 
size=1>1) AND H<<FONT color=#0000ff 
size=1>Ref(L,-<FONT color=#ff00ff 
size=1>1);<FONT face="Courier New" 
color=#008000 size=1>
/*Key Reversals*/
KRbuy=O<<FONT 
face="Courier New">Ref<FONT 
size=1>(C,-1) 
AND L<Ref<FONT 
size=1>(L,-1) 
AND C>Ref<FONT 
size=1>(H,-1<FONT 
size=1>);
KRsell=O><FONT 
face="Courier New">Ref<FONT 
size=1>(C,-1) 
AND H>Ref<FONT 
size=1>(H,-1) 
AND C<Ref<FONT 
size=1>(L,-1<FONT 
size=1>);
/*Open Close Reversals*/
OCRbuy=O<(L+<FONT 
face="Courier New">0.2<FONT 
size=1>*(H-L)) AND C>(H-<FONT 
color=#ff00ff size=1>0.2*(H-L)) AND 
H<Ref<FONT 
size=1>(H,-1) 
AND L<Ref<FONT 
size=1>(L,-1) 
AND C<Ref<FONT 
size=1>(C,-1<FONT 
size=1>);
OCRsell=O>(L+<FONT 
face="Courier New">0.8<FONT 
size=1>*(H-L)) AND C<(H-<FONT 
color=#ff00ff size=1>0.8*(H-L)) AND 
H>Ref<FONT 
size=1>(H,-1) 
AND L>Ref<FONT 
size=1>(L,-1) 
AND C>Ref<FONT 
size=1>(C,-1<FONT 
size=1>);
/*Pivot Point Reversals*/
PPRbuy=<FONT 
color=#0000ff size=1>Ref(L,-<FONT 
color=#ff00ff size=1>1)<<FONT color=#0000ff 
size=1>Ref(L,-<FONT color=#ff00ff 
size=1>2) AND <FONT color=#0000ff 
size=1>Ref(L,-<FONT color=#ff00ff 
size=1>1)<L AND C><FONT 
color=#0000ff size=1>Ref(H,-<FONT 
color=#ff00ff size=1>1<FONT 
face="Courier New">);
PPRsell=<FONT 
color=#0000ff size=1>Ref(H,-<FONT 
color=#ff00ff size=1>1)><FONT color=#0000ff 
size=1>Ref(H,-<FONT color=#ff00ff 
size=1>2) AND <FONT color=#0000ff 
size=1>Ref(H,-<FONT color=#ff00ff 
size=1>1)>H AND C<<FONT 
color=#0000ff size=1>Ref(L,-<FONT 
color=#ff00ff size=1>1<FONT face="Courier New" 
size=1>);
MaxGraph<FONT 
face="Courier New">=5<FONT 
face="Courier New">;
Graph0<FONT face="Courier New" 
size=1> = Close;
Graph0Style<FONT 
face="Courier New"> = <FONT face="Courier New" 
color=#ff00ff>128;
Graph0Color<FONT 
face="Courier New">=1<FONT 
face="Courier New">;
Graph3<FONT 
face="Courier New">=H*<FONT face="Courier New" 
color=#ff00ff>1.005;<SPAN 
class=210103622-25112001> /* Alerts 
*/
Graph3Style<FONT 
face="Courier New">=4<FONT 
size=1>+8+<FONT 
size=1>16+512<FONT 
face="Courier New">; <FONT 
color=#008000>/* Alerts */
graphxspace=<FONT 
size=1>5;<SPAN 
class=210103622-25112001> 
<SPAN 
class=210103622-25112001><FONT 
size=1>Graph0BarColor = <FONT 
size=1>IIf( CPRbuy, 8<FONT 
size=1>, IIf( CPRsell,<FONT 
size=1>4, IIf( 
HRbuy,10, <FONT 
size=1>IIf( HRsell,11<FONT 
size=1>, IIf( IRbuy,<FONT 
size=1>3, IIf( 
IRsell,15, <FONT 
size=1>IIf( KRbuy,6, 
IIf( KRsell,<FONT 
size=1>7, IIf( 
OCRbuy,9, <FONT 
size=1>IIf( OCRsell,13<FONT 
size=1>, IIf( PPRbuy,<FONT 
size=1>16, IIf( 
PPRsell,12, <FONT 
size=1>1 ) ) ) ) ) ) ) ) ) ) 
) ) ; /* Thecolors 
should be changed depending on your background color 
*/
<SPAN 
class=210103622-25112001><FONT face="Courier New" 
size=1>Graph3BarColor = 
IIf(CPRbuy, 
8, IIf<FONT 
size=1>( CPRsell,4, <FONT 
size=1>IIf( HRbuy,10<FONT 
size=1>, IIf( HRsell,<FONT 
size=1>11, IIf( 
IRbuy,3, <FONT 
size=1>IIf( IRsell,15<FONT 
size=1>, IIf( KRbuy,<FONT 
size=1>6, IIf( 
KRsell,7, <FONT 
size=1>IIf( OCRbuy,9<FONT 
size=1>, IIf( OCRsell,<FONT 
size=1>13, IIf( 
PPRbuy,16, <FONT 
size=1>IIf( PPRsell,12<FONT 
size=1>, 2 ) ) 
) ) ) ) ) ) ) ) ) ) ; <FONT 
color=#008000>/* Alerts - The last color (2) should be the same as your 
background*/
ch= (Close-(<FONT face="Courier New" color=#0000ff 
size=1>Ref(Close,-<FONT 
face="Courier New" color=#ff00ff size=1>1<FONT face="CourierNew" 
size=1>)));
chpct=ch/Ref<FONT 
face="Courier New" size=1>(C,-<FONT face="Courier New" 
color=#ff00ff size=1>1)*<FONT 
face="Courier New" color=#ff00ff size=1>100<FONT face="Courier New" 
size=1>;
MA5D=MA<FONT 
face="Courier New" size=1>(C,<FONT face="Courier New" 
color=#ff00ff size=1>5);
Graph1=MA5D;
Graph1Style=<FONT face="Courier New" color=#ff00ff 
size=1>1;
Graph1Color=<FONT face="Courier New" color=#ff00ff 
size=1>4;
MA20D=MA<FONT 
face="Courier New" size=1>(C,<FONT face="Courier New" 
color=#ff00ff size=1>20);
Graph2=MA20D;
Graph2Style=<FONT face="Courier New" color=#ff00ff 
size=1>1;
Graph2Color=<FONT face="Courier New" color=#ff00ff 
size=1>5;

Title =<FONT face="Courier New" color=#0000ff 
size=1>Date()+<FONT 
face="Courier New" color=#ff00ff size=1>" "<FONT face="Courier New" 
size=1>+Name<FONT 
face="Courier New" size=1>()+<FONT face="Courier New" color=#ff00ff 
size=1>" Open"+<FONT 
face="Courier New" color=#0000ff size=1>WriteVal<FONT face="Courier New" 
size=1>(O)+" 
High"+<FONT face="Courier New" 
color=#0000ff size=1>WriteVal<FONT face="Courier New" 
size=1>(H)+" 
Low"+<FONT face="Courier New" 
color=#0000ff size=1>WriteVal<FONT face="Courier New" 
size=1>(L)+" 
Close" + <FONT face="Courier New" 
color=#0000ff size=1>WriteVal<FONT face="Courier New" 
size=1>(Graph0) + " 
Previous Close " + <FONT 
face="Courier New" color=#0000ff size=1>WriteVal<FONT face="Courier New" 
size=1>((Ref<FONT 
face="Courier New" size=1>(Graph0,-<FONT face="Courier New" 
color=#ff00ff size=1>1))) + <FONT 
face="Courier New" color=#ff00ff size=1>"Change="<FONT face="Courier New" 
size=1> + <FONT face="Courier New" color=#0000ff 
size=1>WriteVal(ch)+<FONT 
face="Courier New" color=#ff00ff size=1>" ("<FONT face="Courier New" 
size=1>+<FONT face="Courier New" color=#0000ff 
size=1>WriteVal(chpct,format=<FONT 
face="Courier New" color=#ff00ff size=1>1.2<FONT face="Courier New" 
size=1>)+"%)"<FONT 
face="Courier New" size=1>;<A 
 
 
href="" target=_blank> 
<A 
href="" 
target=_top> 
<BLOCKQUOTE 
>
<FONT face=Tahoma 
size=2>-----Original Message-----From: Anthony Faragasso 
[mailto:ajf1111@xxxx]Sent: Thursday, 29 November 2001 
06:43To: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] 
Pattern Formula ( Key Reversal Up Pattern )Helloto 
the Group;I have included 3 formulas for Amibroker, ( KEY 
REVERSALS  )1. Key Reversals_i ( Paste in the Indicator Builder 
)2. Key Reversals Up Pattern Commentary ( Paste in the Guru 
Commentary)3. Key Reversals Up Pattern Exploration and System ( Pastein 
AutomaticAnalysis )If someone could optimize the system signals 
and rules for buy and selland revert back with details.that wouldbe 
appreciated.Guru CommentaryWill give # of times the pattern 
has occured, Total number of bars inthe test, % of time the pattern 
occured, # of times the pattern wasprofitiable, and % of 
profitiability.Automatic AnalysisThere are 2 operations 
here,1. hit explore and your will have a spreadsheet showing the 
informationas in Commentary2. hit backtest and the system test will be 
run.Indicator builderCode highlights the Key 
reversals.Thank 
youAnthony