/// <inheritdoc /> public Task <IHistoricalItems <IHistoricalQuote> > ListHistoricalQuotesAsync( HistoricalRequest request, CancellationToken cancellationToken = default) => _httpClient.GetAsync <IHistoricalItems <IHistoricalQuote>, JsonHistoricalItems <IHistoricalQuote, JsonHistoricalQuote> >( request.EnsureNotNull(nameof(request)).Validate() .GetUriBuilder(this, "nbbo"), cancellationToken);
/// <summary> /// Gets list of historical trades for a single asset from Polygon's REST API endpoint. /// </summary> /// <param name="request">Historical quotes request parameter.</param> /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> /// <returns>Read-only list of historical trade information.</returns> public Task <IHistoricalItems <IHistoricalQuote> > ListHistoricalQuotesAsync( HistoricalRequest request, CancellationToken cancellationToken = default) { request.EnsureNotNull(nameof(request)).Validate(); var builder = new UriBuilder(_httpClient.BaseAddress) { Path = $"v2/ticks/stocks/nbbo/{request.Symbol}/{request.Date.AsDateString()}", Query = getDefaultPolygonApiQueryBuilder() .AddParameter("limit", request.Limit) .AddParameter("timestamp", request.Timestamp) .AddParameter("timestamp_limit", request.TimestampLimit) .AddParameter("reverse", request.Reverse != null ? request.Reverse.ToString() : null) }; return(_httpClient.GetSingleObjectAsync <IHistoricalItems <IHistoricalQuote>, JsonHistoricalItems <IHistoricalQuote, JsonHistoricalQuote> >( FakeThrottler.Instance, builder, cancellationToken)); }