Upgrading to Workspace
We will be discontinuing the Eikon Desktop soon in favour of our next generation data and analytics workflow solution, LSEG Workspace. This page is designed to help you assess any changes you may need to make to programmatic (API) workflows. We also provide resources here to help you make those changes as well.
Upgrading to Workspace
Other related resources
Eikon 4 Desktop API (dotNet) Upgrade:
Real-Time
This section outlines the approaches to retrieve streaming market data from the desktop. Both libraries provide the ability to subscribe to 1 or more instruments and receive streaming updates based on activity within the market. In addition, we'll outline the ability to retrieve chains, a mechanism used to define a collection of instrument codes, or constituents, based on specific type of instrument, such as an index, e.g: Dow Jones. For a detailed description of chains, you can refer to this article within the Developer Community.
Eikon .Net APIs
What does 'DataService.Instance.Realtime' provide?
This functionality is used to get real-time, market data for selected instruments and optionally a list of fields. When setting up a subscription, the user is required to provide a callback to capture updates.
The following is the basic setup:
// Namespace reference
var realtime = DataServices.Instance.Realtime;
// Create a subscription to 1 or more instruments specifying fields of interest
var subscription = realtime.SetupDataSubscription()
.WithRics("EUR=", "GBP=")
.WithFields("DSPLY_NAME", "BID", "ASK")
.OnDataUpdated(DataCallback)
.CreateAndStart();
// To capture updates, create a reference to the callback
private void DataCallback(IRealtimeUpdateDictionary updates)
{
// Iterate through all updates
foreach (var update in updates)
{
Console.WriteLine($"Update for item: {update.Key}");
// For each instrument, display the field values
foreach (var value in update.Value)
{
Console.WriteLine($"\t{value.Key} => {value.Value.Value}");
}
}
}
In addition, the APIs support an interface to retrieve chains.
In the sample below, we have requested to retrieve the Nasdaq Top 25 and to monitor updates to the chain.
// Namespace reference
var realtime = DataServices.Instance.Realtime;
// Create a subscription to the Nasdaq Top 25 chain (.AV.O)
var chainSubscription = realtime.SetupChainSubscription(".AV.O")
.OnDataUpdated(ChainUpdatedCallback)
.CreateAndStart();
// To capture updates, create a reference to the callback
private void ChainUpdatedCallback(ChainChunk chainChunk)
{
// Iterate through the chain to capture each update
foreach (var update in chainChunk.Updates)
{
// The following actions describe how a chain can be updated
switch (update.UpdateType)
{
case UpdateType.Added:
Console.WriteLine($"{update.Ric} added at position {update.Position}");
break;
case UpdateType.Removed:
Console.WriteLine($"{update.Ric} removed");
break;
case UpdateType.Changed:
Console.WriteLine($"{update.Ric} position changed to {update.Position}");
break;
}
}
if (chainChunk.IsLast)
{
Console.WriteLine("---------End of update---------");
Console.WriteLine();
}
}
Data Library for .Net
The Data Library for .Net provides an equivalent service allowing developers to register interest in 1 or more instruments and to receive real-time streaming updates representing trades and quotes.
What does 'Data.Content.Pricing' provide?
This functionality is used to get real-time, market data for selected instruments and optionally a list of fields. When defining your pricing stream, the user provides a lambda (or callback) to capture updates.
The following is the basic setup:
// Create a streaming price interface for a list of instruments
// specify lambda expressions to capture real-time events
using var stream = Pricing.Definition("EUR=", "GBP=")
.Fields("DSPLY_NAME", "BID", "ASK")
.GetStream().OnRefresh((item, refresh, s) => Console.WriteLine(refresh))
.OnUpdate((item, update, s) => DisplayUpdate(item, update))
.OnStatus((item, status, s) => Console.WriteLine(status));
stream.Open();
// Pause on the main thread while updates come in. Wait for a key press to exit.
Console.WriteLine("Streaming updates. Press any key to stop...");
Console.ReadKey();
// Based on market data events, reach into the message and pull out the fields of interest for our display.
private static void DisplayUpdate(string item, JObject update)
{
var fields = update["Fields"];
// Display the quote for the asset we're watching
Console.WriteLine($"{ DateTime.Now:HH:mm:ss} Seqno: {update["SeqNumber"], -6} => {item}" +
$"({fields["BID"],6}/{fields["ASK"],6}) - {fields["DSPLY_NAME"]}");
}
In the above code segment, you can see a difference between the libraries when we included the OnRefresh() expression. When requesting for streaming data using our modern streaming APIs, we intentionally separate the concept of the initial image and update images. The OnRefresh() represents the initial image when requesting for market data. This concept allows users to capture the latest prices for the image to be received within a separate callback to distinguish between updates. Updates involve the concept of capturing real-time events based on changes in the markets, for example, trades and quotes. The initial image will always contain all values/fields you request where updates will only provide fields that are affected by the event, i.e. a trade fields or a quote fields.
In addition, the APIs support an interface to retrieve chains.
In the sample below, we have requested to retrieve the Nasdaq Top 25 and to monitor updates to the chain.
// Create a subscription to the Nasdaq Top 25 chain (.AV.O) specifying the lambda expressions
// to capture chain events
using var chain = Chain.Definition(".AV.O").GetStream()
.OnAdd((index, newv, stream) =>
Console.WriteLine($"New constituent {newv} added at: {index}"))
.OnRemove((index, oldv, stream) =>
Console.WriteLine($"Removed constituent {oldv} added at: {index}"))
.OnUpdate((index, oldv, newv, stream) =>
Console.WriteLine($"Index {index} changed from {oldv} => {newv}"));
chain.Open();
// Pause on the main thread while updates come in. Wait for a key press to exit.
Console.WriteLine("Streaming updates. Press any key to stop...");
Console.ReadKey();
Conclusion
Moving from your Eikon .Net API to the Data Library for .Net should provide you with a path to acquire the desired content within your applications. As we continue to improve and expand our content set, we anticipate there may be some differences. The goal of this article is to provide solutions that not only meet your needs but hopefully include additional value not present with the legacy platform. Please report any issues or challenges within our Q&A site using the tag: workspace-upgrade and we'll continue to update this article to do our best to ensure we can provide a suitable migration path.