I am new to both Deedle and C#.
I have loaded futures data from Quandl in JSON format using QuandlCS.Connection, -.Interfaces, -.Requests, -.Types, and NewtonSoft.Json, -.Json.Linq, and thereafter transformed it into a Deedle data series:
QuandlDownloadRequest requestNG1 = new QuandlDownloadRequest();
requestNG1.APIKey = "myAPIKey";
requestNG1.Datacode = new Datacode("Chris", "CME_NG1");
requestNG1.Format = FileFormats.JSON;
requestNG1.Frequency = Frequencies.Daily;
requestNG1.Sort = SortOrders.Ascending;
requestNG1.StartDate = new Datetime(2010, 01, 01);
requestNG1.EndDate = DateTime.Now.Date;
IQuandlConnection connectionNG1 = new QuandlConnection();
string dataNG1 = connectionNG1.Request(requestNG1);
dynamic jasonNG1 = JsonConvert.DeserializeObject(dataNG1);
//create data series
var datePriceDS = new SeriesBuilder<DateTime, double>();
for each(var item in jsonNG1.dataNG1)
{
datePriceDS.Add(Convert.ToDateTime(item[0]), Convert.ToDouble(item[6]) );
}
var dataSeriesNG1 = datePriceDS.Series;
The keys of 'dataSeriesNG1' are comprised of only those dates upon which the contract was traded. I need to create another data series using all calendar dates between 1/1/2010 and DateTime.Now, with NA values assigned to the date keys where no price data exists. Is there a way to do this using LINQ? Many thanks in advance!