Skip to content

problem with getting Historical data for futures using I Brokers package

7 messages · Enrico Schumann, Gautam Garg, G See

#
Hi ,
I am trying to get historical data for futures using I brokers package. I am
able to do so with the expiry dates which are yet to come but not for the
dates that have passed.

Below is my code :

 >     t<-twsFUT(symbol="III",exch="NSE",expiry="201106",currency="INR")
 >    abb <- reqHistoricalData(tws,t ,file="III.csv" ,bar="1 day", dur="5
D")
waiting for TWS reply on III .... done.


but if the write the code below:
TWS Message: 2 -1 2107 HMDS data farm connection is inactive but should be
available upon demand.hkhmds2
waiting for TWS reply on III ....failed.
Warning message:
In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
  No security definition has been found for the request




What is that I am missing?
Thanks in advance
Gautam Garg 

--
View this message in context: http://r.789695.n4.nabble.com/problem-with-getting-Historical-data-for-futures-using-I-Brokers-package-tp3593480p3593480.html
Sent from the Rmetrics mailing list archive at Nabble.com.
#
try adding "include_expired = '1'" to the contract definition; see
?twsContract

regards, enrico
#
Thanks that helped but now it is giving another error.

here is the code:

t<-twsFUT(symbol="WPRO",exch="NSE",expiry="201105",currency="INR",include_expired
= '1')
TWS Message: 2 -1 2104 Market data farm connection is OK:hkfarm 
waiting for TWS reply on WPRO ......failed.
Warning message:
In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
  Historical Market Data Service error message:HMDS query returned no data:
WIPRO11MAYFUT at NSE Trades

Is it something to do the ticker?

--
View this message in context: http://r.789695.n4.nabble.com/problem-with-getting-Historical-data-for-futures-using-I-Brokers-package-tp3593480p3595654.html
Sent from the Rmetrics mailing list archive at Nabble.com.