API Support Forum
OEC API > API Support > RequestBars two OnBarsReceived events
Author Topic: RequestBars two OnBarsReceived events
(6 messages, Page 1 of 1)
Moderators: VPfau
LCarter2
Posts: 20
Joined: Jun 13, 2013


Posted: Aug 22, 2013 @ 01:42 PM             Msg. 1 of 6
I have noticed with the RequestBars method, there appear to be 2 calls to the OnBarsReceived event. This first call has data and the second does not have any data.

Is this expected?

Leigh Carter
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Aug 22, 2013 @ 02:03 PM             Msg. 2 of 6
Empty packet is a indicator of the end of historical loading. After that all incoming packets are real-time ones (if you subscribed to real-time updates)

Victor Vins
Lead Software Developer
LCarter2
Posts: 20
Joined: Jun 13, 2013


Posted: Aug 22, 2013 @ 02:14 PM             Msg. 3 of 6
How do I make sure that I am not subscribed to realtime updates?
Does this affect the Level 1 and Level 2 data if I am not subscribed?

Leigh Carter
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Aug 22, 2013 @ 02:40 PM             Msg. 4 of 6
I meant bar subscription. So, you can request just historical bars (http://www.openecry.com/api/api/html/Overload_OEC_API_OECClient_RequestBars.htm) or request historical bars and real-time updates (http://www.openecry.com/api/api/html/Overload_OEC_API_OECClient_SubscribeBars.htm). These calls do not affect Level 1 and 2 subscriptions.

Victor Vins
Lead Software Developer
LCarter2
Posts: 20
Joined: Jun 13, 2013


Posted: Aug 22, 2013 @ 02:48 PM             Msg. 5 of 6
OK, I am still not getting it.
I have not made any calls to SubscribeBars. From the API I don't see any way to specify realtime updates.

Am I missing something obvious here?

Leigh Carter
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Aug 22, 2013 @ 02:55 PM             Msg. 6 of 6
So, if you didn't call SubscribeBars, empty packet is just an indication of the end of historical loading without real-time updates after that.

Victor Vins
Lead Software Developer