API Support Forum
OEC API > API Support > Subscribing to Tick Data and Range Bar Data
Author Topic: Subscribing to Tick Data and Range Bar Data
(3 messages, Page 1 of 1)
Moderators: VPfau
SSprikut637
Posts: 12
Joined: Apr 04, 2011


Posted: Jan 11, 2012 @ 09:02 AM             Msg. 1 of 3
I'm trying to subscribe to the Tick Data and Range Data. I need to get 30 bars of Data with # of Ticks or Range defined.
============
If I want to request only 30 bars with each having 100 (500, 1500) ticks then how much DateTime value should I put in the following method to get
exactly 30 bars in response?? (is there any number of bars value to get that data)


Subscription s = oec.SubscribeBars(oec.Contracts[Contract], DateTime, barType, 100);

Thanks, for your prompt response.

Sergey Sprikut
RuslanK
Posts: 69
Joined: Jun 02, 2010


Posted: Jan 11, 2012 @ 09:12 AM             Msg. 2 of 3
Hello,

In order to request specific amount of bars please use this method:
SubscribeBars(Contract contract, Int32 Amount, SubscriptionType Type, Int32 Interval, Boolean IgnoreSessionBoundaries)
(more details here - http://www.openecry.com/api/api/OEC.API.OECClient.SubscribeBars_overload_4.html)

The second parameter is amount of bars you would like to receive in response.

Please pay your attention to the fact that method can not be called for Range and Momentum bars when last parameter (IgnoreSessionBoundaries) is true.

Ruslan Kartokhin
Software Developer
RuslanK
Posts: 69
Joined: Jun 02, 2010


Posted: Jan 11, 2012 @ 11:12 AM             Msg. 3 of 3
Seems like you need to download most recent version of OEC API from our website. Please use provided link -
http://www.openecry.com/trading/api/documentation.cfm?tabid=1#apitabs

Ruslan Kartokhin
Software Developer