Not Receiving Data using Eikon Data API for Futures

We are not receiving data using API. Kindly assist. We have seen values before. Futures does not get us data. SPY works fine.

Sample RIC: <VXc1>

Sample Code:

var eikon = EikonDataAPI.Eikon.CreateDataAPI();
eikon.SetAppKey("<app key>");

List<string> fields = new List<string> {
"TR.SettlementPrice","TR.SettlementPrice.Date"

};

var parameters = new Dictionary<string, string>()
{
{"SDate", fromDate.ToString("yyyy-MM-dd")}, {"EDate", toDate.ToString("yyyy-MM-dd")},
{"Frq", "D"}, {"CH", "Fd"}
};

ry
{
data = eikon.GetData(items, fields, parameters);
break;
}
catch (Exception ex)
{
System.Console.WriteLine("Attempt " + i);
ErrorLogger.Error(ex);

}

for (int i = 0; i < data.RowCount; i++)
{

String instrument = String.Empty;
try
{
var series = data.Rows[i];
instrument = series["Instrument"].ToString();
var asofDate = Convert.ToDateTime(series["Date"].ToString());
var settlePrice = Convert.ToDouble(series["Settlement Price"]);
settlePriceDictionary[instrument + asofDate.ToString("MM/dd/yyyy")] = settlePrice;

}
catch (Exception ex)
{
System.Console.WriteLine("Cannot get settlement price for "
+ instrument + " : " + ex.Message);
}
}


Thank you!

Best Answer

  • @AndreaErica.Simbolas

    I can get the data properly with the code below.

    List<string> instruments = new List<string> {
       "VXc1"
    };

    List<string> fields = new List<string> {
    "TR.SettlementPrice","TR.SettlementPrice.Date"
    };

    var parameters = new Dictionary<string, string>()
    {
    {"SDate", "2021-09-01"}, {"EDate", "2021-09-20"},
    {"Frq", "D"}, {"CH", "Fd"}
    };
    var data = eikon.GetData(instruments, fields, parameters);
    data

    The output is edapi.png

    You may need to enable logging in the API to verify the problem.

    using Microsoft.Extensions.Logging;
    ...
    eikon.GetLoggerFactory().AddConsole(LogLevel.Debug);