API Support Forum
OEC API > Market Data > Tick Data
Author Topic: Tick Data
(33 messages, Page 2 of 2)
Moderators: VPfau
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Jun 13, 2008 @ 02:48 PM             Msg. 2 of 33
Sorry, but there is no such sample.

Please call OECClient.RequestTicks, then handle OnTicksReceived event.
DMu72
Posts: 20
Joined: May 28, 2008


Posted: Jun 13, 2008 @ 03:21 PM             Msg. 4 of 33
In Help writed "OECClient.RequestTicks Method
Requests price ticks for given time range"
How get tick-history in format:
Timestamp; Price; Volume ?
DMu72
Posts: 20
Joined: May 28, 2008


Posted: Jun 13, 2008 @ 03:52 PM             Msg. 6 of 33
Before use method RequestTicks,
example
ff = api.RequestTicks(mSymbol, mStartDate, mEndDate)
neeed declareted type result variable/array, in the example "ff"
What class I must type
Dim ff As OECAPICOM.?????????
?
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Jun 13, 2008 @ 03:57 PM             Msg. 8 of 33
The method

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

returns only Subscription object. Tick data are loaded asynchronously, and will be passed to a handler of the event

OnTicksReceived:

public delegate void OnTicksReceivedEvent(Subscription Subscription, Ticks Ticks);

where Ticks object holds timestamps, prices and volumes, and Subscription object is passed to associate data with the RequestTick call, so you can issue multiple requests at a time.
DMu72
Posts: 20
Joined: May 28, 2008


Posted: Jun 13, 2008 @ 04:38 PM             Msg. 10 of 33
Pls, give an example how get tick history

Private Sub CommandButton1_Click()

Dim mSymbol, mStartDate, mEndDate As String

mSymbol = Range("B1") ' QMN8
mStartDate = Range("K8") ' 12.06.08 00:00
mEndDate = Range("K9") ' 12.06.08 12:00

?????


End Sub

What must write instead of "?????" that should have tick-history ?
DMu72
Posts: 20
Joined: May 28, 2008


Posted: Jun 15, 2008 @ 03:23 PM             Msg. 12 of 33
Thanks for helps - I did it by self
All ok.
But
1. object Ticks return Volumes in formate UInt16[] and Excel.VBA return error.
In Watches it look as:
Expression Value Type
Volumes <Unsupported variant type>
Volumes(0) <Unsupported variant type>
Volumes(1) <Unsupported variant type>
....

I think, it is incompatibility of datatype VBA and OEC.API.
How overcome it?

2. object Ticks return some records, in example 4096
In Watches it look as:
Expression Value Type
Prices Single(0 to 4095)
...........

How get quantity records in returned object Ticks ?

3. Why ALL values Ticks.Types = 0 ?
DMu72
Posts: 20
Joined: May 28, 2008


Posted: Jun 16, 2008 @ 12:55 AM             Msg. 14 of 33
and (for example ESM8)
4. Timestamps NOT unique because NOT include milisecond
Timestamps Prices
13.06.08 00:01:03,0 ; 1 342,25
13.06.08 00:01:03,0 ; 1 342,25
13.06.08 00:01:03,0 ; 1 342,25
13.06.08 00:01:03,0 ; 1 342,25
13.06.08 00:01:03,0 ; 1 342,50
13.06.08 00:01:03,0 ; 1 342,50
13.06.08 00:01:03,0 ; 1 342,50
13.06.08 00:01:03,0 ; 1 342,50
13.06.08 00:01:03,0 ; 1 342,50
13.06.08 00:01:04,0 ; 1 342,50
13.06.08 00:01:04,0 ; 1 342,50
13.06.08 00:01:04,0 ; 1 342,50
13.06.08 00:01:04,0 ; 1 342,50
13.06.08 00:01:04,0 ; 1 342,50
13.06.08 00:01:12,0 ; 1 342,25
13.06.08 00:01:16,0 ; 1 342,75
13.06.08 00:01:17,0 ; 1 342,75

What I must do to make more precise Timestamps ?
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Jun 16, 2008 @ 08:24 AM             Msg. 16 of 33
sorry, we currently are not getting milliseconds from exchange, so there is no way to get more precise timestamps.
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Jun 16, 2008 @ 09:06 AM             Msg. 18 of 33
it seems UInt16 type is not supported by Excel version you are using. Try to use newer version with VBA.NET or use other .NET enabled environment.
DMu72
Posts: 20
Joined: May 28, 2008


Posted: Jun 16, 2008 @ 02:13 PM             Msg. 20 of 33
How about question ?2 :
2. object Ticks return some records, in example 4096
In Watches it look as:
Expression Value Type
Prices Single(0 to 4095)
...........

How get quantity records in returned object Ticks ?
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Jun 16, 2008 @ 02:46 PM             Msg. 22 of 33
the volumes with incompatibile type (referred in previous reply) are the quantities, so currently you have no access to them from Excel.
DMu72
Posts: 20
Joined: May 28, 2008


Posted: Jun 16, 2008 @ 04:00 PM             Msg. 24 of 33
Y not understoud me.
I asked about counter returned records.
"How many records returned?"

In debuger I see it.

How I can get it value in program variable?
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Jun 16, 2008 @ 04:36 PM             Msg. 26 of 33
for language-specific questions I would suggest using Microsoft documentation. for example,
http://msdn.microsoft.com/en-us/library/sb29et9e.aspx