Historical Data is populated into your spreadsheet, not a separate CSV file. It's populated there by VBA functions that you're going to write.
Also, it comes slowly. It can take 10 or more seconds to load a days worth of 1 minute data, depending upon how loaded IB is.
Finally, it's not something you're going to hack together in a single command. You have to carefully go through the documentation. to write some functions.
Set up a call-back function for Event-ID 2048, which is your Historical Data Event. That Callback function will call your data storage function, which will load the data into your spreadsheet cells as the data comes trickling in from IB.
The data won't all come at once, so you have to handle it and store it to your spreadsheet as it comes. Your callback function takes whatever data comes and passes it to your storage function. That function figures out where to put it, based on it's time stamp, stores it, and exits. This sequence repeats until all the data has arrived. Oh, and guess what? It won't come in order either. You'll have to write logic in your storage routine to order it in time-sequence, as IB often sends it out of order (or some packets get delayed more than others on the internet, making them out of order when they get to you)
Then, there's the easy stuff. You need to subscribe to the historical data and you need to ask for it to be sent. That's all single command stuff. It's the dealing with the data as it comes that takes a little thought.
Tom
On Mon, Jan 12, 2009 at 5:28 AM, amit_dutt_2004 <amit_dutt@...> wrote:
Hi
The example from the document:
Get 1 Month in hourly Resolution for Contract with uid=1974. Allow
also Bars outside from Regular Trading Hours. Let the Bar's Date be
returned in Style 1.
Ret = REQ_HIST_DATA(1974,"20080220","1 M","1 hour",0,1)
how is the data returned?
Does it create a .csv file - like in yahoo?
An example will be greatly appreciated
Thanks