[R-SIG-Finance] Bollinger Bands error

Jeff Ryan jeff.a.ryan at gmail.com
Thu Oct 21 23:47:56 CEST 2010


Hi Nikos,

Your object (a data.frame, not a matrix) isn't coercible to a
time-series object (you have no 'time' component).

Try ?xts or the list to get an idea of a better way to manage time
series data, or provide a bit more code for us to look at.

Incidentally, a zoo object, or even a properly formatted
matrix/data.frame that as.xts can handle would be all that is needed.

Jeff

On Thu, Oct 21, 2010 at 4:37 PM, Nikos Rachmanis
<nikos.rachmanis at gmail.com> wrote:
> Hi all,
>
>
>
> I am new to R and I would appreciate if someone can help me out with the
> following problem. I am trying to use the TTR package in order to calculate
> the Bollinger Bands. I have created a matrix with the Open, High, Low and
> Close variables using the following command:
>
>
>
> OHLC<-data.frame(open, high, low, close, check.names=TRUE)
>
>
>
> However every time I am trying to run the command ( BBands(OHLC, n=20,
> maType, sd=2, ...)) this is the error I am getting:
>
>
>
> "Error in inherits(x, "xts") : object 'x' not found"
>
>
>
> Has anyone came across this problem in order to know the solution?
>
>
>
> Thanks a lot in advance,
>
>
>
> Nikos
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch 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.
>



-- 
Jeffrey Ryan
jeff.a.ryan at gmail.com



More information about the R-SIG-Finance mailing list