Hi
I am trying to run a script using the console remotey on ubuntu using AWS (Amazon). I use R -g Tk & to invoke the console.
The script start with the headings:
analyse pair
library("IBrokers")
#library("urca") # for johansen
library("zoo") #installed by hand
library("tseries") # xts
library("timeSeries")
library("TTR")
library("fUnitRoots")
but when I run it I get an error as follows:
source('/home/ubuntu/Desktop/2018 June/exploreAPairFromIBADF.R')
Error in library("tseries") : there is no package called ‘tseries’
I have tried obtaining tseries by using install.packages but I always get an error message:
I can't paste all of it because its about the allowed limit but
install.packages('tseries')
Installing package into ‘/home/ubuntu/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘TTR’, ‘curl’, ‘quantmod’
...
and then it ends with non-zero exit status for all of them.
Can someone tell me what I am doing wrong.
Thanks.
Can you please locate the error message from the console where the install fails. This package needs to be built from source if you are using install.packages command. Make sure you have installed the r-dev version as well ('sudo apt-get install r-base-dev').
The installation may fail if you 1. have missing compilers and libraries, or 2. mismatched compiler versions(this requires both a c compiler like gcc and a fortran compiler like gfortran) or 3. low memory problem to build the binaries. One option is to check and fix any such issues.
Second option is to install directly from binaries - it is harder for linux flavours, but available for some packages (see for xts here 0.9-7-1 : r-cran-xts : amd64 : Trusty (14.04) : Ubuntu). See the links below on how to use these binaries. Note: if your AWS ubuntu version is not a stable release, this method will probably not work.
1. https://cloud.r-project.org/bin/linux/ubuntu/README.html
2.R and RStudio installation and package error - Ask Ubuntu
Hi Prodipta ------------------------- ANTICONF ERROR --------------------------- Configuration failed because libcurl was not found. Try installing: * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc) * rpm: libcurl-devel (Fedora, CentOS, RHEL) * csw: libcurl_dev (Solaris) If libcurl is already installed, check that ‘pkg-config’ is in your PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config is unavailable you can set INCLUDE_DIR and LIB_DIR manually via: R CMD INSTALL --configure
Hi Prodipta. Sorry these messages don’t paste very well into the comment box.
So it seems you have a missing library here. Please try below at the command line and if it succeeds proceed as usual with install.packages. If it throws up further missing libraries errors, you would need to install them similarly.
sudo apt-get install libcurl4-openssl-dev
Thanks - that has got it working but now I am getting this message as it tries to talk to the gateway: In addition: Warning message: In socketConnection(host = host, port = port, open = “ab”, blocking = blocking) : localhost:7496 cannot be opened. I have localhost set in the gateway settings
solved twsConnect(port = 4002)
Your last problem is not very clear. What gateaway you are referring to? is it Interactive Brokers' IB gateway? Please check the configuration and make sure the port is available there (and not used by another program in your system). Please note, I think TWS and gateway has different configuration. Probably consulting the gateway documentation can help.
problem was finally solved by me specifying the port as a param in the twsConnect call
Hi - I find using the gateway is not as useful as using the tws. When you are using the tws you can ‘see’ better what the results of calls via the api achieve. Are there some instructions about how to load a copy of the tws on linux? I found some instrctions at IB but I can’t find the download link.
TWS is IB's proprietary software. I suggest you check the IB download page and select the version appropriate for your linux distribution (see the link download for other operating systems
below the download button).
Hi I got the 64 bit version down and installed it and it starts opening up but hangs and then fails after I have put my security numbers in. Is it meant to work out of the box or is there something I need to set?