IBrokers Interactive Brokers data

Discussion in 'Programming' started by ganesha, Jun 9, 2013.

  1. ganesha


    I need 1 minute historical data for NSE futures going back say 6 months. I am not even sure if I can do this with Interactive Brokers and IBrokers. This is what I did,

    t = twsFUT(conId = "125220543", symbol="AXISBANK",exch="NSE",expiry="20130627",currency="INR",include_expired="1")

    Now this is the June expiry future on AXISBANK. What is the command to get one minute data for this contract for say the month of may?

    I used

    x <- reqHistoricalData(tws, t, bar="1 min",dur="25 D",endDateTime = '20130607 15:00:00')

    and got the error

    Historical Market Data Service error message:Starting time must occur before ending time

    I guess I don't really understand the parameters of the reqHistoricalData function. What does bar mean? What does dur mean? What does endDateTime mean? And in which time zone do I get the data?

    Please help.
  2. lwlee


    For any serious discussion on IB's TWS API, you should join

    Yahoo TWSAPI
  3. That's available on Bloomberg.
  4. Here's a website that is pretty useful for financial R users out there. They recently added R API access for a bunch of financial instruments. It is only historical end-of-day but you can't beat the price. They have COT data also.


    Here is an example command you would enter in the R console:

    read.csv('http://www.quandl.com/api/v1/datasets/OFDP/FUTURE_CL1.csv?&trim_start=1983-03-30&trim_end=2013-06-11&sort_order=desc', colClasses=c('Date'='Date'))

    This pulls all of the OHLC data for WTI Crude from 1983-present.
  5. Download this


    then you should be able to download your 1min data for 6mth. You have to let the app run this by giving it your contract and each tradingday for 6mths (can import via a csv file see /db dir for examples). It will run for along time as after each 60 requests its needs to wait 10min's + same contract period can only be submitted every 2 secs. Note these wait times are all in the app so no need to babysit.

  6. simsim67


  7. spacewiz


  8. Xraptor


    James, the trade-manager closed Do you have the arhive of project?
  9. Xraptor


    Uhh, I found the trade-manager on GitHub
    #10     Apr 29, 2016