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

[amibroker] Re: Bollinger Band scan



PureBytes Links

Trading Reference Links

Anthony, thanks for the formula.  I like it!  I was able to figure 
out the other formula, luckily today is a slow day at the office and 
I've had time to play around with the AFL.



--- In amibroker@xxxxxxxxxxxxxxx, "Anthony Faragasso" <ajf1111@xxxx> 
wrote:
> Try this....you can load this formula into Indicator Builder to 
get a visual
> of expansion and contraction.....
> and also load this formula into AA , n last quotation and n=1 and 
click
> explore.
>  
> //Bollinger Bands with Expansion and Contraction
> 
> //HIGHLIGHTS
> 
> // Contraction Color: Blue
> 
> pds=20;//bollinger bands periods
> shift=2;//bollinger band shift
> 
> ChartStyle=styleCandle;
> 
> Cond1= BBandTop(Close,pds,shift)< Ref(BBandTop(Close,pds,shift),-
1) AND
> BBandBot(Close,pds,shift)>Ref(BBandBot(Close,pds,shift),-1);
>  
> // Expansion Color: Red
> 
> Cond2= BBandTop(Close,pds,shift)> Ref(BBandTop(Close,pds,shift),-
1) AND
> BBandBot(Close,pds,shift)<Ref(BBandBot(Close,pds,shift),-1);
> 
> barcolor=IIf(Cond1,6,IIf(Cond2,4,0));
> 
> Graph0=BBandTop(C,pds,shift);
> Graph1=C;
> Graph1Color=colorBlack;
> Graph1Style=ChartStyle;
> Graph2=BBandBot(C,pds,shift);
> Graph0Style=Graph2Style=1;
> Graph0BarColor=Graph2BarColor=ValueWhen(barcolor!=0,barcolor);
> /**********************************************************/
> Lookback=10;
> 
> diff=BBandTop(Close,pds,shift)- BBandBot(Close,pds,shift);
> contraction_cond=IIf(diff < Ref(LLV(diff,Lookback),-1),1,0);
> expansion_cond=IIf(diff > Ref(HHV(diff,Lookback),-1),1,0);
> present=WriteIf(Cond1,"Contraction","Expansion");//is the market 
currently
> under expansion or contraction
> 
> Filter=Cond1 > 0 OR Cond2 > 0 AND Close > 0 AND Close < 25 AND 
Volume > 5000
> 
> 
> AddColumn(IIf(Cond1,C,IIf(Cond2,C,C)),"close");
> 
> AddColumn(Cond1,"contract");AddColumn(ValueWhen(Cond1,BBandTop
(Close,pds
> shift)-BBandBot(Close,pds,shift),1),"ContractValue");
> 
> AddColumn(Cond2,"expand");AddColumn(ValueWhen(Cond2,BBandTop
(Close,pds
> shift)-BBandBot(Close,pds,shift),1),"ExpansionValue");
> 
> AddTextColumn(Present,"Condition");
> 
> AddColumn(RSI(),"RSI");AddColumn(ADX(),"ADX");
> 
> Anthony
>  
> -------Original Message-------
>  
> From: amibroker@xxxxxxxxxxxxxxx
> Date: Friday, April 18, 2003 09:09:43
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Bollinger Band scan
>  
> I was wondering if anyone has a bollinger band scan that searches 
> for a tight band range -- I've seen a scan from the AFL library 
but 
> one of the parameters is that it looks for a tight range with a 
> recent penetration of one of the bands along with a recent 
widening 
> of the bands.  I'd like a scan that finds a tight range and 
ignoring 
> the widening criteria; most of the candidates from this scan look 
> like great trades but the signal comes a little later than I would 
> like.
>  
>  
> Here is the formula:  Where does it state that it is looking for a 
> widening of the bands?  I've been scratching my head all morning
>  
> Band= (BBandTop( C, 20, 2 ) - BBandBot( C, 20, 2)) / MA(Close, 
20 ) 
> * 100;
> B= ((Close - BBandBot( Close, 20, 2 )) / (BBandTop( Close, 20, 
2 ) - 
> BBandBot(
> Close, 20, 2 ))) * 100;
>  
> Buy = band < 15 AND b > 95 AND MFI(10) > 60 AND V>275000;
> Sell = Cross(Close,SAR(0.01,0.2));
> Short = band < 15 AND b < 5 AND MFI(10) < 40;
> Cover = Cross(SAR(0.01,0.2), Close);
>  
> Filter = (band < 15 AND b > 95 AND MFI(10) > 60)  OR (band < 15 
AND 
> b < 5 AND
> MFI(10) < 40);
>  
>  
>  
>  
> Yahoo! Groups Sponsor
>  
>  
>  
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> 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 the Yahoo! Terms of 
Service.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get a FREE REFINANCE QUOTE - click here!
http://us.click.yahoo.com/2CXtTB/ca0FAA/i5gGAA/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/