PerPeriodBaseTradeParameter

StockSharp.Algo.Statistics

Base class for calculating trade statistic parameters by aggregating trades over aligned time periods.

Inherits: BaseStatisticParameter<decimal>

Implements: ITradeStatisticParameter, IStatisticParameter, IAsyncPersistable, INotifyPropertyChanged, IDisposable

Constructors

PerPeriodBaseTradeParameter
protected PerPeriodBaseTradeParameter(StatisticParameterTypes type)
perPeriodBaseTradeParameter = PerPeriodBaseTradeParameter(type)

Base class for calculating trade statistic parameters by aggregating trades over aligned time periods.

type
Type

Methods

Add
public void Add(PnLInfo info)
perPeriodBaseTradeParameter.Add(info)

To add information about new trade to the parameter.

info
Information on new trade.
Align
protected abstract DateTime Align(DateTime date)
result = perPeriodBaseTradeParameter.Align(date)

Align the specified date for exact period start.

date
Trade date.

Returns: Aligned value.

LoadAsync
public override Task LoadAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = perPeriodBaseTradeParameter.LoadAsync(storage, cancellationToken)

To load the state of statistic parameter.

storage
Storage.
cancellationToken
CancellationToken

Returns: Task

Reset
public override void Reset()
perPeriodBaseTradeParameter.Reset()

To reset the parameter value.

SaveAsync
public override Task SaveAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = perPeriodBaseTradeParameter.SaveAsync(storage, cancellationToken)

To save the state of statistic parameter.

storage
Storage.
cancellationToken
CancellationToken

Returns: Task