API Support Forum
OEC API > API Support > Historical Data
Author Topic: Historical Data
(32 messages, Page 1 of 2)
Moderators: VPfau
AAlexander39
Posts: 18
Joined: Dec 17, 2010


Posted: Apr 13, 2011 @ 02:36 PM             Msg. 1 of 32
I need to download the historical Data (history of all changes of the price on the futures contract) on Excel sheet through API (for VBA) in a real time mode.
I need to see all tics (Including last) without delays!
How can I do this? And what functions should I use?
Do you have any examples?
Thankyou!

Alexander Barbarash
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Apr 14, 2011 @ 08:43 AM             Msg. 2 of 32
Hello,

We have no sample how to implement downloading of ticks in VBA. But you can use "Advanced API Example"
http://www.openecry.com/services/api_highlights.cfm?ClientUpdate=0_5001_1 for references.

Victor Vins
Software Developer
AAlexander39
Posts: 18
Joined: Dec 17, 2010


Posted: Apr 14, 2011 @ 09:44 AM             Msg. 3 of 32
What a pity!
But If you do not have any examples for VBA, could You please write
concrete functions to implement downloading of ticks in VBA in a real time mode?
What would you use for yourself on my place?

Alexander Barbarash
AAlexander39
Posts: 18
Joined: Dec 17, 2010


Posted: Apr 25, 2011 @ 12:56 PM             Msg. 4 of 32
I still have not received the answer from you. Your previous answer contained a lot of examples for C ++. Could You please write
concrete functions to implement downloading of ticks in VBA in a real time mode?

Alexander Barbarash
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Apr 27, 2011 @ 01:02 PM             Msg. 5 of 32
Sample of request:
c.SubscribeTicks c.Contracts.Item("ESM1"), DateTime.Date

Sample of event handler:
Private Sub c_OnTicksReceived(ByVal Subscription As OECAPICOM.ISubscription, ByVal Ticks As OECAPICOM.ITicks)
If Ticks.PriceList.Length > 0 Then
Dim p As Double
Dim v As Integer
p = Ticks.PriceList.Item(0)
v = Ticks.VolumeList.Item(0)
End If
End Sub

Victor Vins
Software Developer
AAlexander39
Posts: 18
Joined: Dec 17, 2010


Posted: Apr 28, 2011 @ 11:05 AM             Msg. 6 of 32
Thanks for the answer.

Using: c. SubscribeTicks c. Contracts. Item ("ESM1"), DateTime. Date
It is not possible to subscribe for reception of tics on the necessary futures.

If to write: api. SubscribeTicks c. Contracts. Item ("ESM1"), DateTime. Date,
Than the subscription occurs, but there is other problem -
In a data array of tics, instead of all values, only some prices (nearby 7) from different time ranges are present.

I need to receive all values on several futures simultaneously.

I need to obtain data not only at updating the array of tics of the broker, but with my inquiry, when it necessary.

Alexander Barbarash
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Apr 28, 2011 @ 12:01 PM             Msg. 7 of 32
SubscribeTicks returns all historical ticks starting from defined startDate up to now and then sends all real-time ticks until subscription will be cancelled.

Victor Vins
Software Developer
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Apr 28, 2011 @ 02:27 PM             Msg. 8 of 32
Server sends several packets with historical ticks, 4096 ticks per each packet.

Victor Vins
Software Developer
AAlexander39
Posts: 18
Joined: Dec 17, 2010


Posted: Apr 28, 2011 @ 03:14 PM             Msg. 9 of 32
how do I get the latest 4096 prices?
They interest me!
please correct my code

Alexander Barbarash
AAlexander39
Posts: 18
Joined: Dec 17, 2010


Posted: Apr 28, 2011 @ 03:37 PM             Msg. 10 of 32
in general, ideally, I want to ask for and receive
only one tick from an array of broker

I used this method before:
api.Contracts.Item("ESM1").CurrentPrice.LastPrice

Now I want to download tick by sending its serial number

Alexander Barbarash
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Apr 28, 2011 @ 03:46 PM             Msg. 11 of 32
Serial number? We don't provider such functionality.

Victor Vins
Software Developer
AAlexander39
Posts: 18
Joined: Dec 17, 2010


Posted: Apr 28, 2011 @ 04:03 PM             Msg. 12 of 32
I mean the number in the in an array.
eg
Ticks.PriceList.Item (43)

Number 43

Alexander Barbarash
AAlexander39
Posts: 18
Joined: Dec 17, 2010


Posted: May 06, 2011 @ 02:28 PM             Msg. 13 of 32
Hello!
Is there such possibility in API?
It is necessary for us.

Alexander Barbarash
VictorV
Posts: 746
Joined: May 08, 2007


Posted: May 06, 2011 @ 03:12 PM             Msg. 14 of 32
No, we do not provide ticks by their serial numbers.

Victor Vins
Software Developer
AAlexander39
Posts: 18
Joined: Dec 17, 2010


Posted: May 20, 2011 @ 09:19 AM             Msg. 15 of 32
I have a real account and worked with it actively, but have stopped because of the problem which I cannot solve.

It is necessary for me to download all values of the prices (tics) for last minute.

Using the function api.Contracts.Item(6AH1).CurrentPrice.LastPrice does not give result because of impossible to load some values at fast changing of the price, even if to make frequent inquiries to the server.

I try to solve this problem very long! and I ask your... HELP ME PLEASE! I can not do it my self!

Alexander Barbarash
VictorV
Posts: 746
Joined: May 08, 2007


Posted: May 23, 2011 @ 01:13 PM             Msg. 16 of 32
Hello,

you need to use SubscribeTicks and OnTicksReceived event to get all ticks.

Victor Vins
Software Developer
AAlexander39
Posts: 18
Joined: Dec 17, 2010


Posted: May 26, 2011 @ 11:15 AM             Msg. 17 of 32
Thank you for fast and exact answer.
After long programming I have forced this function to work.
But...

No matter what time I wrote at a subscription, I always receive 2 packages of 4096 tics.
Here is how I subscribe:
api.SubscribeTicks api.contracts.Item("6EM1"), DateTime.time - 0.00057

Here is a range of tics what I receive:
140,89 25.05.2011 17:34:00
141,63 26.05.2011 06:57:34

It is not possible to download Tics for the specific range of time.
I need tics in a real time mode for only last 10 seconds!

Alexander Barbarash
VictorV
Posts: 746
Joined: May 08, 2007


Posted: May 26, 2011 @ 11:18 AM             Msg. 18 of 32
What value is DateTime.time?

Victor Vins
Software Developer