Show / Hide Table of Contents

Class HistoricalTradesClientExtensions

Set of extension methods for the IHistoricalTradesClient<TRequest> interface.

Inheritance
System.Object
HistoricalTradesClientExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Alpaca.Markets.Extensions
Assembly: Alpaca.Markets.Extensions.dll
Syntax
public static class HistoricalTradesClientExtensions

Methods

| Improve this Doc View Source

GetHistoricalTradesAsAsyncEnumerable<TRequest>(IHistoricalTradesClient<TRequest>, TRequest)

Gets all items provided by Alpaca.Markets.IHistoricalTradesClient`1.ListHistoricalTradesAsync(`0,System.Threading.CancellationToken) in pagination mode as single stream of items (in form of interface) so they can be consumed by the await foreach statement on the caller side.

Declaration
public static IAsyncEnumerable<ITrade> GetHistoricalTradesAsAsyncEnumerable<TRequest>(this IHistoricalTradesClient<TRequest> client, TRequest request)
    where TRequest : HistoricalRequestBase, IHistoricalRequest<TRequest, ITrade>
Parameters
Type Name Description
IHistoricalTradesClient<TRequest> client

Target instance of the IHistoricalTradesClient<TRequest> interface.

TRequest request

Original historical trades request (with empty next page token).

Returns
Type Description
IAsyncEnumerable<ITrade>
Type Parameters
Name Description
TRequest
Exceptions
Type Condition
RequestValidationException

The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

GetHistoricalTradesAsAsyncEnumerable<TRequest>(IHistoricalTradesClient<TRequest>, TRequest, CancellationToken)

Gets all items provided by Alpaca.Markets.IHistoricalTradesClient`1.ListHistoricalTradesAsync(`0,System.Threading.CancellationToken) in pagination mode as single stream of items (in form of interface) so they can be consumed by the await foreach statement on the caller side.

Declaration
public static IAsyncEnumerable<ITrade> GetHistoricalTradesAsAsyncEnumerable<TRequest>(this IHistoricalTradesClient<TRequest> client, TRequest request, CancellationToken cancellationToken)
    where TRequest : HistoricalRequestBase, IHistoricalRequest<TRequest, ITrade>
Parameters
Type Name Description
IHistoricalTradesClient<TRequest> client

Target instance of the IHistoricalTradesClient<TRequest> interface.

TRequest request

Original historical trades request (with empty next page token).

CancellationToken cancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns
Type Description
IAsyncEnumerable<ITrade>
Type Parameters
Name Description
TRequest
Exceptions
Type Condition
RequestValidationException

The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

GetHistoricalTradesDictionaryOfAsyncEnumerable<TRequest>(IHistoricalTradesClient<TRequest>, TRequest)

Gets all items provided by Alpaca.Markets.IHistoricalTradesClient`1.GetHistoricalTradesAsync(`0,System.Threading.CancellationToken) in pagination mode as single stream of items (in form of dictionary of the interface instances) so they can be consumed by the await foreach statement on the caller side.

Declaration
public static IReadOnlyDictionary<String, IAsyncEnumerable<ITrade>> GetHistoricalTradesDictionaryOfAsyncEnumerable<TRequest>(this IHistoricalTradesClient<TRequest> client, TRequest request)
    where TRequest : HistoricalRequestBase, IHistoricalRequest<TRequest, ITrade>
Parameters
Type Name Description
IHistoricalTradesClient<TRequest> client

Target instance of the IHistoricalTradesClient<TRequest> interface.

TRequest request

Original historical minute bars request (with empty next page token).

Returns
Type Description
IReadOnlyDictionary<String, IAsyncEnumerable<ITrade>>
Type Parameters
Name Description
TRequest
Exceptions
Type Condition
RequestValidationException

The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

GetHistoricalTradesDictionaryOfAsyncEnumerable<TRequest>(IHistoricalTradesClient<TRequest>, TRequest, CancellationToken)

Gets all items provided by Alpaca.Markets.IHistoricalTradesClient`1.GetHistoricalTradesAsync(`0,System.Threading.CancellationToken) in pagination mode as single stream of items (in form of dictionary of the interface instances) so they can be consumed by the await foreach statement on the caller side.

Declaration
public static IReadOnlyDictionary<String, IAsyncEnumerable<ITrade>> GetHistoricalTradesDictionaryOfAsyncEnumerable<TRequest>(this IHistoricalTradesClient<TRequest> client, TRequest request, CancellationToken cancellationToken)
    where TRequest : HistoricalRequestBase, IHistoricalRequest<TRequest, ITrade>
Parameters
Type Name Description
IHistoricalTradesClient<TRequest> client

Target instance of the IHistoricalTradesClient<TRequest> interface.

TRequest request

Original historical minute bars request (with empty next page token).

CancellationToken cancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns
Type Description
IReadOnlyDictionary<String, IAsyncEnumerable<ITrade>>
Type Parameters
Name Description
TRequest
Exceptions
Type Condition
RequestValidationException

The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

GetHistoricalTradesMultiPagesAsAsyncEnumerable<TRequest>(IHistoricalTradesClient<TRequest>, TRequest)

Gets all items provided by Alpaca.Markets.IHistoricalTradesClient`1.ListHistoricalTradesAsync(`0,System.Threading.CancellationToken) in pagination mode as single stream of response pages with items so they can be consumed by the await foreach statement on the caller side as sequence of 'batches' instead of sequence of items itself.

Declaration
public static IAsyncEnumerable<IReadOnlyDictionary<String, IReadOnlyList<ITrade>>> GetHistoricalTradesMultiPagesAsAsyncEnumerable<TRequest>(this IHistoricalTradesClient<TRequest> client, TRequest request)
    where TRequest : HistoricalRequestBase, IHistoricalRequest<TRequest, ITrade>
Parameters
Type Name Description
IHistoricalTradesClient<TRequest> client

Target instance of the IHistoricalTradesClient<TRequest> interface.

TRequest request

Original historical trades request (with empty next page token).

Returns
Type Description
IAsyncEnumerable<IReadOnlyDictionary<String, IReadOnlyList<ITrade>>>
Type Parameters
Name Description
TRequest
Exceptions
Type Condition
RequestValidationException

The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

GetHistoricalTradesMultiPagesAsAsyncEnumerable<TRequest>(IHistoricalTradesClient<TRequest>, TRequest, CancellationToken)

Gets all items provided by Alpaca.Markets.IHistoricalTradesClient`1.ListHistoricalTradesAsync(`0,System.Threading.CancellationToken) in pagination mode as single stream of response pages with items so they can be consumed by the await foreach statement on the caller side as sequence of 'batches' instead of sequence of items itself.

Declaration
public static IAsyncEnumerable<IReadOnlyDictionary<String, IReadOnlyList<ITrade>>> GetHistoricalTradesMultiPagesAsAsyncEnumerable<TRequest>(this IHistoricalTradesClient<TRequest> client, TRequest request, CancellationToken cancellationToken)
    where TRequest : HistoricalRequestBase, IHistoricalRequest<TRequest, ITrade>
Parameters
Type Name Description
IHistoricalTradesClient<TRequest> client

Target instance of the IHistoricalTradesClient<TRequest> interface.

TRequest request

Original historical trades request (with empty next page token).

CancellationToken cancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns
Type Description
IAsyncEnumerable<IReadOnlyDictionary<String, IReadOnlyList<ITrade>>>
Type Parameters
Name Description
TRequest
Exceptions
Type Condition
RequestValidationException

The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

GetHistoricalTradesPagesAsAsyncEnumerable<TRequest>(IHistoricalTradesClient<TRequest>, TRequest)

Gets all items provided by Alpaca.Markets.IHistoricalTradesClient`1.ListHistoricalTradesAsync(`0,System.Threading.CancellationToken) in pagination mode as single stream of response pages with items so they can be consumed by the await foreach statement on the caller side as sequence of 'batches' instead of sequence of items itself.

Declaration
public static IAsyncEnumerable<IReadOnlyList<ITrade>> GetHistoricalTradesPagesAsAsyncEnumerable<TRequest>(this IHistoricalTradesClient<TRequest> client, TRequest request)
    where TRequest : HistoricalRequestBase, IHistoricalRequest<TRequest, ITrade>
Parameters
Type Name Description
IHistoricalTradesClient<TRequest> client

Target instance of the IHistoricalTradesClient<TRequest> interface.

TRequest request

Original historical trades request (with empty next page token).

Returns
Type Description
IAsyncEnumerable<IReadOnlyList<ITrade>>
Type Parameters
Name Description
TRequest
Exceptions
Type Condition
RequestValidationException

The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

GetHistoricalTradesPagesAsAsyncEnumerable<TRequest>(IHistoricalTradesClient<TRequest>, TRequest, CancellationToken)

Gets all items provided by Alpaca.Markets.IHistoricalTradesClient`1.ListHistoricalTradesAsync(`0,System.Threading.CancellationToken) in pagination mode as single stream of response pages with items so they can be consumed by the await foreach statement on the caller side as sequence of 'batches' instead of sequence of items itself.

Declaration
public static IAsyncEnumerable<IReadOnlyList<ITrade>> GetHistoricalTradesPagesAsAsyncEnumerable<TRequest>(this IHistoricalTradesClient<TRequest> client, TRequest request, CancellationToken cancellationToken)
    where TRequest : HistoricalRequestBase, IHistoricalRequest<TRequest, ITrade>
Parameters
Type Name Description
IHistoricalTradesClient<TRequest> client

Target instance of the IHistoricalTradesClient<TRequest> interface.

TRequest request

Original historical trades request (with empty next page token).

CancellationToken cancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns
Type Description
IAsyncEnumerable<IReadOnlyList<ITrade>>
Type Parameters
Name Description
TRequest
Exceptions
Type Condition
RequestValidationException

The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX