// Downloaded From https://www.WiseStockTrader.com //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 = bbwidthRef(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(CO AND C>Ref(C,-1), colorBrightGreen, // IIf(C