How can I set the start end end date when requesting data via HistoricalPricingSummaries?

Setting the WithStart() and/or WithEnd() parameter will always cause an error. ("The request parameter validation failed. start is invalid format.")

For example modifying DotNet_Example 2.0.0:

response = HistoricalPricing.GetSummaries(new HistoricalPricingSummaries.Params().Universe(ric)

.WithInterval(HistoricalPricingSummaries.Interval.P1D)
.WithStart(new DateTime(1973, 4, 13))
.WithCount(2));

Best Answer

  • nick.zincone
    nick.zincone admin
    Answer ✓

    Hi @martin.grunwald,

    You must specify that the date is UTC, i.e.

    new DateTime(1973,4,13,0,0,0,DateTimeKind.UTC)

    You also have the option of passing in a simple string into the date specifiers, i.e.

    .WithStart("1973-04-13")