Class BaseIndicator
- Namespace
- StockSharp.Algo.Indicators
- Assembly
- StockSharp.Algo.dll
The base Indicator.
public abstract class BaseIndicator : Cloneable<IIndicator>, IIndicator, IPersistable, ICloneable<IIndicator>, ICloneable
- Inheritance
-
BaseIndicator
- Implements
-
IPersistableICloneable<IIndicator>
- Derived
- Extension Methods
Constructors
BaseIndicator()
Initialize BaseIndicator.
protected BaseIndicator()
Properties
Color
Indicator color. If null then the color will be automatically selected.
[Browsable(false)]
public virtual Color? Color { get; }
Property Value
Container
The container storing indicator data.
[Browsable(false)]
public IIndicatorContainer Container { get; }
Property Value
Id
Unique ID.
[Browsable(false)]
public Guid Id { get; }
Property Value
InputType
Input values type.
[Browsable(false)]
public virtual Type InputType { get; }
Property Value
IsFormed
Whether the indicator is set.
[Browsable(false)]
public bool IsFormed { get; protected set; }
Property Value
Measure
[Browsable(false)]
public virtual IndicatorMeasures Measure { get; }
Property Value
Name
Indicator name.
[Display(ResourceType = typeof(LocalizedStrings), Name = "Name", Description = "IndicatorName", GroupName = "General")]
public string Name { get; set; }
Property Value
NumValuesToInitialize
Number of values that need to be processed in order for the indicator to initialize (be IsFormed equals true). null if undefined.
[Browsable(false)]
public virtual int NumValuesToInitialize { get; }
Property Value
ResultType
Result values type.
[Browsable(false)]
public virtual Type ResultType { get; }
Property Value
Style
Chart indicator draw style.
[Browsable(false)]
public virtual DrawStyles Style { get; }
Property Value
- DrawStyles
Methods
CalcIsFormed()
Calc IsFormed.
protected virtual bool CalcIsFormed()
Returns
Clone()
Create a copy of IIndicator.
public override IIndicator Clone()
Returns
- IIndicator
Copy.
CreateValue(DateTimeOffset, object[])
Convert to indicator value.
public virtual IIndicatorValue CreateValue(DateTimeOffset time, object[] values)
Parameters
time
DateTimeOffsetvalues
object[]
Returns
Load(SettingsStorage)
Load settings.
public virtual void Load(SettingsStorage storage)
Parameters
storage
SettingsStorageSettings storage.
LoadValues(SettingsStorage)
Load settings.
protected void LoadValues(SettingsStorage storage)
Parameters
storage
SettingsStorageSettings storage.
OnProcess(IIndicatorValue)
To handle the input value.
protected abstract IIndicatorValue OnProcess(IIndicatorValue input)
Parameters
input
IIndicatorValueThe input value.
Returns
- IIndicatorValue
The resulting value.
Process(IIndicatorValue)
To handle the input value.
public virtual IIndicatorValue Process(IIndicatorValue input)
Parameters
input
IIndicatorValueThe input value.
Returns
- IIndicatorValue
The new value of the indicator.
RaiseChangedEvent(IIndicatorValue, IIndicatorValue)
To call the event Changed.
protected void RaiseChangedEvent(IIndicatorValue input, IIndicatorValue result)
Parameters
input
IIndicatorValueThe input value of the indicator.
result
IIndicatorValueThe resulting value of the indicator.
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).
public virtual void Reset()
Save(SettingsStorage)
Save settings.
public virtual void Save(SettingsStorage storage)
Parameters
storage
SettingsStorageSettings storage.
SaveValues(SettingsStorage)
Save settings.
protected void SaveValues(SettingsStorage storage)
Parameters
storage
SettingsStorageSettings storage.
ToString()
public override string ToString()
Returns
Events
Changed
The indicator change event (for example, a new value is added).
public event Action<IIndicatorValue, IIndicatorValue> Changed
Event Type
Reseted
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).
public event Action Reseted