IndicatorHelper

StockSharp.Algo.Indicators

指标扩展类。

方法

ApplyParameters
public static void ApplyParameters(IIndicator indicator, IEnumerable<KeyValuePair<string, object>> parameters)
IndicatorHelper.ApplyParameters(indicator, parameters)

Applies to , keyed by property name and matched case-insensitively. A part of a composite is reached by naming the path to it - K.Length, Macd.LongMa.Length. A key the indicator does not have, or a value it refuses, leaves its own default in place.

indicator
Indicator.
parameters
Parameters.
Clone
public static IIndicator Clone(IIndicator indicator)
result = IndicatorHelper.Clone(indicator)

Create a copy of the indicator.

indicator
Indicator.

返回值: Copy.

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

Create empty IIndicatorValue.

indicator
指标
time
时间

返回值: Empty IIndicatorValue.

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

创建指标 。

type
IndicatorType

返回值: 指标

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

不包括过时的指标。

types
所有指标类型。

返回值: 被过滤的收藏 。

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

以获得该指标的当前值。

indicator
指标。

返回值: 现值.

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

以获得该指标的当前值。

indicator
指标。

返回值: 现值.

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

以获得指标的第一个值.

indicator
指标。

返回值: 现值.

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

以获得该指标的当前值。

indicator
指标。

返回值: 现值.

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

以获得指标的第一个值.

indicator
指标。

返回值: 现值.

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

以指数( 0 - 最后值) 获得指标值。

indicator
指标。
index
值入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出

返回值: 指标值。

GetOutputs
public static IReadOnlyList<ValueTuple<string, IIndicator>> GetOutputs(IIndicator indicator)
result = IndicatorHelper.GetOutputs(indicator)

The series produces: one entry for a plain indicator, one per innermost part for a composite.

indicator
Indicator.

返回值: Series name paired with the part whose value it carries, in a stable order.

GetOutputValues
public static ValueTuple<decimal?[], int?> GetOutputValues(IIndicatorValue value, IReadOnlyList<IIndicator> parts)
result = IndicatorHelper.GetOutputValues(value, parts)

Reads one number per series out of .

value
What IIndicatorValue) returned. May be .
parts
The parts from IIndicator), in the same order.

返回值: One entry per part, where that series has not formed yet, and the bars-back offset when a sparse indicator reports its value later than the candle it belongs to.

GetParameters
public static IEnumerable<PropertyInfo> GetParameters(Type indicatorType)
result = IndicatorHelper.GetParameters(indicatorType)

The properties of a caller may set: what the indicator declares itself, as opposed to the identity and drawing hints it inherits.

indicatorType
Indicator type.

返回值: Settable parameter properties.

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

以指数( 0 - 最后值) 获得指标值。

indicator
指标。
index
值入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出

返回值: 指标值。

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

获取指定指标的值类型。

indicatorType
指标类型。
isInput
输入

返回值: 值类型.

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

以指数( 0 - 最后值) 获得指标值。

indicator
指标。
index
值入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出出

返回值: 指标值。

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

确定该指标是否为非十进制输出值。

indicator
指标类型。

返回值: 检查结果。

NameInnerParts
private static Dictionary<IIndicator, string> NameInnerParts(IComplexIndicator complex)
result = IndicatorHelper.NameInnerParts(complex)

Names the inner parts after the properties exposing them - UpBand, SignalMa, Dx. Their own Name is localized display text, which would make the series keys change with the language the process is running in.

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

使用原始拖曳进行批量预装。 执行可能会超过; 默认丢入 NotSupportedException 。

indicator
指标
items
值对应 ToValues 输出的(时间,值)序列 。
Process
public static IIndicatorValue Process(IIndicator indicator, object inputValue, DateTime time, bool isFinal)
result = IndicatorHelper.Process(indicator, inputValue, time, isFinal)

以新的价值延长指标。

indicator
指标。
inputValue
输入值。
time
时间
isFinal
IsFinal

返回值: IIndicatorValue.

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

以数值更新该指标。

indicator
指标。
value
数字值。
time
时间
isFinal
是否为最终值(该指标最终构成其值,在此时间点上不再更改) 。 默认是 。

返回值: 指标的新值。

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

以蜡烛收盘价格 +#ClosePrice+# 续订指标.

indicator
指标。
candle
烛花.

返回值: 指标的新值。

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

以数值更新该指标。

indicator
指标。
input
IIndicatorValue
value
数字值。

返回值: 指标的新值。

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

用数字对续取指示符.

indicator
指标。
value
相对相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相
time
时间
isFinal
如果对偶最终(该指标最终形成其值,在此时间点上不再更改),默认是 。

返回值: 指标的新值。

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

用新的输入值取代指标输入值(例如从另一个指标得到)。

input
IIndicatorValue
indicator
指标。
value
价值.

返回值: 新对象,包含输入值.

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

Convert IIndicatorValue to ICandleMessage.

value
IIndicatorValue

返回值: ICandleMessage

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

Convert IIndicatorValue to Decimal.

value
IIndicatorValue
source
指定字段值源 。

返回值: 小数

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

转换 IIndicatorValue 为十进制, 或如果值为空 。

value
IIndicatorValue
source
指定字段值源 。

返回值: 十二进制或值为空.

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

创建指标 。

type
IndicatorType

返回值: 指标

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

Try find IndicatorType by identifier.

provider
IIndicatorProvider
id
辨相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相

返回值: 或. . . . . . .

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

Try find IndicatorType by type.

provider
IIndicatorProvider
type
指标

返回值: 或. . . . . . .