Author |
Topic: Historical Data (32 messages, Page 2 of 2) |
||||
---|---|---|---|---|---|
Moderators: VPfau | |||||
AAlexander39 Posts: 18 Joined: Dec 17, 2010 |
Beginning of the downloaded range
1332,75 30.05.2011 9:16:56 The end of the downloaded range 1341,5 31.05.2011 7:54:47 (2 packages of 4096 tics) Current price and time 1341,25 31.05.2011 16:42:00 Function of subscription: api.SubscribeTicks api.Contracts.Item("ESM1"), Datetime.time Value of Datetime.time = 31.05.2011 08:42:00 EDT (or 16:42:00, 31.05.2011 Russia) Procedure in the module "OECClass" Private Sub c_OnTicksReceived(ByVal Subscription As OECAPICOM.ISubscription, ByVal Ticks As OECAPICOM.ITicks) If Ticks.PriceList.Length > 0 Then MsgBox count_y For y = 1 To Ticks.PriceList.Length - 10 count_y = count_y + 1 Sheet4.Cells(count_y, 5).value = Ticks.PriceList.Item(y) Sheet4.Cells(count_y, 6).value = Ticks.TimestampList.Item(y) Next y Alexander Barbarash |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
Could you please make sure that you use UTC in StartDate parameter?
Victor Vins Software Developer |
||||
AAlexander39 Posts: 18 Joined: Dec 17, 2010 |
I used value of time in all possible formats. Including UTC.
I tried to enter different values of time in StartDate parameter, from current to two-day remoteness. As a result in any type of inquiries (database query) it is downloading about 8000 tics, as before... But tics in last 1-2 hours do not loading at all. ?ould You please try to check up this function work, may be I do something wrong or this function works not correctly. Send please the real sample of a code for historical data reception for last 10 seconds. Alexander Barbarash |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
void SubscribeTickChart(Contract contract)
{ WriteLine("SubscribeTickChart: {0}", contract); client.SubscribeTicks(contract, DateTime.UtcNow.AddSeconds(-10)); } void client_OnTicksReceived(Subscription Subscription, Ticks Ticks) { if (Ticks.Timestamps.Length > 0) { WriteLine("TICKS {0}, {3:s}: {1:s} - {2:s} ({4} ticks)", Subscription.Contract, Ticks.Timestamps[0], Ticks.Timestamps[Ticks.Timestamps.Length-1], DateTime.UtcNow, Ticks.Timestamps.Length); } } Results: TICKS ESM1, 2011-06-07T13:33:51: 2011-06-07T13:33:41 - 2011-06-07T13:33:50 (327 ticks) As you can see this functionality is working correctly. Victor Vins Software Developer |
||||
AAlexander39 Posts: 18 Joined: Dec 17, 2010 |
VBA eject an error for such code:
api.SubscribeTicks api.Contracts.Item("ESM1"), DateTime.UtcNow.AddSeconds(-10) compile error: "Method or data member not found" It is about "UtcNow" Besides that, VBA does not define element WriteLine. { WriteLine("TICKS {0}, {3:s}: {1:s} - {2:s} ({4} ticks)", Subscription.Contract, Ticks.Timestamps[0], Ticks.Timestamps[Ticks.Timestamps.Length-1], DateTime.UtcNow, Ticks.Timestamps.Length); } Could you please send me a code written for VBA 6.5? Alexander Barbarash |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
You can replace DateTime.UtcNow to something similar in VB that will return the current UTC time and WriteLine to Print (or something like that)
Victor Vins Software Developer |
||||
AAlexander39 Posts: 18 Joined: Dec 17, 2010 |
Thank you very much for your help & time. I appreciate it.
Now I can receive the information about each finished transaction. Is it possible to receive values of the price only after its change i.e. that there were no repeating of the same value. Alexander Barbarash |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
Alexander, we send a quote update if any value in the quote was changed. For example, Total Volume has been changed, but Last Price is still the same.
Victor Vins Lead Software Developer |
||||
AAlexander39 Posts: 18 Joined: Dec 17, 2010 |
Ok, I will cope with it
There is other problem. I need to download tics for 5-10 contracts simultaneously. But at subscription only to the third contract this error stands out: "Run-time error '-2147467261(80004003)'. Automation error" What should I do? Alexander Barbarash |
||||
AAlexander39 Posts: 18 Joined: Dec 17, 2010 |
Ok, I will cope with it
There is other problem. I need to download tics for 5-10 contracts simultaneously. But at subscription only to the third contract this error stands out: "Run-time error '-2147467261(80004003)'. Automation error" What should I do? Alexander Barbarash |
||||
AAlexander39 Posts: 18 Joined: Dec 17, 2010 |
Victor, where are you?
Alexander Barbarash |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
You can subscribe as much tick subscriptions as it is configured for you by customer service.
Error message: could you please send me a sample code to reproduce it? Victor Vins Lead Software Developer |
||||