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

Re: [amibroker] Re: Bollinger Bands Squeeze & Buldge



PureBytes Links

Trading Reference Links

Hello ZZtopband

Try this, Load into AA, apply to all stocks, n last quotations and n=1,
click explore. You can load the same formula into indicator builder .

//Bollinger Bands with Expansion and Contraction

//HIGHLIGHTS
// Contraction Color: Blue

pds=20;//bollinger bands periods
shift=2;//bollinger band shift
ChartStyle=64;//Main chart style ex.64 = candlestick,
128=Barchart,1=line.

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;
Graph1Style=ChartStyle;
Graph2=BBandBot(C,pds,shift);
Graph0Style=Graph2Style=1;
Graph0BarColor=Graph2BarColor=ValueWhen(barcolor!=0,barcolor);
/**********************************************************/

Lookback=125;

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");

Watch out for Word Wrap!!!!!

Anthony

zztopband wrote:

>
> Thanks Bill!!
>
>
>
>
> --- In amibroker@xxxx, "eseward_2000" <eseward_2000@xxxx> wrote:
> > ZZ,
> >
> > You can scan for narrowest BBandWidth this way (20day Bands, 2
> StDev):
> >
> > Buy =
> > (BBandTop(C, 20, 2) - BBandBot(C, 20, 2)) <
> > Ref(LLV((BBandTop(C, 20, 2) - BBandBot(C, 20, 2)), 125), -1)
> > ;
> >
> > and widest this way:
> >
> > Buy =
> > (BBandTop(C, 20, 2) - BBandBot(C, 20, 2)) >
> > Ref(HHV((BBandTop(C, 20, 2) - BBandBot(C, 20, 2)), 125), -1)
> > ;
> >
> > Bill
> >
> >
> >
> > --- In amibroker@xxxx, "zztopband" <zztopband@xxxx> wrote:
> > > I just bought Amibroker this weekend and it looks to me it will
> > > become a staple to my diet...Thanks For A GREAT PRODUCT!!... on
> to
> > > my question.
> > >
> > > How can I scan for the "squeeze" and the "buldge" for individual
> > > stocks on a daily basis?
> > >
> > > ie.. Scan daily for a new "Squeeze" (the narrowest point in the
> > last
> > > 6 months) and scan daily for a new "Buldge" (the widest point for
> > the
> > > last 6 months). Any help would be greatly appreciated.
> > >
> > > ZZ
>
>
> Yahoo! Groups Sponsor
ADVERTISEMENT

>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.