Author |
Topic: Real Time capturing data (8 messages, Page 1 of 1) |
||||
---|---|---|---|---|---|
Moderators: VPfau | |||||
CBarabucci Posts: 4 Joined: Mar 24, 2021 CB |
Hi, I've developed a Real Time capturing data software.
After Connection, Symbol Lookup and Contract choose, I subscribe the PriceChanged Event:
and in the: I add in a list named lista, my interesting data. The program working fine, the data are correct more or less, if I check the captured data from my software, with the downloaded data from the GAIN Trader archive, some few data are missing, wich other are duplicated. Naturally I check the same values of the same contract in the same interval of time, and they correspond for about 90%. Are there possible to capture real time data with api, without differences, with the Gain Trader archive? Thanks for answer. CB Edited by CBarabucci on Mar 25, 2021 08:30 AM Edited by CBarabucci on Mar 25, 2021 03:52 PM |
||||
JSmith5611 Posts: 187 Joined: |
What archive are you comparing to?
Jason Smith
|
||||
CBarabucci Posts: 4 Joined: Mar 24, 2021 CB |
In the GAIN Trader Developer software, I set the contract of my interest NQM21
In Select period I chose: Tick Indicator1: NQM21 History Indicator2: Vol(NQM21) Volume in the Data/ShowTable I can see the History and Volume, and with the right click a can save the archive in .csv file I discovered that the LastPrice and the LastVol are not the same things of History and Volume, and my software working fine. The problem is that I don't want LastPrice and LastVol, but I want closed price (History) and Volume. Is it possible? How can I do this? Thanks in advance to Jason and to anybody can help me Edited by CBarabucci on May 03, 2021 05:26 PM |
||||
JSmith5611 Posts: 187 Joined: |
If you want to compare to tick history, you should be using a tick subscription instead of a price subscription:
Client.Subscriptions.Ticks.TicksReceived += .... Tick subscriptions provide every price change, and therefore have considerably more data, so you have a much lower limit of how many can be running at once. Jason Smith
|
||||
CBarabucci Posts: 4 Joined: Mar 24, 2021 CB |
Great, I've readed Ticks documentation.
I tried to read every 10 seconds with timer, the last 90seconds Ticks, I don't need more data, I need small updates, but every seconds.
and when the data are received, I load there in lista:
But in lista for 29 seconds, I receive every time the same Ticks, and after 30 seconds the Ticks are update with the new Ticks, now the list are perfect, bat the update is too slow every 30 second... Are there something wrong in my code? Could I receive the possible 20 Ticks per second every 1 or 2 seconds? The GAIN Trader Developer 4.0, it do. Thanks a lot Edited by CBarabucci on May 04, 2021 01:23 PM |
||||
JSmith5611 Posts: 187 Joined: |
What I think you need is to change your tick subscription from one-time to continuous.
var sub = gfClient.Subscriptions.Ticks.Duration.Create(DateTime.UtcNow.AddSeconds(-90)) this will request all the ticks starting 90 seconds ago, and continue recieving new ones as they are generated by the exchange until you manually end the subscription by doing sub.Unsubscribe() Jason Smith
|
||||
CBarabucci Posts: 4 Joined: Mar 24, 2021 CB |
Yesss, understood....
My new code for start Subscribction:
and the code when received data:
For stopping reading I used:
I don't know if there is another way for stop it, perhaps the property .Unsubscribe() is supported... But the more important thing is that now working fine, my data are perfect and I don't need Timer, because every second I receive data, thanks you very much!!! |
||||
JSmith5611 Posts: 187 Joined: |
the line gfClient.Subscriptions.Ticks.Subscribe(contratto.ID, Client.Subscriptions.Ticks.Duration.Create(DateTime.UtcNow.AddSeconds(-1)));
returns a subscription object that you use to unsubscribe. Jason Smith
|
||||