IndicatorSpec

StockSharp.Messages

Which indicator to run, with what parameters, on which candle series.

Inherits: Equatable<IndicatorSpec>

Implements: IAsyncPersistable

Constructors

IndicatorSpec
public IndicatorSpec()
indicatorSpec = IndicatorSpec()

Initializes a new instance of the IndicatorSpec. For deserialization; use Object}}) to build one.

Properties

CandleType
public DataType CandleType { get; private set; }
value = indicatorSpec.CandleType
indicatorSpec.CandleType = value

Candle series the indicator runs on. Part of what the specification names: the same indicator on a different series is a different computation.

Kind
public string Kind { get; private set; }
value = indicatorSpec.Kind
indicatorSpec.Kind = value

Indicator type name, matched case-insensitively.

Parameters
public IReadOnlyDictionary<string, object> Parameters { get; private set; }
value = indicatorSpec.Parameters
indicatorSpec.Parameters = value

Tuning parameters keyed by the indicator's property names, matched case-insensitively.

Methods

Clone
public override IndicatorSpec Clone()
result = indicatorSpec.Clone()

Creates a new object that is a copy of the current instance.

Returns: A new object that is a copy of this instance.

Create
public static IndicatorSpec Create(string kind, DataType candleType, IEnumerable<KeyValuePair<string, object>> parameters)
result = IndicatorSpec.Create(kind, candleType, parameters)

Builds a specification.

kind
Indicator type name, matched case-insensitively. Either the full name, such as BollingerBands, or a short alias the indicator declares, such as BB.
candleType
Candle series the indicator runs on.
parameters
Tuning parameters keyed by the indicator's property names, matched case-insensitively. Omitted properties keep the indicator's defaults.

Returns: The specification.

GetHashCode
public override int GetHashCode()
result = indicatorSpec.GetHashCode()

Serves as the default hash function.

Returns: A hash code for the current object.

LoadAsync
public Task LoadAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = indicatorSpec.LoadAsync(storage, cancellationToken)

Asynchronously loads the state of the object from the specified SettingsStorage.

storage
The SettingsStorage instance from which to load the data.
cancellationToken
A token to monitor for cancellation requests.

Returns: A task that represents the asynchronous load operation.

OnEquals
protected override bool OnEquals(IndicatorSpec other)
result = indicatorSpec.OnEquals(other)
SaveAsync
public Task SaveAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = indicatorSpec.SaveAsync(storage, cancellationToken)

Asynchronously saves the state of the object to the specified SettingsStorage.

storage
The SettingsStorage instance to which to save the data.
cancellationToken
A token to monitor for cancellation requests.

Returns: A task that represents the asynchronous save operation.

ToString
public override string ToString()
result = indicatorSpec.ToString()

Returns a string representation of the tuple, with values separated by commas.

Returns: A string representing the tuple's values.