I am trying to upload a group of symbols into the package quantstrat using quantmod::getSymbols.
The symbols I am loading are not available on Yahoo (they are South African stocks), so I need to load them from a local directory and from .csv files.
My symbols file looks as follows:
head(symbols)
[1] "SHFJ" "FSRJ" "RDFJ" "GRTJ" "MTNJ" "SLMJ"....
My symbol price history are in separate csv files, and each contain a date column and OHLC columns, with a header only for the OHLC prices.
I use the function getSymbols.csv function as follows:
getSymbols.csv(symbols, env, dir="E:/data/CData_Files_NB/", return.class = "xts", extension="csv")
but I get the following error message
loading SHFJ .....done.
Error in `colnames<-`(`*tmp*`, value = c("SHFJ.Open", "SHFJ.High","SHFJ.Low", : length of 'dimnames' [2] not equal to array extent
I would much appreciate it if anyone could show me what I am doing wrong. I am not sure if there is another way to load stock prices into the quantstrat package.