[R-SIG-Finance] Bollinger Bands error
Joshua Ulrich
josh.m.ulrich at gmail.com
Fri Oct 22 00:01:49 CEST 2010
Hi Nikos,
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:
>
You did not create a matrix, you created a data.frame. They are
different. Compare ?data.frame and ?matrix.
> 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"
>
A reproducible example would help. Even if you did not get the above
error, your command should fail because the OHLC object has 4 columns
and BBands only accepts objects with 1 or 3 columns (see ?BBands).
> 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.
>
More information about the R-SIG-Finance
mailing list