I tried to use the IBrokers package with the simplest code, as shown below:
library(IBrokers) tws <- twsConnect() aapl.csv <- file("AAPL.csv", open="wa") # run an infinite-loop ( <Cc> to break ) reqMktData(tws, twsSTK("AAPL"), eventWrapper=eWrapper.MktData.CSV(1), file=aapl.csv) close(aapl.csv) close(tws)
I get this error:
2 1 321 Error validating request:-'oc' : cause - Incorrect generic tick list of 100,101,104,106,165,221,225,236. Legal ones for (STK)
And everything hangs ...
the whole magazine is here:
R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-pc-mingw32/x64 (64-bit) > library(IBrokers) Loading required package: xts Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from 'package:base': as.Date, as.Date.numeric IBrokers version 0.9-3: Implementing API Version 9.64 This software comes with NO WARRANTY. Not intended for production use! See ?IBrokers for details Warning messages: 1: package 'IBrokers' was built under R version 2.13.2 2: package 'xts' was built under R version 2.13.2 3: package 'zoo' was built under R version 2.13.2 > > tws <- twsConnect() > > aapl.csv <- file("AAPL.csv", open="a") > >
What am I doing wrong here? Any idea for permission or pointer to links is much appreciated.
source share