[R-SIG-Finance] Don't success to create xts from lines in code

pierre8r-list at yahoo.fr pierre8r-list at yahoo.fr
Fri Jul 25 08:23:31 CEST 2008


> I would read it as a data.frame, since the index has a
> comma, then
> convert to xts.
> 
> quotes <- read.csv(textConnection(lines), header=FALSE)
> x <- as.xts(quotes[,-(1:2)],
> as.POSIXct(paste(quotes[,1],quotes[,2]),format='%Y.%m.%d
> %H:%M'))
> colnames(x) <-
> c('Open','High','Low','Close','Volume')
> 

Thanks Josh. 
I just changed lines to Lines and it works.

This data format is the data format for historical quotations from MetaTrader 4 :
http://www.metaquotes.net/

Anybody can download MT4 client and open a account with a e-mail for free.
Then download historical Forex datas for free.

In french :
Menu / Outils / Archives

In english something near that :
Menu / Tools / Historical data

Maybe this R code could be added to show how to import for free Forex quotations into R.

Regards,

Pierre8r



      ____________________________________________________________
ente http://mail.yahoo.fr



More information about the R-SIG-Finance mailing list