Opening a second stream with the same instrument but a different interval results in no data updates
If a stream is opened with a specific instrument and interval (AAPL.O and Daily) and then a second stream is opened with the same instrument and a different interval (AAPL.O and 1M) the second stream does not receive updates. It also happens whether the first stream is closed or left open. Code below...
static void Main()
{
try
{
ISession session = DesktopSession.Definition().AppKey("xxxxxxxxxxxxxxxxxxx")
.GetSession().OnState((state, msg, s) => Console.WriteLine($"{DateTime.Now}: State: {state}. {msg}"))
.OnEvent((eventCode, msg, s) => Console.WriteLine($"{DateTime.Now}: Event: {eventCode}. {msg}"));
session.Open();
// Open a stream with an interval of 1 day
var stream1 = Summaries
.Definition("AAPL.O")
.Fields("OPEN_PRC", "HIGH_1", "LOW_1", "TRDPRC_1", "ACVOL_UNS")
.Count(10)
.Interval(Summaries.Interval.P1D)
.GetStream(session);
bool waitingForFirstUpdate = true;
stream1
.OnInsert((data, t) => { Console.WriteLine("AAPL.O Daily OnInsert"); })
.OnUpdate((data, t) =>
{
Console.WriteLine("AAPL.O Daily OnUpdate");
waitingForFirstUpdate = false;
})
.OnError((data, t) => { Console.WriteLine("AAPL.O Daily OnError"); })
.Open();
while (waitingForFirstUpdate)
{
// As soon as we get the first update we can continue
}
Console.WriteLine("Closing AAPL.O D");
stream1.Close();
var stream2 = Summaries
.Definition("AAPL.O")
.Fields("OPEN_PRC", "HIGH_1", "LOW_1", "TRDPRC_1", "ACVOL_UNS")
.Count(10)
.Interval(Summaries.Interval.PT1M)
.GetStream(session);
stream2
.OnInsert((data, t) => { Console.WriteLine("AAPL.O 1M OnInsert"); })
.OnUpdate((data, t) => { Console.WriteLine("AAPL.O 1M OnUpdate"); })
.OnError((data, t) => { Console.WriteLine("AAPL.O 1M OnError"); })
.Open();
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine($"\n**************\nFailed to execute: {e.Message}\n{e.InnerException}\n***************");
}
}
The output looks like this...
1/26/2024 10:48:22: State: Pending. DesktopSession is Pending
1/26/2024 10:48:24: Event: SessionAuthenticationSuccess. {
"Contents": "Desktop Session Successfully Authenticated"
}
1/26/2024 10:48:24: State: Opened. DesktopSession is Opened
1/26/2024 10:48:24: Event: StreamConnected. {
"Contents": "Successfully connected into the WebSocket server: localhost:9000/api/rdp/streaming/pricing/v1/WebSocket"
}
1/26/2024 10:48:24: Event: StreamAuthenticationSuccess. {
"Contents": "Successfully logged into streaming server localhost:9000/api/rdp/streaming/pricing/v1/WebSocket"
}
AAPL.O Daily OnInsert
AAPL.O Daily OnInsert
AAPL.O Daily OnUpdate
Closing AAPL.O D
AAPL.O Daily OnUpdate
AAPL.O Daily OnUpdate
AAPL.O 1M OnInsert
Even if the original stream is left open the OnUpdate handler for the second stream is never called. This is with version 1.0.3 of the Data Library. It may be related to https://community.developers.refinitiv.com/questions/111730/incorrect-prices-in-update-events-after-closing-an.html as the setup is similar but the behavior is now different.
Best Answer
-
Hello @cory.schmidt.1
I discovered the issue.
The problem was that when creating a stream with an interday interval for a given instrument, metadata would be loaded for those properties and interday rules were generated based on it. When the same instrument would need a second stream with an intraday interval, it would detect that it already has a metadata loaded and would skip loading a second one. This means that for intraday, the same interday rules would be used leading to NO updates published for the intraday stream.
The fix was to modify the dictionary holding our instrument metadata objects to take into account the record type (which differs between intraday and interday intervals).
I will have to review with Nick this approach and if everything is green, I will notify you as soon as we have published a new version.
Below is a snapshot of running the example of this post after the fix:
Thank you for your patience,
Cristian
0
Answers
-
Hello @cory.schmidt.1
I tried investigating using EUR= instead of APPL.O as an instrument and I encountered no issues with inserting and updating for the example given above. EUR= and APPL.O have different blending rules, where for EUR= I wasn't able to spot any issues so far.
This issue might be related with the one described in question 111730. If the incoming message from the queue is processed by incomplete/incorrect rules, it might lead to the intraday summarizer ignoring some resulting records, meaning updates are skipped (or in other cases the opposite might happen, where records are generated when they shouldn't be and then we get extra updates).
I will try to use APPL.O later today when the market is open and see what results I get.
Thank you for your patience,
Cristian
0 -
Hello @cory.schmidt.1
I've tested retrieving data using AAPL.O, but with a small modification. I only opened the one minute stream and it seems there are updates coming in. Only when I open the daily and then close it before I open the second stream with the one minute period, the issue explained above happens.
This might not be related to 111730 after all.
Continuing investigation into the issue...
0 -
Hello @cory.schmidt.1
I've tested retrieving data using AAPL.O, but with a small modification. I only opened the one minute stream and it seems there are updates coming in. Only when I open the daily and then close it before I open the second stream with the one minute period, the issue explained above happens.
This might not be related to 111730 after all.
Continuing investigation into the issue...
0 -
Great news. Thanks!0
-
With version 1.0.4 we are able to receive updates on the second 1-minute stream. Thanks!0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛