Table of Contents

Class StatisticsParameter

Namespace
ATAS.DataFeedsCore.Statistics
Assembly
ATAS.DataFeedsCore.dll

Base class of the trading metrics: keeps Value and raises PropertyChanged when it changes. Derived classes calculate the value in OnProcess(HistoryMyTrade); the round trips are expected in close time order.

public abstract class StatisticsParameter : IStatisticsParameter
Inheritance
object
StatisticsParameter
Implements
Extension Methods

Constructors

StatisticsParameter()

protected StatisticsParameter()

Properties

Name

Localized display name from the type's System.ComponentModel.DisplayNameAttribute, or the type name when it has none.

public string Name { get; }

Property Value

string

Value

Current value of the metric; 0 before any round trip was processed and after Clear().

public decimal Value { get; }

Property Value

decimal

Methods

Clear()

Resets the metric: calls OnClear() and sets Value to 0.

public void Clear()

OnClear()

Resets the accumulated state of a derived metric. Does nothing by default.

protected virtual void OnClear()

OnProcess(HistoryMyTrade)

Calculates the new value of the metric after a round trip.

protected abstract decimal OnProcess(HistoryMyTrade trade)

Parameters

trade HistoryMyTrade

The round trip.

Returns

decimal

The new value; Value still holds the previous one.

OnPropertyChanged(string)

protected virtual void OnPropertyChanged(string propertyName)

Parameters

propertyName string

Name of the changed property.

Process(HistoryMyTrade)

Updates Value with the result of OnProcess(HistoryMyTrade) for a round trip.

public void Process(HistoryMyTrade trade)

Parameters

trade HistoryMyTrade

The round trip.

Exceptions

ArgumentNullException

trade is null.

Events

PropertyChanged

Raised when Value changes.

Added in ATAS 8.0.15.

public event PropertyChangedEventHandler? PropertyChanged

Event Type

PropertyChangedEventHandler