Table of Contents

Class BaseChartIndicatorPainter<TIndicator>

Namespace
StockSharp.Xaml.Charting.IndicatorPainters
Assembly
StockSharp.Xaml.Charting.dll

The indicator renderer base class on the chart (for example, lines, histograms, etc.).

public abstract class BaseChartIndicatorPainter<TIndicator> : ChartBaseViewModel, IChartIndicatorPainter, IPersistable where TIndicator : IIndicator

Type Parameters

TIndicator

Type of IIndicator.

Inheritance
BaseChartIndicatorPainter<TIndicator>
Implements
IPersistable
Derived
Inherited Members
Extension Methods

Constructors

BaseChartIndicatorPainter()

protected BaseChartIndicatorPainter()

Properties

Element

The chart element representing the indicator.

[Browsable(false)]
public IChartIndicatorElement Element { get; }

Property Value

IChartIndicatorElement

InnerElements

Child elements.

[Browsable(false)]
public IReadOnlyList<IChartElement> InnerElements { get; }

Property Value

IReadOnlyList<IChartElement>

IsAttached

Whether this painter is currently attached to chart element.

protected bool IsAttached { get; }

Property Value

bool

Methods

AddChildElement(IChartElement)

Add inner chart element.

protected void AddChildElement(IChartElement element)

Parameters

element IChartElement

Element.

Draw(IChartDrawData)

To process the new data.

public virtual bool Draw(IChartDrawData data)

Parameters

data IChartDrawData

New data.

Returns

bool

true if the data was successfully drawn, otherwise, returns false.

DrawValues(IList<IndicatorData>, IChartElement)

Draw indicator single double values.

protected bool DrawValues(IList<ChartDrawData.IndicatorData> vals, IChartElement element)

Parameters

vals IList<ChartDrawData.IndicatorData>

Values.

element IChartElement

Element.

Returns

bool

true if the data was successfully drawn, otherwise, returns false.

DrawValues(IList<IndicatorData>, IChartElement, Func<IndicatorData, double>)

Draw indicator values using value getter.

protected bool DrawValues(IList<ChartDrawData.IndicatorData> vals, IChartElement element, Func<ChartDrawData.IndicatorData, double> getValue)

Parameters

vals IList<ChartDrawData.IndicatorData>

Values.

element IChartElement

Element.

getValue Func<ChartDrawData.IndicatorData, double>

Converter.

Returns

bool

true if the data was successfully drawn, otherwise, returns false.

DrawValues(IList<IndicatorData>, IList<IndicatorData>, IChartElement)

Draw indicator band values (2 doubles).

protected bool DrawValues(IList<ChartDrawData.IndicatorData> vals1, IList<ChartDrawData.IndicatorData> vals2, IChartElement element)

Parameters

vals1 IList<ChartDrawData.IndicatorData>

Values 1.

vals2 IList<ChartDrawData.IndicatorData>

Values 2.

element IChartElement

Element.

Returns

bool

true if the data was successfully drawn, otherwise, returns false.

DrawValues(IList<IndicatorData>, IList<IndicatorData>, IChartElement, Func<double, double, double>)

Draw indicator converting from 2 doubles to one with converter.

protected bool DrawValues(IList<ChartDrawData.IndicatorData> vals1, IList<ChartDrawData.IndicatorData> vals2, IChartElement element, Func<double, double, double> op)

Parameters

vals1 IList<ChartDrawData.IndicatorData>

Values 1.

vals2 IList<ChartDrawData.IndicatorData>

Values 2.

element IChartElement

Element.

op Func<double, double, double>

Operation.

Returns

bool

true if the data was successfully drawn, otherwise, returns false.

Load(SettingsStorage)

Load settings.

public virtual void Load(SettingsStorage storage)

Parameters

storage SettingsStorage

Settings storage.

OnAttached(IChartIndicatorElement)

Called when this painter is attached to chart indicator element.

public void OnAttached(IChartIndicatorElement element)

Parameters

element IChartIndicatorElement

OnDetached()

Called when this painter is detached from chart indicator element.

public void OnDetached()

OnDraw(TIndicator, IDictionary<IIndicator, IList<IndicatorData>>)

Draw values on chart.

protected abstract bool OnDraw(TIndicator indicator, IDictionary<IIndicator, IList<ChartDrawData.IndicatorData>> data)

Parameters

indicator TIndicator

Indicator.

data IDictionary<IIndicator, IList<ChartDrawData.IndicatorData>>

Indicator values to draw on chart.

Returns

bool

true if the data was successfully drawn, otherwise, returns false.

RemoveChildElement(IChartElement)

Remove inner chart element.

protected void RemoveChildElement(IChartElement element)

Parameters

element IChartElement

Element.

Reset()

To reset painter child elements.

public virtual void Reset()

Save(SettingsStorage)

Save settings.

public virtual void Save(SettingsStorage storage)

Parameters

storage SettingsStorage

Settings storage.