API Support Forum
OEC API > Market Data > How to obtain all EUR/USD daily data
Author Topic: How to obtain all EUR/USD daily data
(3 messages, Page 1 of 1)
Moderators: VPfau
CWeber984
Posts: 226
Joined: Apr 24, 2012


Posted: Jun 22, 2017 @ 09:41 PM             Msg. 1 of 3
For EUR/USD daily charts, I can get data back to March 9, 2009 in OEC Trader using the Load More Data method in the chart rt. click menu.

When I try to request all daily data for EUR/USD via the api, I get back 338 bars for my first request, back to 3/7/2016. Then I make another request to get more daily bars from 1900 to 3/7/2016. I don't get any more bars back.

How can I get all the available daily data for EUR/USD?

These are what my requests look like:

OECAPICOM::IContractPtr con = OECAPI()->Contracts->Item("EUR/USD");
COleDateTime from = 12/31/1899 11:55:00 PM;
COleDateTime to = 6/22/2017 12:18:00 AM;
OECAPI()->RequestBars(con,from.m_dt,to.m_dt,OECAPICOM::SubscriptionType_Bar,1440);
I get 338 daily bars back for this request to 3/7/2016.

OECAPICOM::IContractPtr con = OECAPI()->Contracts->Item("EUR/USD");
COleDateTime from = 12/31/1899 11:55:00 PM;
COleDateTime to = 3/7/2016 10:00:00 PM;
OECAPI()->RequestBars(con,from.m_dt,to.m_dt,OECAPICOM::SubscriptionType_Bar,1440);
I get 0 daily bars back here.

Can you help me to get the EUR/USD daily data back to 2009 as is available in OEC Trader?

Thanks,
CHW
JSmith5611
Posts: 187
Joined:


Posted: Jun 27, 2017 @ 11:13 AM             Msg. 2 of 3
In this case, it is probably better to use the RequestBars(IContract contract, IDuration duration, IBarDescription description) version of RequestBars.
Jason Smith
CWeber984
Posts: 226
Joined: Apr 24, 2012


Posted: Jun 27, 2017 @ 11:12 PM             Msg. 3 of 3
Hi Jason, that worked perfectly well.

Thanks
CHW