Skip to main content

Bollinger Band Squeeze & Expansion for Amibroker (AFL)

razasia about 16 years ago Amibroker (AFL)

  • Rating:
    3 / 5 (Votes 2)
  • Tags:
    amibroker, bands

Anyone can introduce this to your trading chart its for Bollinger Bank Squeeze & Expansion Color

Screenshots

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Bollinger Bands");
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
//SetBarFillColor( IIf( C>O, colorGreen, colorRed ) ); 
Plot( C, "Close", colorBlack, styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 

P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1 );
Width = Param("Width", 2, 0, 10, 0.05 );
Color = ParamColor("Color", colorCycle );
Style = ParamStyle("Style");
bbtop=BBandTop( P, Periods, Width );
bbbot=BBandBot( P, Periods, Width );
Plot(bbtop, "BBTop" + _PARAM_VALUES(), Color, Style ); 
Plot(bbbot , "BBBot" + _PARAM_VALUES(), Color, Style );
diff=bbtop-bbbot;

sqeezcolor=ColorRGB(194,220,218);
expandcolor=ColorRGB(255,220,218);
PlotOHLC( bbtop,bbtop, bbbot,bbbot, "Price chart shifted 10% up",IIf(((diff/bbtop)*100)<12,sqeezcolor,expandcolor), styleCloud ); 
// Plot( diff, "Diff", colorGreen, Style ); 
_SECTION_END();

0 comments

Leave Comment

Please login here to leave a comment.