IndicatorHelper

StockSharp.Algo.Indicators

Extension class for indicators.

Methods

CreateEmptyValue
public static IIndicatorValue CreateEmptyValue(IIndicator indicator, DateTime time)
result = IndicatorHelper.CreateEmptyValue(indicator, time)

Create empty IIndicatorValue.

indicator
IIndicator
time
Time

Returns: Empty IIndicatorValue.

CreateIndicator
public static IIndicator CreateIndicator(IndicatorType type)
result = IndicatorHelper.CreateIndicator(type)

Create indicator.

type
IndicatorType

Returns: IIndicator

ExcludeObsolete
public static IEnumerable<IndicatorType> ExcludeObsolete(IEnumerable<IndicatorType> types)
result = IndicatorHelper.ExcludeObsolete(types)

Exclude obsolete indicators.

types
All indicator types.

Returns: Filtered collection.

GetCurrentValue
public static decimal GetCurrentValue(IIndicator indicator)
result = IndicatorHelper.GetCurrentValue(indicator)

To get the current value of the indicator.

indicator
Indicator.

Returns: The current value.

GetCurrentValue``1
public static T GetCurrentValue<T>(IIndicator indicator)
result = IndicatorHelper.GetCurrentValue(indicator)

To get the current value of the indicator.

indicator
Indicator.

Returns: The current value.

GetFirstValue
public static decimal GetFirstValue(IIndicator indicator)
result = IndicatorHelper.GetFirstValue(indicator)

To get the first value of the indicator.

indicator
Indicator.

Returns: The current value.

GetNullableCurrentValue
public static decimal? GetNullableCurrentValue(IIndicator indicator)
result = IndicatorHelper.GetNullableCurrentValue(indicator)

To get the current value of the indicator.

indicator
Indicator.

Returns: The current value.

GetNullableFirstValue
public static decimal? GetNullableFirstValue(IIndicator indicator)
result = IndicatorHelper.GetNullableFirstValue(indicator)

To get the first value of the indicator.

indicator
Indicator.

Returns: The current value.

GetNullableValue
public static decimal? GetNullableValue(IIndicator indicator, int index)
result = IndicatorHelper.GetNullableValue(indicator, index)

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

indicator
Indicator.
index
The value index.

Returns: Indicator value.

GetValue
public static decimal GetValue(IIndicator indicator, int index)
result = IndicatorHelper.GetValue(indicator, index)

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

indicator
Indicator.
index
The value index.

Returns: Indicator value.

GetValueType
public static Type GetValueType(Type indicatorType, bool isInput)
result = IndicatorHelper.GetValueType(indicatorType, isInput)

Get value type for specified indicator.

indicatorType
Indicator type.
isInput
Is input.

Returns: Value type.

GetValue``1
public static T GetValue<T>(IIndicator indicator, int index)
result = IndicatorHelper.GetValue(indicator, index)

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

indicator
Indicator.
index
The value index.

Returns: Indicator value.

IsNonDecimalOutputValue
public static bool IsNonDecimalOutputValue(Type indicator)
result = IndicatorHelper.IsNonDecimalOutputValue(indicator)

Determines whether the indicator is a non-decimal output value.

indicator
Indicator type.

Returns: Check result.

Preload
public static void Preload(IIndicator indicator, IEnumerable<ValueTuple<DateTime, object[]>> items)
IndicatorHelper.Preload(indicator, items)

Bulk preload using primitive tuples. Implementations may override; default throws NotSupportedException.

indicator
IIndicator
items
Sequence of (time, values) where values correspond to ToValues output.
Process
public static IIndicatorValue Process(IIndicator indicator, decimal value, DateTime time, bool isFinal)
result = IndicatorHelper.Process(indicator, value, time, isFinal)

To renew the indicator with numeric value.

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

Returns: The new value of the indicator.

Process
public static IIndicatorValue Process(IIndicator indicator, ICandleMessage candle)
result = IndicatorHelper.Process(indicator, candle)

To renew the indicator with candle closing price ClosePrice.

indicator
Indicator.
candle
Candle.

Returns: The new value of the indicator.

Process
public static IIndicatorValue Process(IIndicator indicator, IIndicatorValue input, decimal value)
result = IndicatorHelper.Process(indicator, input, value)

To renew the indicator with numeric value.

indicator
Indicator.
input
IIndicatorValue
value
Numeric value.

Returns: The new value of the indicator.

Process
public static IIndicatorValue Process(IIndicator indicator, object inputValue, DateTime time, bool isFinal)
result = IndicatorHelper.Process(indicator, inputValue, time, isFinal)

To renew the indicator with new value.

indicator
Indicator.
inputValue
Input value.
time
Time
isFinal
IsFinal

Returns: IIndicatorValue.

Process``1
public static IIndicatorValue Process<TValue>(IIndicator indicator, ValueTuple<TValue, TValue> value, DateTime time, bool isFinal)
result = IndicatorHelper.Process(indicator, value, time, isFinal)

To renew the indicator with numeric pair.

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

Returns: The new value of the indicator.

SetValue
public static IIndicatorValue SetValue(IIndicatorValue input, IIndicator indicator, decimal value)
result = IndicatorHelper.SetValue(input, indicator, value)

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

input
IIndicatorValue
indicator
Indicator.
value
Value.

Returns: New object, containing input value.

ToCandle
public static ICandleMessage ToCandle(IIndicatorValue value)
result = IndicatorHelper.ToCandle(value)

Convert IIndicatorValue to ICandleMessage.

value
IIndicatorValue

Returns: ICandleMessage

ToDecimal
public static decimal ToDecimal(IIndicatorValue value, Level1Fields? source)
result = IndicatorHelper.ToDecimal(value, source)

Convert IIndicatorValue to Decimal.

value
IIndicatorValue
source
Field specified value source.

Returns: Decimal

ToNullableDecimal
public static decimal? ToNullableDecimal(IIndicatorValue value, Level1Fields? source)
result = IndicatorHelper.ToNullableDecimal(value, source)

Convert IIndicatorValue to Decimal or if the value is empty..

value
IIndicatorValue
source
Field specified value source.

Returns: Decimal or if the value is empty.

TryCreateIndicator
public static IIndicator TryCreateIndicator(IndicatorType type)
result = IndicatorHelper.TryCreateIndicator(type)

Create indicator.

type
IndicatorType

Returns: IIndicator

TryGetById
public static IndicatorType TryGetById(IIndicatorProvider provider, string id)
result = IndicatorHelper.TryGetById(provider, id)

Try find IndicatorType by identifier.

provider
IIndicatorProvider
id
Identifier.

Returns: IndicatorType or .

TryGetByType
public static IndicatorType TryGetByType(IIndicatorProvider provider, Type type)
result = IndicatorHelper.TryGetByType(provider, type)

Try find IndicatorType by type.

provider
IIndicatorProvider
type
Indicator

Returns: IndicatorType or .