API Support Forum
OEC API > Market Data > Tick Data
Author Topic: Tick Data
(33 messages, Page 1 of 2)
Moderators: VPfau
Eagle
Posts: 1
Joined: Jul 17, 2007


Posted: Jul 17, 2007 @ 02:13 PM             Msg. 1 of 33
Could you elaborate on how tick data is treated?
I was told to address it here, apologies if its in the incorrect
venue

What I have been told thus far: Tick data is sent through as a 1/10 second snapshot.

In the following example occurring in the same second:
10 contracts at 1.31812 and 20 contracts at 1.3813 what is sent
through by the data feed?

Thanks
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Jul 17, 2007 @ 03:39 PM             Msg. 2 of 33
there are two ways to receive tick data:

1: Subscribe for price updates calling OECClient.Subscribe and handle OnPriceChanged or OnPriceTick - both events are called when last price or any price information (such as best bid/ask) is changed. However, these updates will not occur more than 20 times per second.

This is how quotes are displayed in trader.

2: Subscribe for tick updates - OECClient.SubscribeTicks, then handle OnTicksReceived event. This way you will receive only ticks (trades), and no data is missing.

This way is intented for tick charts and automated trading, where no tick should be skipped.

Note: this way requires more network bandwidth and CPU.
TCarter2
Posts: 2
Joined: Aug 28, 2007


Posted: Aug 29, 2007 @ 09:58 PM             Msg. 3 of 33
If all I want is every change in bid or ask value with no data throttling, are you sure I would use SubscribeTicks? How do I get bid/ask from tick array? Isn't that just price? Is there a Type which reflects the bid and/or ask?

Trader
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Aug 30, 2007 @ 08:14 AM             Msg. 4 of 33
Unfortunately, we currently don't provide subscription for bid/ask with no data throttling, and there is no other way to receive bid/ask updates than subscribing for quote updates or DOM (OECClient.Subscribe, OECClient.SubscribeDOM)

Tick data contain only trades, there are no bid/ask information there.
HKusumakar79
Posts: 21
Joined: Feb 18, 2008


Posted: May 21, 2008 @ 09:33 AM             Msg. 5 of 33
I m using OnTickReceived(Subscription Subscription, Ticks Ticks) events.

now i want price from ticks so i m doing like this.
float total = Ticks.Prices[0];

here prices returning array so i m doing this. but sometime it is giving me error index out of range.

can you guide me why it is like that? bcoz when any trade will happen at that time only this event will fire so it must have price array so this error should not be generate.

please guide me.
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: May 21, 2008 @ 09:43 AM             Msg. 6 of 33
when you request historical ticks, they are coming in series of 4096 ticks, followed by empty (0 ticks) packet.

You need to check Ticks.Prices.Length before accessing it. Also several ticks could come at once in the event, so you might want to iterate them all or take last one, instead of processing just first one.
DMu72
Posts: 20
Joined: May 28, 2008


Posted: May 28, 2008 @ 03:21 PM             Msg. 7 of 33
Pls, prompt where get examples API code (VBA, C,...)
receive ticks history (DateTime; Price; Volume)
from DateTimeBegin to DateTimeFinish

Exist limitation remoteness DateTimeBegin relative to DateTimeNow?
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: May 28, 2008 @ 03:29 PM             Msg. 8 of 33
Please use method

public Subscription RequestTicks( Contract contract, DateTime StartDate, DateTime EndDate );

StartDate and EndDate are UTC timestamps.

There is a limitation of 3 days back for availalble ticks and result is limited to 65536 ticks per request.
Ticks are coming in groups by 4096 per group.

And handle event

void OnTicksReceived (Subscription Subscription, Ticks Ticks);

of the OECClient object instance.

All samples are located on the API documentation page of the My Account section of the http://www.openecry.com site.
Note you need to log in to My Account first.
DMu72
Posts: 20
Joined: May 28, 2008


Posted: May 29, 2008 @ 01:26 AM             Msg. 9 of 33
in RequestTicks condition
EndDate - StartDate <= 3 day

can I get tiks history, exampe,
EndDate = 23/03/2008
StartDate = 22/03/2008
if Today = 29/05/2008

?
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: May 29, 2008 @ 08:46 AM             Msg. 10 of 33
No, it is 3 days back from today,so you can get data from 05/26 to 05/29.
DMu72
Posts: 20
Joined: May 28, 2008


Posted: May 29, 2008 @ 03:51 PM             Msg. 11 of 33
Exist any way get early tiks-history?
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: May 29, 2008 @ 04:15 PM             Msg. 12 of 33
No, we do not provide historical ticks over the 3 day limit.
SierraChart
Posts: 111
Joined: Jul 17, 2007


Posted: May 30, 2008 @ 05:21 PM             Msg. 13 of 33
If we want to get all of the past 3 days of historical tick data, and that data is more than 65536 ticks, do we have to make multiple calls to RequestTicks? If so, how can we be sure to get all the data in chronological order?
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Jun 02, 2008 @ 08:33 AM             Msg. 14 of 33
Yes, you will have to do multiple calls, decreasing EndTime according receiving data.

Each tick has individual timestamp, so it should be easy to concatenate tick blocks based on this value.
SierraChart
Posts: 111
Joined: Jul 17, 2007


Posted: Jun 02, 2008 @ 05:01 PM             Msg. 15 of 33
When using multiple requests, it sounds like we will get the latest 65536 records on the first request, and then on our next request we would get the 65536 records prior to that, and so on going backwards in time until we reach the 3 day limit. We would have to buffer the entire response into some temporary buffer (or buffers), and not be able to actually use the ticks until we start receiving the earliest set, at which point we could read back all the data we buffered. This is a lot of extra work. Also I worry that once we finish with all of these requests, there will already be new ticks available which we missed while downloading older data. Is there any way we can make requests so that at least the chucks of data we get are in order from our overall start time to our overall end time? I could try to guess a small enough amount of time that contains less than 65536 records, and make requests in that time interval from the overall start time to the overall end time, but that might take many requests and still possibly not get all the data if a time period was particularly active.
Edited by SierraChart on Jun 2, 2008 at 05:05 PM
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Jun 02, 2008 @ 05:20 PM             Msg. 16 of 33
if you use subscribe request, you will also be receiving new tick updates while old ticks are still loading.

Also you can change your scheme to process chunked data and not waiting for all ticks for 3 days.

It's impossibly to predict how many ticks will be returned for a particular time period for arbitrary market.
DMu72
Posts: 20
Joined: May 28, 2008


Posted: Jun 07, 2008 @ 02:04 PM             Msg. 17 of 33
can I get 1-minute history more 3 days early?
how?
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Jun 09, 2008 @ 08:24 AM             Msg. 18 of 33
you can get up to 14400 1 minute bars per single request (10 days).for all requests available data is limited to 90 days back.
DMu72
Posts: 20
Joined: May 28, 2008


Posted: Jun 13, 2008 @ 02:43 PM             Msg. 19 of 33
Pls, help me find example with RequestTicks on forum or othere?
DMu72
Posts: 20
Joined: May 28, 2008


Posted: Jun 13, 2008 @ 02:44 PM             Msg. 20 of 33
Pls, help me find example with RequestTicks on forum or othere