Author |
Topic: Historical Data (32 messages, Page 1 of 2) |
||||
---|---|---|---|---|---|
Moderators: VPfau | |||||
AAlexander39 Posts: 18 Joined: Dec 17, 2010 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
Server sends several packets with historical ticks, 4096 ticks per each packet.
Victor Vins Software Developer |
||||
AAlexander39 Posts: 18 Joined: Dec 17, 2010 |
how do I get the latest 4096 prices?
They interest me! please correct my code Alexander Barbarash |
||||
AAlexander39 Posts: 18 Joined: Dec 17, 2010 |
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 |
Serial number? We don't provider such functionality.
Victor Vins Software Developer |
||||
AAlexander39 Posts: 18 Joined: Dec 17, 2010 |
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 |
Hello!
Is there such possibility in API? It is necessary for us. Alexander Barbarash |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
No, we do not provide ticks by their serial numbers.
Victor Vins Software Developer |
||||
AAlexander39 Posts: 18 Joined: Dec 17, 2010 |
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 |
Hello,
you need to use SubscribeTicks and OnTicksReceived event to get all ticks. Victor Vins Software Developer |
||||
AAlexander39 Posts: 18 Joined: Dec 17, 2010 |
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 |
What value is DateTime.time?
Victor Vins Software Developer |
||||