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

Re: Standard deviation bands



PureBytes Links

Trading Reference Links

Hi Ian,

IW> Value1=BollingerBand(MyAv(Length,Factor),Length,+2);
IW> Value2=BollingerBand(MyAv(Length,Factor),Length,-2);
IW> Plot1(Value1,"BandUp"); Plot2(Value2),"BandDn");

    I  think  that your code is actually taking the Standard
    Deviation of MyAvg instead of the Close.

    I'd consider approaching your problem directly:

Inputs:
       SDev(2);

Vars:  Mid(Close),
       Uppr(Close),
       Lwr(Close);

Mid = <MyAvg(Length,Factor,etc.) per your def'n>;
Uppr = Mid + SDev*StdDev(Close,Length);
Lwr = Mid - SDev*StdDev(Close,Length);

Plot1(Mid);
Plot2(Uppr);
Plot3(Lwr);

{Add formatting and embellish to suit your taste...<grin>}


-- 
Dave Nadeau
Fort Collins, CO