API Support Forum
OEC API > API Support > Requesting Historical Data
Author Topic: Requesting Historical Data
(4 messages, Page 1 of 1)
Moderators: VPfau
RTymerski
Posts: 9
Joined: Jul 23, 2007


Posted: Jul 23, 2007 @ 05:24 PM             Msg. 1 of 4
I would like to request historical 1 minute bar data for ESU7 using the C++ COM interface. It's not all that clear to me as to how to do this. Could someone show me how this done?

Also, how soon after the data bar is formed is it available for request?And lastly, how far back can does the 1 minute data go?
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Jul 23, 2007 @ 05:44 PM             Msg. 2 of 4
use IOECClient::SubscribeBars method with interval equal to 1 minute (1/1440th of day), then handle OnBarsReceived event to get the data.

You can look at the sample C++ code supplied with OEC COM API, see the "C:\Program Files\OEC\OEC API COM\Samples\Cpp\cppcomsample.sln" project.

CCppCOMSampleDlg::OnBnClickedHistory subscribes for data,
CCppCOMSampleDlg::OnBarsReceived handles the event.

We usually provide up to two weeks of intraday bars, but availability can vary depending on a contract.
RTymerski
Posts: 9
Joined: Jul 23, 2007


Posted: Jul 24, 2007 @ 07:21 AM             Msg. 3 of 4
Serge,
Thanks for reply. I did look at the sample C++ code but I couldn't figure out what the second and third function arguments represented. From what you've written above I now know what the third argument means but I'm still wondering what the second one represents. The sample has a value of zero in this position. What does this give?

After searching the documentation (of the C# library) it appears the second position refers to the start date and time. Would you be good enough to tell me how I would represent the start date and time as: July 23, 2007 9:30 AM ET (for example)?
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Jul 24, 2007 @ 08:17 AM             Msg. 4 of 4
the declaration of the method is
ISubscription SubscribeBars(IContract contract, double StartDate, double Interval);

StartDate and Interval are of OLE Automation DATE type:

The DATE type is implemented using an 8-byte floating-point number. Days are represented by whole number increments starting with 30 December 1899, midnight as time zero. Hour values are expressed as the absolute value of the fractional part of the number.

you can use COleDateTime class (ATL/MFC) to work with DATE values.