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
-
objectStatisticsParameter
- 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()
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
tradeHistoryMyTradeThe round trip.
Returns
- decimal
The new value; Value still holds the previous one.
OnPropertyChanged(string)
Raises PropertyChanged.
protected virtual void OnPropertyChanged(string propertyName)
Parameters
propertyNamestringName of the changed property.
Process(HistoryMyTrade)
Updates Value with the result of OnProcess(HistoryMyTrade) for a round trip.
public void Process(HistoryMyTrade trade)
Parameters
tradeHistoryMyTradeThe round trip.
Exceptions
- ArgumentNullException
tradeisnull.
Events
PropertyChanged
Raised when Value changes.
Added in ATAS 8.0.15.
public event PropertyChangedEventHandler? PropertyChanged
Event Type
- PropertyChangedEventHandler