Table of Contents

Class IndicatorHelper

Namespace
StockSharp.Algo.Indicators
Assembly
StockSharp.BusinessEntities.dll

Extension class for indicators.

public static class IndicatorHelper
Inheritance
IndicatorHelper
Inherited Members

Methods

CreateEmptyValue(IIndicator, DateTimeOffset)

Create empty IIndicatorValue.

public static IIndicatorValue CreateEmptyValue(this IIndicator indicator, DateTimeOffset time)

Parameters

indicator IIndicator

IIndicator

time DateTimeOffset

Time

Returns

IIndicatorValue

Empty IIndicatorValue.

CreateIndicator(IndicatorType)

Create indicator.

public static IIndicator CreateIndicator(this IndicatorType type)

Parameters

type IndicatorType

IndicatorType

Returns

IIndicator

IIndicator

ExcludeObsolete(IEnumerable<IndicatorType>)

Exclude obsolete indicators.

public static IEnumerable<IndicatorType> ExcludeObsolete(this IEnumerable<IndicatorType> types)

Parameters

types IEnumerable<IndicatorType>

All indicator types.

Returns

IEnumerable<IndicatorType>

Filtered collection.

GetCurrentValue(IIndicator)

To get the current value of the indicator.

public static decimal GetCurrentValue(this IIndicator indicator)

Parameters

indicator IIndicator

Indicator.

Returns

decimal

The current value.

GetCurrentValue<T>(IIndicator)

To get the current value of the indicator.

public static T GetCurrentValue<T>(this IIndicator indicator)

Parameters

indicator IIndicator

Indicator.

Returns

T

The current value.

Type Parameters

T

Value type.

GetDefaultIndicatorOutput(Type)

Get default output type for indicator.

public static Type GetDefaultIndicatorOutput(this Type indicatorType)

Parameters

indicatorType Type

IComplexIndicator

Returns

Type

Type.

GetFirstValue(IIndicator)

To get the first value of the indicator.

public static decimal GetFirstValue(this IIndicator indicator)

Parameters

indicator IIndicator

Indicator.

Returns

decimal

The current value.

GetNullableCurrentValue(IIndicator)

To get the current value of the indicator.

public static decimal? GetNullableCurrentValue(this IIndicator indicator)

Parameters

indicator IIndicator

Indicator.

Returns

decimal?

The current value.

GetNullableFirstValue(IIndicator)

To get the first value of the indicator.

public static decimal? GetNullableFirstValue(this IIndicator indicator)

Parameters

indicator IIndicator

Indicator.

Returns

decimal?

The current value.

GetNullableValue(IIndicator, int)

To get the indicator value by the index (0 - last value).

public static decimal? GetNullableValue(this IIndicator indicator, int index)

Parameters

indicator IIndicator

Indicator.

index int

The value index.

Returns

decimal?

Indicator value.

GetValue(IIndicator, int)

To get the indicator value by the index (0 - last value).

public static decimal GetValue(this IIndicator indicator, int index)

Parameters

indicator IIndicator

Indicator.

index int

The value index.

Returns

decimal

Indicator value.

GetValueType(Type, bool)

Get value type for specified indicator.

public static Type GetValueType(this Type indicatorType, bool isInput)

Parameters

indicatorType Type

Indicator type.

isInput bool

Is input.

Returns

Type

Value type.

GetValue<T>(IIndicator, int)

To get the indicator value by the index (0 - last value).

public static T GetValue<T>(this IIndicator indicator, int index)

Parameters

indicator IIndicator

Indicator.

index int

The value index.

Returns

T

Indicator value.

Type Parameters

T

Value type.

IsCustomOutputValue(Type)

Determines whether the indicator is a custom output value.

public static bool IsCustomOutputValue(this Type indicator)

Parameters

indicator Type

Indicator type.

Returns

bool

Check result.

Process(IIndicator, IIndicatorValue, decimal)

To renew the indicator with numeric value.

public static IIndicatorValue Process(this IIndicator indicator, IIndicatorValue input, decimal value)

Parameters

indicator IIndicator

Indicator.

input IIndicatorValue

IIndicatorValue

value decimal

Numeric value.

Returns

IIndicatorValue

The new value of the indicator.

Process(IIndicator, ICandleMessage)

To renew the indicator with candle closing price ClosePrice.

public static IIndicatorValue Process(this IIndicator indicator, ICandleMessage candle)

Parameters

indicator IIndicator

Indicator.

candle ICandleMessage

Candle.

Returns

IIndicatorValue

The new value of the indicator.

Process(IIndicator, decimal, DateTimeOffset, bool)

To renew the indicator with numeric value.

public static IIndicatorValue Process(this IIndicator indicator, decimal value, DateTimeOffset time, bool isFinal = true)

Parameters

indicator IIndicator

Indicator.

value decimal

Numeric value.

time DateTimeOffset

Time

isFinal bool

Is the value final (the indicator finally forms its value and will not be changed in this point of time anymore). Default is true.

Returns

IIndicatorValue

The new value of the indicator.

Process(IIndicator, object, DateTimeOffset, bool)

To renew the indicator with new value.

public static IIndicatorValue Process(this IIndicator indicator, object inputValue, DateTimeOffset time, bool isFinal)

Parameters

indicator IIndicator

Indicator.

inputValue object

Input value.

time DateTimeOffset

Time

isFinal bool

IsFinal

Returns

IIndicatorValue

IIndicatorValue.

Process<TValue>(IIndicator, (TValue, TValue), DateTimeOffset, bool)

To renew the indicator with numeric pair.

public static IIndicatorValue Process<TValue>(this IIndicator indicator, (TValue, TValue) value, DateTimeOffset time, bool isFinal = true)

Parameters

indicator IIndicator

Indicator.

value (TValue, TValue)

The pair of values.

time DateTimeOffset

Time

isFinal bool

If the pair final (the indicator finally forms its value and will not be changed in this point of time anymore). Default is true.

Returns

IIndicatorValue

The new value of the indicator.

Type Parameters

TValue

Value type.

SetValue(IIndicatorValue, IIndicator, decimal)

To replace the indicator input value by new one (for example it is received from another indicator).

public static IIndicatorValue SetValue(this IIndicatorValue input, IIndicator indicator, decimal value)

Parameters

input IIndicatorValue

IIndicatorValue

indicator IIndicator

Indicator.

value decimal

Value.

Returns

IIndicatorValue

New object, containing input value.

ToCandle(IIndicatorValue)

public static ICandleMessage ToCandle(this IIndicatorValue value)

Parameters

value IIndicatorValue

IIndicatorValue

Returns

ICandleMessage

ICandleMessage

ToDecimal(IIndicatorValue)

public static decimal ToDecimal(this IIndicatorValue value)

Parameters

value IIndicatorValue

IIndicatorValue

Returns

decimal

decimal

TryCreateIndicator(IndicatorType)

Create indicator.

public static IIndicator TryCreateIndicator(this IndicatorType type)

Parameters

type IndicatorType

IndicatorType

Returns

IIndicator

IIndicator

TryGetById(IIndicatorProvider, string)

Try find IndicatorType by identifier.

public static IndicatorType TryGetById(this IIndicatorProvider provider, string id)

Parameters

provider IIndicatorProvider

IIndicatorProvider

id string

Identifier.

Returns

IndicatorType

IndicatorType or null.

TryGetByType(IIndicatorProvider, Type)

Try find IndicatorType by type.

public static IndicatorType TryGetByType(this IIndicatorProvider provider, Type type)

Parameters

provider IIndicatorProvider

IIndicatorProvider

type Type

Indicator

Returns

IndicatorType

IndicatorType or null.