Search the web
Sign In
New User? Sign Up
twslink
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
REQ_HIST_DATA   Message List  
Reply | Forward Message #502 of 548 |
Re: [twslink] REQ_HIST_DATA

I've done this before, so I thought I'd comment.

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




Mon Jan 12, 2009 9:39 pm

extol
Offline Offline
Send Email Send Email

Forward
Message #502 of 548 |
Expand Messages Author Sort by Date

Hello, Is function REQ_HIST_DATA supported yet? If so, I am not sure what value to set for the 'whattoshow' parm. The function REQ_HIST_DATA has a return code...
zephyrmil
Offline Send Email
May 1, 2008
9:26 am

... Hi, sample, MSFT 1 min TRADE bars for 1 day, starting 22.11.2007 CONNECT("",7496,1,500) ...
maxchinaski
Offline Send Email
May 1, 2008
3:06 pm

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...
amit_dutt_2004
Offline Send Email
Jan 12, 2009
1:28 pm

I've done this before, so I thought I'd comment. Historical Data is populated into your spreadsheet, not a separate CSV file. It's populated there by VBA...
Tom Carlson
extol
Offline Send Email
Jan 12, 2009
9:39 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help