Skip to main content

Bollinger Trading system for Amibroker (AFL)

anandnst almost 14 years ago Amibroker (AFL)

  • Rating:
    4 / 5 (Votes 6)
  • Tags:
    trading system, amibroker, bands

This is bollinger band trading system with ATR as Stoploss.
Kindly provide ur comments.

Screenshots

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("SAM");
/*Gann HiLo*/
per=Optimize("Per",Param("Per",42,1,55,1),1,55,1);

Hld = IIf(C > Ref(MA(H, per), -1), 1, IIf(C < Ref(MA(L, per), -1), -1, 0));
Hlv = ValueWhen(Hld != 0, Hld, 1);
Hilo = IIf(Hlv == -1, MA(H, per), MA(L, per));
Trigger = IIf(C>Hilo, colorCustom9, colorCustom5);
Plot(C,"",1,128);
Plot(Hilo, _DEFAULT_NAME(), Trigger, styleStaircase);
SetPositionSize( 50, spsShares );
Buy=Cross(C,Hilo);
Sell=Cross(Hilo,C);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorGreen, 0,L, Offset=-25); 
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorRed, 0,H, Offset=-25);
_SECTION_END();

_SECTION_BEGIN("SAM");
P = ParamField("Price field",-1);
Periods = Param("Periods", 19, 2, 300, 1 );
Width = Param("Width", 2.1, 0, 10, 0.05 );
Color = ParamColor("Color", colorBlue );
Style = ParamStyle("Style", styleLine | styleNoLabel);

CenterLine = MA( P, Periods );
KTop = CenterLine + Width * ATR( Periods );
KBot = CenterLine - Width * ATR( Periods );

Plot( KTop, "KBTop" + _PARAM_VALUES(), Color, Style ); 
Plot( KBot, "KBBot" + _PARAM_VALUES(), Color, Style ); 
_SECTION_END();

5 comments

almost 14 years ago

Very good.
Plz also develop targets to book profits

Thanks
Viswanath

almost 14 years ago

Hi,

This is best SL I have come across so far.
As i requested, if targets are there, its a great system

Thanks
Viswanath

almost 13 years ago

Thanks it is a really good system, yet I don’t know why I can not use it for back testing.

5. moccha
about 10 years ago

This isn’t a Bollinger Band system it’s a Keltner Band

Leave Comment

Please login here to leave a comment.