Let's generate some dummy data:
generateData <- function(N) data.frame(time=Sys.time()+1:N,
sym="AUDUSD",
bid=rep(1.2345,N)+runif(min=-.0010,max=.0010,N),
ask=rep(1.2356,N)+runif(min=-.0010,max=.0010,N),
exch=sample(c("EBS","RTM","CNX"),N, replace=TRUE))
prices <- generateData(50)
head(prices, 5)
## time sym bid ask exch
## 1 2014-12-27 18:55:12.727 AUDUSD 1.2352 1.2349 EBS
## 2 2014-12-27 18:55:13.727 AUDUSD 1.2345 1.2356 CNX
## 3 2014-12-27 18:55:14.727 AUDUSD 1.2340 1.2363 CNX
## 4 2014-12-27 18:55:15.727 AUDUSD 1.2347 1.2347 EBS
## 5 2014-12-27 18:55:16.727 AUDUSD 1.2355 1.2353 RTM