Skip to main content

Mean band for Amibroker (AFL)

Gorilabd almost 16 years ago Amibroker (AFL)

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

You can buy a stock when candle stick is above the band and in similar way u can sell when the candle stick is below the band…it is really a helpful AFL….

Screenshots

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Mean Band");
function SteBand( array, periods,number, upper )
{
Lr = LinearReg( array, periods );
se = StdErr( array, periods );
return LR + IIf( upper, 1, -1 ) * number * se;
}
Periods = Param("Standard Error", 80, 1, 100, 1);
Smooth = Param("Mean Smoothness",14,2,100,1);
number = Param("StdErrNo", 1, 0.2, 3.0,0.2);

parmCloudColor = ParamColor("Cloud Color", ColorRGB( 40,40,40) );

UStdErrBand = SteBand( C, Periods, number, True );
LStdErrBand = SteBand( C, Periods, number, False );
MStdErrBand = (UStdErrBand + LStdErrBand )/2;

Plot( MA(UStdErrBand,smooth), "UpperBand ", colorDarkRed,styleLine );
Plot( MA(LStdErrBand,smooth), "LowerBand ", colorDarkRed,styleLine );
Plot( MA(MStdErrBand,smooth) , "MidBand", colorPlum , styleDashed );

Plot( Close, "Close", colorBlack, styleCandle );
PlotOHLC( MA(UStdErrBand,smooth), MA(UStdErrBand,smooth), MA(LStdErrBand,smooth) , MA(LStdErrBand,smooth) , "", parmCloudColor, styleCloud | styleNoLabel);

_SECTION_END();

0 comments

Leave Comment

Please login here to leave a comment.