ib-ruby/ib-ruby — pull request #50 by rab1234 (2012-08-17 14:13:13+00:00)
Title: Hist data

When getting historical data, I encountered an error:

TWS Error 162: Historical Market Data Service error message:No historical market data for EUR/CASH@IDEALPRO Last 60

I noticed in your comments to line 15 of bin/historical_data that you note the same error. Apparently TWS will not accept the :trades message. The problem can be corrected by substituting another symbol, e.g., :bid or :ask. When doing so, TWS returns OHLC data, so trades info can be obtained. I got the answer from StackOverflow here: http://stackoverflow.com/questions/10777885/error-getting-the-eur-usd-historical-data-using-r-on-ibrokers

I changed bin/historic_data to request :bid data, just so the user will not get an error. You may want to handle it differently.

RAB