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

Re: [amibroker] Re: Systems for indices



PureBytes Links

Trading Reference Links

Hi Anthony,
I tried to interpret the results your code gives, and also
tried to use it for decision making. Either I haven't fully
understood it or I did something wrong, because the
hit rate is even below 50% (actually 42% on DELL since 1990)
in my calculation.  Can you please tell me how it could be 
adapted for generating Buy/Sell signals or better calculate it 
in some columns?
I tried the following. Is it wrong?

/****************************************************************/
// calculate the success
Filter = patUp or patDown2;   //  1;  // totpatUP > 0;

success = (patUp    and (Ref(C,1) > C)) 
       or (patDown2 and (Ref(C,1) < C));

AddColumn(cum(Filter),   "#Cases", 1);
AddColumn(cum(success),  "#Successes", 1);
AddColumn(cum(success) / cum(Filter) * 100, "%Success", 1.2);

/****************************************************************/

Thx
UM


----- Original Message ----- 
From: "Anthony Faragasso" <ajf1111@xxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, May 01, 2003 5:30 AM
Subject: Re: [amibroker] Re: Systems for indices


> Um,
>  
> Try this for the bollinger Band Pattern for both the Upper Band and Lower
> Band..load into AA..
> select Apply to : all stocks, current stock , filter ...etc....
> Range=n last quotation and n=1
> Click explore
> 
>  
> //Bollinger Band Bottom crossing Pattern
> 
> //Pattern description ( 3 bar pattern )
> 
> /*The close 2 days ago ( ref(c,-2) ) is above the Lower Bollinger Band
> and the Close yesterday ( Ref(C,-1)) is below the Lower bollinger Band
> and the Close yesterday ( ref(c,-1)) is less than the close 2 days ago (
> ref(c,-2)) and Todays Close is ** either ** Greater than yesterdays close
> (ref(c,-1)) or Todays Close is Less than Yesterdays close ( ref(c,-1)).*/
> 
> BandRange=15;
> BandWidth=2;
> 
> patUP = C > Ref(C,-1) AND Ref(C,-1) < BBandBot(C,BandRange,BandWidth)AND
> Ref(C,-1) < Ref(C,-2) AND Ref(C,-2) > BBandBot(C,BandRange,BandWidth);
> 
> patDown = C < Ref(C,-1) AND Ref(C,-1) < BBandBot(C,BandRange,BandWidth)AND
> Ref(C,-1) < Ref(C,-2) AND Ref(C,-2) > BBandBot(C,BandRange,BandWidth);
> 
> totpatUP = LastValue( Cum(patUP) );
> totpatDown = LastValue( Cum( patDown ) );
> 
> totpercent = (( totpatUP/(totpatUP + totpatDown)))*100;
> 
> //% Pattern 
> CondPatup=(Cum(patUP)/Cum(1))*100;
> CondPatDown=(Cum(patDown)/Cum(1))*100;
> 
> /****************************************************************/
> //Bollinger Band Top crossing Pattern
> 
> //Pattern description ( 3 bar pattern )
> 
> /*The close 2 days ago ( ref(c,-2) ) is below the upper Bollinger Band
> and the Close yesterday ( Ref(C,-1)) is above the upper bollinger Band
> and the Close yesterday ( ref(c,-1)) is Greater than the close 2 days ago (
> ref(c,-2)) and Todays Close is ** either ** Greater than yesterdays close
> (ref(c,-1)) or Todays Close is Less than Yesterdays close ( ref(c,-1)).*/
> 
> patUP2 = C > Ref(C,-1) AND Ref(C,-1) > BBandTop(C,BandRange,BandWidth)AND
> Ref(C,-1) > Ref(C,-2) AND Ref(C,-2) < BBandTop(C,BandRange,BandWidth);
> 
> patDown2 = C < Ref(C,-1) AND Ref(C,-1) > BBandTop(C,BandRange,BandWidth)AND
> Ref(C,-1) > Ref(C,-2) AND Ref(C,-2) < BBandTop(C,BandRange,BandWidth);
>  
> totpatUP2 = LastValue( Cum( patUP2 ) );
> totpatDown2 = LastValue( Cum( patDown2 ) );
> 
> totpercent2 = ((totpatDown2/( totpatUP2 + totpatDown2)))*100;
> 
> bars=Cum(1);
> 
> //% Pattern2
> CondPatup2=(Cum(patUP2)/Cum(1))*100;
> CondPatDown2=(Cum(patDown2)/Cum(1))*100;
> 
> Filter = 1;//totpatUP > 0;
> 
> //Columns for Lower Bollinger Band pattern
> 
> AddColumn(totpatUP,"# L_BolPatUP",1);
> AddColumn(totpatDown,"# L_BolPatDown",1);
> AddColumn(totpercent,"% win",1.2);
> AddColumn(bars,"barsInTest",1); 
> AddColumn(CondpatUp,"% L_BolPatUP",1.2);
> //AddColumn(CondPatDown,"% Pat_DOWN",1.2);
> 
> /****************************************************************/
> //Columns for Upper Bollinger Band pattern
> 
> AddColumn(totpatUP2,"# U_BolPatUP",1);
> AddColumn(totpatDown2,"# U_BolPatDown",1);
> AddColumn(totpercent2,"% win" , 1.2);
> //AddColumn(CondpatUp2,"% Pat_UP2",1.2);
> AddColumn(CondPatDown2,"% Pat_DOWN2",1.2);
> 
> /********************************************************************/
> 
> Anthony



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading!
Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/cjB9SD/od7FAA/uetFAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/