AverageHoldingTimeParameter

StockSharp.Algo.Statistics

How long a position is held on average, from leaving zero to returning there.

继承自: BaseStatisticParameter<TimeSpan>

实现: IPositionStatisticParameter, IStatisticParameter, IAsyncPersistable, INotifyPropertyChanged, IDisposable

构造函数

AverageHoldingTimeParameter
public AverageHoldingTimeParameter()
averageHoldingTimeParameter = AverageHoldingTimeParameter()

Initializes a new instance of the AverageHoldingTimeParameter.

方法

Add
public void Add(DateTime marketTime, decimal position)
averageHoldingTimeParameter.Add(marketTime, position)

To add the new position value to the parameter.

marketTime
The exchange time.
position
The new position value.
LoadAsync
public override Task LoadAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = averageHoldingTimeParameter.LoadAsync(storage, cancellationToken)

To load the state of statistic parameter.

storage
Storage.
cancellationToken
CancellationToken

返回值: Task

Reset
public override void Reset()
averageHoldingTimeParameter.Reset()

To reset the parameter value.

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

To save the state of statistic parameter.

storage
Storage.
cancellationToken
CancellationToken

返回值: Task