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.