[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Standard Deviation as an indicator



PureBytes Links

Trading Reference Links

Hi, 

I have taken the formula from below and put into regular BB 
indicator. How does this look?

P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 100, 1 );
Width = Param("Width", 2, 0, 10, 0.05 );
Color = ParamColor("Color", colorCycle );
Style = ParamStyle("Style");
lowerBB = BBandBot( P, Periods, Width );
upperBB = BBandTop( P, Periods, Width );
PercentBB = (C- lowerBB) / (upperBB - lowerBB);
PercentBB_norm = (PercentBB - 0.5) * 2.0;
Plot( PercentBB_norm * 2 , "%BBnorm" + _PARAM_VALUES(), IIf
(PercentBB_norm*2>0,colorGreen, colorRed), styleHistogram ); 
Plot(2,"2 Standard Deviations above average",colorGreen,styleLine);
Plot(-2,"-2 SD",colorRed, styleLine);


Arthur


--- In amibroker@xxxxxxxxxxxxxxx, "brian_z111" <brian_z111@xxx> wrote:
>
> Hello John,
> 
> Thanks for that.
> 
> Simple but effective.
> If you don't mind me saying, I think I prefer %b to BB themselves.
> 
> I see you include the equation in your tutorial section.
> 
> http://www.bollingerbands.com/services/bb/?page=5
> 
> 
> Any tips on how to trade %b?
> 
> BB (also known as brian_z)
> 
> 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "bbands" <BBands@> wrote:
> >
> > --- In amibroker@xxxxxxxxxxxxxxx, "droskill" <droskill@> wrote:
> > >
> > > Hey all - I'm trying to put together an indicator based on 
> Standard
> > > Deviation.  The difference, from, say Bollinger Bands in this 
> case is
> > > that I want to show the Std Dev from a moving average in terms 
of 
> 1,2
> > > and 3 standard deviations from mean, where mean is an N day 
moving
> > > average.  So, the mean would be represented by a constant 
straight
> > > line on a chart, and then a line would go up/down around it.
> > > 
> > > For an example, check this out:
> > >
> > http://www.indexindicators.com/charts/sp500-vs-sp500-50d-rsma-
> params-3y-x-x/
> > > 
> > > I really don't know how to approach this - anybody have any
> > > thoughts/ideas?  Or maybe someone has done it before (or it's 
in 
> AB
> > > already) and I just haven't found it.
> > > 
> > > Thanks!
> > 
> > I think %b is what you want. 
> > 
> > %b = (last - lowerBB) / (upperBB - lowerBB)
> > 
> > (%b is derived from the formula for Stochastics.)
> > 
> > Using the standard BB parameters of +/- 2 sd:
> > 
> > +2, %b = 1.0
> > +1, %b = 0.75
> >  0, %b = 0.5
> > -1, %b = 0.25
> > -2, %b = 0.0
> > 
> > If you need centered numbers you can subtract 0.5 from %b and 
> multiply
> > the result by two, or whatever constant suits your ap. Again 
using 
> the
> > defaults of +/- 2 sd:
> > 
> > %b_norm = (%b - 0.5) * 2.0
> > 
> > Which would give:
> > 
> > +2, %b =  1.0
> > +1, %b =  0.5
> >  0, %b =  0.0
> > -1, %b = -0.5
> > -2, %b = -1.0
> > 
> > Or, again sing the default parms od +/1 2 sd, multiplying by 4 
would
> > give you the intuitive number you seek:
> > 
> > +2, %b =  2.0
> > +1, %b =  1.0
> >  0, %b =  0.0
> > -1, %b = -1.0
> > -2, %b = -2.0
> > 
> > Enjoy,
> > 
> >     jab
> > www.bbands.com
> >
>



------------------------------------

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/