How to make faster the speed of stream data when used .net c#?

When I used the code to get the 5 minutes data of OHLC , it will update data every 1 minute, how to make the update frequency more faster?

subscriptions.Add(timeSeries.SetupDataSubscription("2330.TW") .WithView("BID") .WithAllFields() .WithInterval(CommonInterval.Intraday5Minutes) .From(DateTime.Now.AddHours(-96)) //.WithNumberOfPoints(4) .OnDataReceived(DataReceivedCallback) .OnDataUpdated(DataUpdatedCallback) .CreateAndStart() );

Best Answer

  • Now I see what you mean. Because the delayed data is heavily conflated on the streaming network, you cannot construct true bars from updates you receive in your subscriptions unless you're entitled to real-time data from the exchange. If you're only entitled to delayed data, then the only way to get true bars is from the timeseries database (this is the data you get into OnDataReceived event).

Answers

  • @andy.ej have you tried subscribing to the real-time service instead? You will have to construct you own OHLC, but the streaming data will be real-time.

  • @andy.ej
    In your example the expected behavior is that OnDataUpdated event should be raised every time an update on the BID field is received on the real-time data stream. If you only get one update a minute I suspect you're probably not entitled to real-time data from Taiwan Stock Exchange, therefore the data you retrieve is for the delayed RIC "/2330.TW", which is updated once a minute. Can you confirm if you're entitled to real-time data from Taiwan Stock Exchange?

  • 1. how to check that I can use the real-time data in Taiwan Stock

    2.You mean I chose the 'BID' field to trigger the update event ,so what is the best field that I should chose ?

  • 1. Type in 2330.TW in the main Eikon command/search bar and hit Enter to display the Company Overview app. Do you see the clock icon with the tooltip "Delayed XX minutes" next to the stock quote as in the screenshot below

    image

    2. I'm not sure I understand what you're saying here. You should choose the view you're interested in. If you're interested in retrieving bid or ask quotes for the stock use WithView("BID") or WithView("ASK") respectively. If you're interested in retrieving the trade price omit the WithView method (the trade price is the default view for stocks) or choose view "TRDPRC_1".

  • I have checked that not entitled to real-time data, but even though I should have the right to get the complete data, I found the api just trigger when have NewPoint-data ,at the same time it should send the previous k-bar data. It will missing the last-close data every 5-minutes bar. How can I get the complete-data?

  • I'm not sure I quite understand what you're saying. It would be helpful if you could describe your experience as a step by step replication procedure. New data points are delivered into OnDataUpdated event, which in your case will be happening once a minute provided there was a price update in the corresponding one minute interval. The backfill history (the timeseries of 5 minute bars) are delivered into OnDataReceived event, which is raised one or more times after the timeseries subscription is created and sent, but is not raised when an update is received from real-time or delayed stream.

  • for example:

    there are four fields:

    1:updat or newpoint event,2:trigger time 3:bar time 4:close

    update 9:15:20 9:15 23.2

    update 9:16:21 9:15 23.1

    update 9:17:22 9:15 23.4

    update 9:18:21 9:15 23.5

    update 9:19:21 9:15 23.5 **(missing 9:19:22-9:19:59 data)

    newpoint 9:20:01 9:20 23.5

    update 9:21:11 9:20 23.5

    I meant the price data between 9:19-9:20 are missing ,how to get the complete data

    Thanks