Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Bollinger Band Squeeze for Amibroker (AFL)

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

It is squeeze when the BBandWidth narrows.

Screenshots

Indicator / Formula

Copy & Paste Friendly
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
// BB MODEL AMIBROKER
/*
_SECTION_BEGIN("Bollinger Bands");
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");
Plot( BBandTop( P, Periods, Width ), "BBTop" + _PARAM_VALUES(), Color, Style );
Plot( BBandBot( P, Periods, Width ), "BBBot" + _PARAM_VALUES(), Color, Style );
 
PlotOHLC( bbt, bbt, bbb, bbb, "", ColorBlend( Color, GetChartBkColor(), 0.8 ),
          styleNoLabel | styleCloud | styleNoRescale, Null, Null, Null, -1 ); // MODEL CLOUD
_SECTION_END();
*/
 
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
 
// BBAB
 
_SECTION_BEGIN("Bollinger Bands");
P = ParamField("Price field",-1);
BBper = Param("BBper", 15, 2, 300, 1 );
StDevNr = Param("StDevNr", 2, 0, 10, 0.05 );
Color = ParamColor("Color", colorRed );
Style = ParamStyle("Style", styleDots + styleThick );
 
bbt = BBandTop( P, BBper, StDevNr ) ;
cupbbt = C>bbt ;
bbtup = bbt>Ref(bbt,-1) ;
bbtcol = IIf(bbtup, colorRed, colorPink) ;
bbb = BBandBot( P, BBper, StDevNr ) ;
bbbup = bbb>Ref(bbb,-1) ;
bbbcol = IIf(bbbup, colorRed, colorPink) ;
bbmid = (bbt + bbb)/2 ;
cupbbmid = C>bbmid ;
bbmidup = bbmid>Ref(bbmid,-1) ;
bbmidcol = IIf(bbmidup, colorBlue, colorAqua) ;
 
BBWidth = bbt - bbb ;
 
issqueeze = bbwidth<Ref(bbwidth,-1) ;
isexpand = bbwidth>Ref(bbwidth,-1) ;
 
bbupcond = cupbbmid AND bbmidup AND bbtup OR cupbbt ;
bbdncond = !cupbbmid ;
 
Plot( bbmid, "\nBBMid" + _PARAM_VALUES(), bbmidcol, Style );
Plot( bbt, "\nBBTop" + _PARAM_VALUES(), bbtcol, Style );
Plot( bbb, "\nBBBot" + _PARAM_VALUES(), bbbcol, Style );
_SECTION_END();
 
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
//PRICE
 
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%)Vol " +
            WriteVal( V, 1.0 ) + " {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
Plot( C, "", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
 
//barcolorc= IIf(C>O AND C>Ref(C,-1), colorBlue,
//           IIf(C<O AND C<Ref(C,-1), colorRed, colorTan)); //MODEL MODEL MODEL 3 CULORI
//SetBarFillColor( IIf(C>O AND C>Ref(C,-1), colorBrightGreen,
//                 IIf(C<O AND C<Ref(C,-1), colorOrange, colorTan))); //MODEL MODEL MODEL 3 CULORI
//Plot( C, "", barcolorc, styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
//Plot( C, "", barcolorc, styleBar+styleThick );
_SECTION_END();
 
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
// BB SQUEEZE CLOUD
 
issqueezecol = IIf(issqueeze, colorGold, colorWhite) ;
 
PlotOHLC( bbt, bbt, bbb, bbb, "", issqueezecol, styleNoLabel | styleCloud | styleNoRescale, Null, Null, Null, -1 ); // MODEL CLOUD
           
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

0 comments

Leave Comment

Please login here to leave a comment.

Back