Welcome, Guest. Please Login
Algorithmic Trading Forum
 
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
R script to load dukascopy csv files (Read 4871 times)
Z
Newbie
*
Offline

Reality is not your
friend.

Posts: 8
London
Gender: male
R script to load dukascopy csv files
11/04/12 at 22:49:31
 
Hello fellow group members.

I've been using dukascopy's historical data and wrote an R script to load it in. Putting it here for people's use:

Code:
require("quantmod")

loadData <- function(file) {
  data <- read.csv(file, sep = ",")
  data$Time <- as.POSIXct(strptime(data$Time, format="%d.%m.%Y %H:%M:%OS"))
  data <- as.xts(data[,2:6], order.by=data$Time)
  data[data$Volume != 0,]
}

# Doesn't work on my PC for some reason, think it has to do with Timezone
loadData2 <- function(file) {
  read.zoo(file, header = TRUE, sep = ",", tz = "GMT",
           format = "%d.%m.%Y %H:%M:%OS")
}
 



Happy modelling!
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print