API Support Forum
OEC API > API Support > OnTicksReceived, historical vs. subscribed data
Author Topic: OnTicksReceived, historical vs. subscribed data
(2 messages, Page 1 of 1)
Moderators: VPfau
SierraChart
Posts: 111
Joined: Jul 17, 2007


Posted: Sep 17, 2007 @ 05:53 PM             Msg. 1 of 2
How do we determine if the data that comes in to the OnTicksReceived event is from a historical request (RequestTicks) or a subscription request (SubscribeTicks)? Without knowing we don't know how to process the data when we want to request both types.
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Sep 18, 2007 @ 08:31 AM             Msg. 2 of 2
Both RequestTicks and SubscribeTicks methods returns a Subscription object. You should use this object to compare it with one passed as a parameter of the OnTicksReceived event in order to determine what request is the data for.

Also, you can use only SubscribeTicks both for getting historical and realtime ticks - if you call it with yesterday datetime, you will get historical ticks from yesterday to present in the first event and then will getting new ticks in subsequent events.