API Support Forum
OEC API > Market Data > How to request historical weekly and monthly bars
Author Topic: How to request historical weekly and monthly bars
(3 messages, Page 1 of 1)
Moderators: VPfau
CWeber984
Posts: 226
Joined: Apr 24, 2012


Posted: Mar 10, 2014 @ 07:55 PM             Msg. 1 of 3
I'm having a hard time finding out the expected interval to use when making a history request for weekly and monthly bars.

Here's what my request looks like so far:

OECAPI()->RequestBars(
valid contract,
0,
now.m_dt,
OECAPICOM::SubscriptionType::SubscriptionType_Bar,
1440 * 7
);

My primary questions:
1) Should I be using a different subscription type?
2) What is the int interval the api recognizes for weekly and monthly bars?

Thanks,

CHW
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Mar 11, 2014 @ 09:12 AM             Msg. 2 of 3
Please try to use SubscriptionType_WeeklyBar and SubscriptionType_MonthlyBar with interval=1

Victor Vins
Lead Software Developer
CWeber984
Posts: 226
Joined: Apr 24, 2012


Posted: Mar 11, 2014 @ 09:09 PM             Msg. 3 of 3
OK. I did that:

OECAPI()->RequestBars(
valid contract,
from time as double,
to time as double,
OECAPICOM::SubscriptionType::SubscriptionType_WeeklyBar,
1
);

Works great. Same for the monthly equivalent.

Thanks,

Edited by CWeber984 on Mar 11, 2014 at 21:10:44