[R] intraday OHLC plot

From: Thomas Steiner <finbref.2006_at_gmail.com>
Date: Sat, 22 Mar 2008 11:19:48 +0100


I want to create a open/high/low/last plot of intraday data. I try to use the function plotOHLC from the tsteries package. I create my own multiple time series and then try to plot it.

raw Data Format (file eurusd2.csv):

"Date (GMT)"	"Open"	"High"	"Low"	"Last"
17-03-2008 00:00:00	1,5764	1,5766	1,5747	1,5750
17-03-2008 00:05:00	1,5749	1,5750	1,5741	1,5744
17-03-2008 00:10:00	1,5745	1,5762	1,5741	1,5749

> library("tseries")
> raw=read.delim2("eurusd2.csv")
> date.d=strptime(raw$Date..GMT,"%d-%m-%Y %H:%M:%S")
> x=ts(data=c(raw$Open,raw$High,raw$Low,raw$Last),c="mts")
> plotOHLC(x)

Fehler in if ((!is.mts(x)) || (colnames(x)[1] != "Open") ||
(colnames(x)[2] != :

        Fehlender Wert, wo TRUE/FALSE nötig ist
>

so there is a value missing where it expected a T/F...

In Details of the help on the function plotOHLC it says: The time scale of x must be in Julian dates (days since the origin).

Perhaps anyone can provide help here?
Thanks,
Thomas



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 22 Mar 2008 - 10:23:08 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 22 Mar 2008 - 13:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive