[R-SIG-Finance] Trouble using ohlcPlot

Neil Beddoe Neil.Beddoe at mbamfunds.com
Wed Jan 7 13:47:46 CET 2009


Thanks a lot Jeff.  That looks perfect. I'll give it a try.

-----Original Message-----
From: Jeff Ryan [mailto:jeff.a.ryan at gmail.com] 
Sent: 06 January 2009 14:55
To: Neil Beddoe
Cc: r-sig-finance at stat.math.ethz.ch
Subject: Re: [R-SIG-Finance] Trouble using ohlcPlot

A more flexible tool for financial charts can be had in the quantmod package on CRAN.

This should accept all common time-series formats, though 'xts', 'zoo', 'fts', and 'timeSeries' may be the most useful choices for all other things in R at this point in time.

library(quantmod)

#using the mts with colnames set by you

chartSeries(mts)

or barChart(), candleChart(), matchChart()...

Take a look here for examples:

http://www.quantmod.com/examples/charting/

HTH
Jeff

On Tue, Jan 6, 2009 at 5:27 AM, Neil Beddoe <Neil.Beddoe at mbamfunds.com> wrote:
> Hi,
>
> Sorry about the cross-posting with r-help, I've just found this list.
>
> I'm trying to create a time series that will work with ohlcPlot:
>
> mts<-ts(data=c(results$OpenPrice,results$HighPrice,results$LowPrice, 
> results$ClosePrice),c="mts",names=c("Open", "High", "Low","Close"))
>
> ohlcPlot(mts) fails with: Error in if ((!is.mts(x)) || (colnames(x)[1] != "Open") || (colnames(x)[2] !=  : ...
>
> is.mts(mts) returns true but colnames(mts) returns NULL.
>
> I've trawled the archive for an example of using this function to no avail and it's not apparent from the docs what the data needs to look like.  Does anyone have an example of code that will work with this function?
>
> Thanks
>
> Neil
>
>
> .
>
> This message is intended only for the use of the person(s) to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any unauthorised use is strictly prohibited. If you are not the intended recipient, please contact the sender as soon as possible.
>
> It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction, unless specifically agreed otherwise. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any opinions or advice contained in this Internet email are subject to the terms and conditions expressed in any applicable governing Marble Bar Asset Management LLP's  terms and conditions of business or client agreement letter. Any comments or statements made herein do not necessarily reflect those of Marble Bar Asset Management LLP.
>
> Marble Bar Asset Management LLP is regulated and authorised by the FSA.
>        [[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.
>



--
Jeffrey Ryan
jeffrey.ryan at insightalgo.com

ia: insight algorithmics
www.insightalgo.com

.

This message is intended only for the use of the person(s) to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any unauthorised use is strictly prohibited. If you are not the intended recipient, please contact the sender as soon as possible.

It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction, unless specifically agreed otherwise. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any opinions or advice contained in this Internet email are subject to the terms and conditions expressed in any applicable governing Marble Bar Asset Management LLP's  terms and conditions of business or client agreement letter. Any comments or statements made herein do not necessarily reflect those of Marble Bar Asset Management LLP.

Marble Bar Asset Management LLP is regulated and authorised by the FSA.



More information about the R-SIG-Finance mailing list