Infront Data Manager Connect Client (.NET)

ISIN Arbitrage List

To get a Arbitrage list for one ore more ISINs the following steps must be done:

1. Create a Routing Data Store(Gevasys.DataCore.StaticData.Http.RoutingDataStore Class).
2. Create a instance of the required request message.
3. Optional: Implement the interface IAsyncRouteCallback ( Gevasys.DataCore.StaticData.IAsyncRouteCallback Interface) for the calling class.
4. Execute the request.

using System;
using System.Collections.Generic;
using Gevasys.DataCore.Configuration;
using Gevasys.DataCore.RequestData.ProtoBuf.V2;
using Gevasys.DataCore.StaticData;
using Gevasys.DataCore.StaticData.Http;
using Gevasys.DataCore.Webservice;
using log4net;
namespace Examples
{
class ISINArbitrage
{
private static ILog log = LogManager.GetLogger("ISINArbitrage");
private MessageSerializer serializer;
private RoutingDataStore rds;
public void Main()
{
ConfigurationHelper.Initialize();
serializer = new MessageSerializer();
rds = ConfigurationHelper.RoutingDataStore;
List<string> isinList = new List<string>
{
"NL0000009827",
"DE0005557508",
"US2605661048",
"BE0389555039",
"FR0003500008"
};
List<string> instrumentList = new PrintableList<string>();
instrumentList.AddRange(isinList);
/* Get ISIN arbitrage data. Availability of function depends on contract and comes with additional costs. */
ArbitrageRequestMessage requestMessage = new ArbitrageRequestMessage
{
header = new RequestHeaderMessage
{
user = Authentication.GetUser(),
password = Authentication.GetPassword()
},
// provide list of ISINs that vwd-internal listing codes
instrumentList = instrumentList
};
StaticDataResponse response = rds.CallFunction(StaticDataFunctions.ISIN_ARBITRAGE_V2
, InputFormat.PROTO.ToString()
, OutputFormat.PROTO.ToString()
, serializer.Serialize<ArbitrageRequestMessage>(OutputFormat.PROTO, requestMessage));
if (response.GetErrorCode() != 0)
{
log.Warn("Error from calling function: ISINArbitrage: " + response.GetErrorMessage());
return;
}
ArbitrageListsMessage responseMessage = serializer.Deserialize<ArbitrageListsMessage>(InputFormat.PROTO, response.GetData());
if (responseMessage.header.error_code != ErrorCodes.Ok && responseMessage.header.error_code != ErrorCodes.Default)
{
log.Error("Fatal: " + responseMessage.header.error_message);
return;
}
// dump data
Console.WriteLine("RoutingDataStore response for ISINArbitrage");
ISINArbitrageResult isinArbitrageResult = new ISINArbitrageResult();
isinArbitrageResult.ArbitrageList = new List<ArbitrageListMessage>();
if (responseMessage.arbitrageLists != null)
{
isinArbitrageResult.ArbitrageList.AddRange(responseMessage.arbitrageLists);
}
isinArbitrageResult.NotFoundInstruments = new List<string>();
if (responseMessage.notFoundInstruments != null)
{
isinArbitrageResult.NotFoundInstruments.AddRange(responseMessage.notFoundInstruments);
}
// print results to console
foreach (ArbitrageListMessage arbitrageList in isinArbitrageResult.ArbitrageList)
{
foreach (ArbitrageMessage message in arbitrageList.list)
{
Console.WriteLine("ISIN: " + arbitrageList.requestedInstrument + " assigned vwd code:" + message.vwdCode +
" exchangeCodeVwd: " + message.exchangeCodeVwd + " IsoCurrency: " + message.iso4217Currency);
}
}
}
}
}
Gevasys.DataCore
Definition: BinaryUpstreamClient.cs:5
Gevasys.DataCore.Configuration
Definition: ClassFactory.cs:17
Gevasys.DataCore.Webservice
Definition: Webservice.Generated/Reference.cs:11
Gevasys.DataCore.StaticData
Definition: AsyncFileDownloader.cs:10
Gevasys
Definition: BinaryUpstreamClient.cs:5
Examples
Definition: apiinitialize.cs:11
Gevasys.DataCore.StaticData.Http
Definition: AsyncFileDownloader.cs:10

Copyright (C) 2021 Infront Financial Technology GmbH
Mainzer Landstrasse 178 – 190
60327 Frankfurt am Main
Infront Data Manager Connect V4.1