r - IBrokers Historical Index Data -


How do I get historical data from an index from R for interactive brokers? If this was a futures, I would use this command (as outlined here):

  Library (twsinstrum) a & lt; - reqHistoricalData (tws, getContract ("ESJUN2013"))   

But the commanding related to the connid of the S & P index gives an error:

  & gt; A & lt; - ReqHistoricalData (tws, getContract ("11004968")) Connect with customer 110. Contract details request complete. Disconnected. Waiting for reply to TWS reply at ES .... Warning message: Error in handler (cone, verbose, ok = c (165, 300, 366, 2104, 2106,: error validating request: - 'uc': reason - Contract termination of HMDS expired: contract can not be terminated.    

Index data is not accessible to market data, but I think the following should be done.

  reqHistoricalData (tws, twsIndex (symbol = "SPX", exch = "CBOE")) # Waiting for TWS # SP Reply on x ... unsuccessful. # # Faucet # # Warning Message: ## Error Handler (Conn, Verbose, OK = C (165, 300, 366, 2104, 2106, ## Historical Market Data Service Error Message: Code>  

is the result of reqContractDetails by using the same result as the one that proves that the contract object is properly sent to twsIndex < ## [[1]] ## 1 list 8 ## $ Version: Crow "8" ## Contract: ("twoIndex" (symbol = "SPX", exch = "CBOE")) List of 16 ## .. $ CONID: CR "4 16 9 4 "## .. $ Symbol: Crow" SPX "## .. $ Securities: Crow" Ind "# $ .. $ exch: chr" CBOE "## .. $ Primary: chr" ## .. $ Termination: chr "" ## .. $ strikes: chr "0" ## .. $ Currency: Chr "USD" ## .. $ right: chr "" ## .. $ local: chr "SPX" # # $ $ Multiplier: chr "" ## .. $ combo_legs_desc: chr "" ## .. $ Comboleg: chr "" ## .. $ include_expired: chr "" ## .. $ secIdType: chr "" # # Sec: $ secId: chr "" ## ..- etter (*, "square") = "TwsContract" ## $ Market Name: chr "SPX" ## $ Trading Class: CR "SPX" ## $ Conid: CR "416904" ## $ Minute Tric: CR "0.01" ## $ Order Type: Cr [1:22] "Adjustment" "Adjust" "A Rules "" Aeloosi "... ## $ valid Aksksenj: CRR" en: CBOE "## $ Value Manager: CR" 1 "Conaid under ## $ CR" 0 "## $ Lnbanam: CRR" S & A; P 500 Stock Index "## $ Contract: Crores" ## $ Industry: CR "Index" ## $ Category: CR "Broad Range Equity Index" ## $ Subcategory: CR "*" ## $ Timezone ID: Crow " CST "## # Businesshors: Chr" 20130321: 0830-1500; 20130322: 0830-1500 "## $ LiquidHouse: chr" 20130321: 0830-1500; 20130322: 0830-1500 "##

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -