Table of Contents

Class IndicatorHelper

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

Extension class for indicators.

public static class IndicatorHelper
Inheritance
IndicatorHelper
Inherited Members

Methods

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.

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.

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.

GetOhlc(IIndicatorValue)

Get OHLC.

public static (decimal o, decimal h, decimal l, decimal c) GetOhlc(this IIndicatorValue value)

Parameters

value IIndicatorValue

IIndicatorValue

Returns

(decimal o, decimal h, decimal l, decimal c)

OHLC.

GetOhlcv(IIndicatorValue)

Get OHLCV.

public static (decimal o, decimal h, decimal l, decimal c, decimal v) GetOhlcv(this IIndicatorValue value)

Parameters

value IIndicatorValue

IIndicatorValue

Returns

(decimal o, decimal h, decimal l, decimal c, decimal v)

OHLCV.

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.

IsSupport<T>(IIndicatorValue)

Does value support data type, required for the indicator.

public static bool IsSupport<T>(this IIndicatorValue value)

Parameters

value IIndicatorValue

IIndicatorValue

Returns

bool

true, if data type is supported, otherwise, false.

Type Parameters

T

The data type, operated by 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, bool)

To renew the indicator with numeric value.

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

Parameters

indicator IIndicator

Indicator.

value decimal

Numeric value.

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<TValue>(IIndicator, Tuple<TValue, TValue>, bool)

To renew the indicator with numeric pair.

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

Parameters

indicator IIndicator

Indicator.

value Tuple<TValue, TValue>

The pair of values.

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.