BaseIndicator

StockSharp.Algo.Indicators

The base Indicator.

Inherits: Cloneable<IIndicator>

Implements: IIndicator, IPersistable, ICloneable<IIndicator>, ICloneable

Constructors

BaseIndicator
protected BaseIndicator()
baseIndicator = BaseIndicator()

Initialize BaseIndicator.

Properties

Color
public virtual Color? Color { get; }
value = baseIndicator.Color

Indicator color. If then the color will be automatically selected.

Container
public IIndicatorContainer Container { get; }
value = baseIndicator.Container

The container storing indicator data.

Id
public Guid Id { get; private set; }
value = baseIndicator.Id
baseIndicator.Id = value

Unique ID.

IsFormed
public bool IsFormed { get; protected set; }
value = baseIndicator.IsFormed
baseIndicator.IsFormed = value

Whether the indicator is set.

IsPreloaded
public bool IsPreloaded { get; }
value = baseIndicator.IsPreloaded

Indicates whether the indicator has been preloaded with historical/external values.

Measure
public virtual IndicatorMeasures Measure { get; }
value = baseIndicator.Measure

IndicatorMeasures.

Name
public string Name { get; set; }
value = baseIndicator.Name
baseIndicator.Name = value

Indicator name.

NumValuesToInitialize
public virtual int NumValuesToInitialize { get; }
value = baseIndicator.NumValuesToInitialize

Number of values that need to be processed in order for the indicator to initialize (be IsFormed equals ). if undefined.

Source
public Level1Fields? Source { get; set; }
value = baseIndicator.Source
baseIndicator.Source = value

Field specified value source.

Style
public virtual DrawStyles Style { get; }
value = baseIndicator.Style

Chart indicator draw style.

Methods

AddResetTracking
protected void AddResetTracking(IIndicator indicator)
baseIndicator.AddResetTracking(indicator)

To add inner indicator for tracking the Reseted.

indicator
IIndicator
CalcIsFormed
protected virtual bool CalcIsFormed()
result = baseIndicator.CalcIsFormed()

Calc IsFormed.

Returns: IsFormed

Clone
public override IIndicator Clone()
result = baseIndicator.Clone()

Create a copy of IIndicator.

Returns: Copy.

CreateValue
public IIndicatorValue CreateValue(DateTime time, object[] values)
result = baseIndicator.CreateValue(time, values)

Convert to indicator value.

time
Time
values
ToValues

Returns: IIndicatorValue

Load
public virtual void Load(SettingsStorage storage)
baseIndicator.Load(storage)

Load settings.

storage
Settings storage.
LoadValues
protected void LoadValues(SettingsStorage storage)
baseIndicator.LoadValues(storage)

Load settings.

storage
Settings storage.
OnCreateValue
protected virtual IIndicatorValue OnCreateValue(DateTime time)
result = baseIndicator.OnCreateValue(time)

Create a new instance of IIndicatorValue for the specified time.

time
Time

Returns: IIndicatorValue

OnPreload
protected virtual void OnPreload(IIndicatorValue input, IIndicatorValue output)
baseIndicator.OnPreload(input, output)

Hook for descendants to warm up internal state during preloading.

input
Original input.
output
Preloaded output.
OnProcess
protected abstract IIndicatorValue OnProcess(IIndicatorValue input)
result = baseIndicator.OnProcess(input)

To handle the input value.

input
The input value.

Returns: The resulting value.

Preload
public void Preload(IEnumerable<ValueTuple<IIndicatorValue, IIndicatorValue>> values)
baseIndicator.Preload(values)

Bulk preload of indicator values (input/output pairs). Implementations may override; default throws NotSupportedException.

values
Collection of finalized input/output pairs.
Process
public virtual IIndicatorValue Process(IIndicatorValue input)
result = baseIndicator.Process(input)

To handle the input value.

input
The input value.

Returns: The new value of the indicator.

RaiseChangedEvent
protected void RaiseChangedEvent(IIndicatorValue input, IIndicatorValue result)
baseIndicator.RaiseChangedEvent(input, result)

To call the event Changed.

input
The input value of the indicator.
result
The resulting value of the indicator.
RemoveResetTracking
protected void RemoveResetTracking(IIndicator indicator)
baseIndicator.RemoveResetTracking(indicator)

To remove indicator from tracking the Reseted.

indicator
IIndicator
Reset
public virtual void Reset()
baseIndicator.Reset()

To reset the indicator status to initial. The method is called each time when initial settings are changed (for example, the length of period).

Save
public virtual void Save(SettingsStorage storage)
baseIndicator.Save(storage)

Save settings.

storage
Settings storage.
SaveValues
protected void SaveValues(SettingsStorage storage)
baseIndicator.SaveValues(storage)

Save settings.

storage
Settings storage.
ToString
public override string ToString()
result = baseIndicator.ToString()

Преобразовать к строковому представлению.

Returns: Строковое представление.

Events

Changed
public event Action<IIndicatorValue, IIndicatorValue> Changed
baseIndicator.Changed += handler

The indicator change event (for example, a new value is added).

Reseted
public event Action Reseted
baseIndicator.Reseted += handler

The event of resetting the indicator status to initial. The event is called each time when initial settings are changed (for example, the length of period).