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 -
0
-
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 690 Datastream
- 1.4K DSS
- 629 Eikon COM
- 5.2K Eikon Data APIs
- 11 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 255 ETA
- 559 WebSocket API
- 39 FX Venues
- 15 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 25 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 279 Open PermID
- 45 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 2K Refinitiv Data Platform
- 716 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 106 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 95 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛