[R-SIG-Finance] Interesting behaviour in BBands

Stergios Marinopoulos stergios_marinopoulos at yahoo.com
Sun Apr 15 01:38:36 CEST 2012


Thanks for the reply.  In this case, i.e. the absence of volatility, I chose to go with 0.5 for %B for my work.  Assuming the function is differentiable, if you approach from the left (could you even approach from the right a priori?), the limit is 0.5.  I don't think there is a discontinuity in the definition, so I just kept 0.5.  I suppose I could always work it out using L'Hopital's Rule, but that is best left as an exercise for undergraduates!

--
Stergios Marinopoulos



Date: Fri, 13 Apr 2012 13:07:06 -0700
From: BBands <bbands at gmail.com>
To: R-sig-finance <r-sig-finance at stat.math.ethz.ch>
Subject: Re: [R-SIG-Finance] Interesting behaviour in BBands
Message-ID:
    <CAGS5yBVONfEf49kEU+Rac5dckeA+fJL0UQ4d4E9QAQPutftBsw at mail.gmail.com>
Content-Type: text/plain; charset="ISO-8859-1"

Sorry, missed this when it hit. I'd say that if standard deviation = 0
then Bollinger Bands and the derived indicators such as %b are not
defined for that period and NaN would be the correct treatment.

Best,

John Bollinger

On Sat, Feb 18, 2012 at 3:52 PM, Stergios Marinopoulos
<stergios_marinopoulos at yahoo.com> wrote:
> There's an interesting behavior in BBands when dn, mavg, and up are the same
> value.? Here's an example:
>
>
> library(quantmod);
>
> getSymbols("SPY", from="1993-01-31", to="1996-01-01" ) ;
> bb <- BBands(Cl(SPY), n=3, sd=0.3, maType=EMA) ;
>
>
> bb[bb$pctB==Inf,]
> ??????????????? dn???? mavg?????? up pctB
> 1993-04-16 44.92297 44.92297 44.92297? Inf
> 1995-02-09 48.25296 48.25296 48.25296? Inf
>
>
> And here's the graphic display for the fist Inf occurrence:
>
>
> chartSeries(SPY["1993-04-10::1993-04-20",])
> addTA(bb,on=1)
>
>
> Notice pctB is Inf when the dn & up are coincident with mavg.? I don't think
> Inf is the right interpretation here, as the mavg line is not Inf % between
> the up and down.? Would zero be a better interpretation here?
>
>
> Thanks for your thoughts.
>
> --
> Stergios Marinopoulos
> ? ? ? ?[[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.



-- 
John Bollinger, CFA, CMT
www.BollingerBands.com

If you advance far enough, you arrive at the beginning.
*********************************************




More information about the R-SIG-Finance mailing list