Show / Hide Table of Contents

Class EnumerableExtensions

Set of extensions methods for obtaining simple statistical functions from bars list.

Inheritance
System.Object
EnumerableExtensions
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 EnumerableExtensions

Methods

| Improve this Doc View Source

GetAverageDailyTradeVolume(IEnumerable<IBar>)

Gets the average trade volume for the given list of IBar objects.

Declaration
public static (Decimal, UInt32) GetAverageDailyTradeVolume(this IEnumerable<IBar> bars)
Parameters
Type Name Description
IEnumerable<IBar> bars

Target list of the IBar instances.

Returns
Type Description
System.ValueTuple<Decimal, UInt32>

The pair of ADTV value and number of processed day bars.

| Improve this Doc View Source

GetAverageDailyTradeVolumeAsync(IAsyncEnumerable<IBar>)

Gets the average trade volume for the given list of IBar objects.

Declaration
public static Task<(Decimal, UInt32)> GetAverageDailyTradeVolumeAsync(this IAsyncEnumerable<IBar> bars)
Parameters
Type Name Description
IAsyncEnumerable<IBar> bars

Target list of the IBar instances.

Returns
Type Description
Task<System.ValueTuple<Decimal, UInt32>>

The pair of ADTV value and number of processed day bars.

| Improve this Doc View Source

GetAverageDailyTradeVolumeAsync(IAsyncEnumerable<IBar>, CancellationToken)

Gets the average trade volume for the given list of IBar objects.

Declaration
public static async Task<(Decimal, UInt32)> GetAverageDailyTradeVolumeAsync(this IAsyncEnumerable<IBar> bars, CancellationToken cancellationToken)
Parameters
Type Name Description
IAsyncEnumerable<IBar> bars

Target list of the IBar instances.

CancellationToken cancellationToken

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

Returns
Type Description
Task<System.ValueTuple<Decimal, UInt32>>

The pair of ADTV value and number of processed day bars.

| Improve this Doc View Source

GetSimpleMovingAverage(IEnumerable<IBar>, Int32)

Gets the simple moving average values for the given list of IBar objects.

Declaration
public static IEnumerable<IBar> GetSimpleMovingAverage(this IEnumerable<IBar> bars, Int32 window)
Parameters
Type Name Description
IEnumerable<IBar> bars

Target list of the IBar instances.

Int32 window

Size of the moving average window.

Returns
Type Description
IEnumerable<IBar>

The list of bars with SMA values for all IBar properties.

| Improve this Doc View Source

GetSimpleMovingAverageAsync(IAsyncEnumerable<IBar>, Int32)

Gets the simple moving average values for the given list of IBar objects.

Declaration
public static IAsyncEnumerable<IBar> GetSimpleMovingAverageAsync(this IAsyncEnumerable<IBar> bars, Int32 window)
Parameters
Type Name Description
IAsyncEnumerable<IBar> bars

Target list of the IBar instances.

Int32 window

Size of the moving average window.

Returns
Type Description
IAsyncEnumerable<IBar>

The list of bars with SMA values for all IBar properties.

| Improve this Doc View Source

GetSimpleMovingAverageAsync(IAsyncEnumerable<IBar>, Int32, CancellationToken)

Gets the simple moving average values for the given list of IBar objects.

Declaration
public static async IAsyncEnumerable<IBar> GetSimpleMovingAverageAsync(this IAsyncEnumerable<IBar> bars, Int32 window, CancellationToken cancellationToken)
Parameters
Type Name Description
IAsyncEnumerable<IBar> bars

Target list of the IBar instances.

Int32 window

Size of the moving average window.

CancellationToken cancellationToken

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

Returns
Type Description
IAsyncEnumerable<IBar>

The list of bars with SMA values for all IBar properties.

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