Class HistoricalTradesClientExtensions
Set of extension methods for the IHistoricalTradesClient<TRequest> interface.
Inheritance
Inherited Members
Namespace: Alpaca.Markets.Extensions
Assembly: Alpaca.Markets.Extensions.dll
Syntax
public static class HistoricalTradesClientExtensions
Methods
| Improve this Doc View SourceGetHistoricalTradesAsAsyncEnumerable<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 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 |
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |
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 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 |
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |
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 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 |
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |
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 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 |
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |
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 |
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |
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 |
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |
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 |
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |
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 |
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |