BaseIndicator
The base Indicator.
Inherits: Cloneable<IIndicator>
Implements: IIndicator, IPersistable, ICloneable<IIndicator>, ICloneable
Constructors
Properties
public virtual Color? Color { get; }
value = baseIndicator.Color
Indicator color. If then the color will be automatically selected.
public IIndicatorContainer Container { get; }
value = baseIndicator.Container
The container storing indicator data.
public Guid Id { get; private set; }
value = baseIndicator.Id
baseIndicator.Id = value
Unique ID.
public bool IsFormed { get; protected set; }
value = baseIndicator.IsFormed
baseIndicator.IsFormed = value
Whether the indicator is set.
public bool IsPreloaded { get; }
value = baseIndicator.IsPreloaded
Indicates whether the indicator has been preloaded with historical/external values.
public virtual IndicatorMeasures Measure { get; }
value = baseIndicator.Measure
IndicatorMeasures.
public string Name { get; set; }
value = baseIndicator.Name
baseIndicator.Name = value
Indicator name.
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.
public Level1Fields? Source { get; set; }
value = baseIndicator.Source
baseIndicator.Source = value
Field specified value source.
public virtual DrawStyles Style { get; }
value = baseIndicator.Style
Chart indicator draw style.
Methods
protected void AddResetTracking(IIndicator indicator)
baseIndicator.AddResetTracking(indicator)
To add inner indicator for tracking the Reseted.
- indicator
- IIndicator
protected virtual bool CalcIsFormed()
result = baseIndicator.CalcIsFormed()
Calc IsFormed.
Returns: IsFormed
public override IIndicator Clone()
result = baseIndicator.Clone()
Create a copy of IIndicator.
Returns: Copy.
public IIndicatorValue CreateValue(DateTime time, object[] values)
result = baseIndicator.CreateValue(time, values)
Convert to indicator value.
- time
- Time
- values
- ToValues
Returns: IIndicatorValue
public virtual void Load(SettingsStorage storage)
baseIndicator.Load(storage)
Load settings.
- storage
- Settings storage.
protected void LoadValues(SettingsStorage storage)
baseIndicator.LoadValues(storage)
Load settings.
- storage
- Settings storage.
protected virtual IIndicatorValue OnCreateValue(DateTime time)
result = baseIndicator.OnCreateValue(time)
Create a new instance of IIndicatorValue for the specified time.
- time
- Time
Returns: IIndicatorValue
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.
protected abstract IIndicatorValue OnProcess(IIndicatorValue input)
result = baseIndicator.OnProcess(input)
To handle the input value.
- input
- The input value.
Returns: The resulting value.
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.
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.
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.
protected void RemoveResetTracking(IIndicator indicator)
baseIndicator.RemoveResetTracking(indicator)
To remove indicator from tracking the Reseted.
- indicator
- IIndicator
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).
public virtual void Save(SettingsStorage storage)
baseIndicator.Save(storage)
Save settings.
- storage
- Settings storage.
protected void SaveValues(SettingsStorage storage)
baseIndicator.SaveValues(storage)
Save settings.
- storage
- Settings storage.
public override string ToString()
result = baseIndicator.ToString()
Преобразовать к строковому представлению.
Returns: Строковое представление.
Events
public event Action<IIndicatorValue, IIndicatorValue> Changed
baseIndicator.Changed += handler
The indicator change event (for example, a new value is added).
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).