.NET Time Series API date range

Is there a way to setup from/to interval in this example ?

private void Request()
{
_request = _timeSeries.SetupDataRequest("EUR=")
.WithView("BID")
.WithAllFields()
.WithInterval(CommonInterval.Daily)
.WithNumberOfPoints(5)
.OnDataReceived(DataReceivedCallback)
.CreateAndSend();
}

Best Answer

  • Yes. Remove WithNumberOfPoints and add From(System.DateTime?) and To(System.DateTime?). Out of WithNumberOfPoints, From and To methods of ITimeSeriesDataRequestSetup interface any two can be used together to set up the request. E.g. you can use From and To, or you can use From and WithNumberOfPoints, but you cannot use all 3 in the same request. For details about the signature and behavior of these methods see their description in the Object Browser in Visual Studio.

Answers