AverageHoldingTimeParameter
StockSharp.Algo.Statistics
How long a position is held on average, from leaving zero to returning there.
Herda de: BaseStatisticParameter<TimeSpan>
Implementa: IPositionStatisticParameter, IStatisticParameter, IAsyncPersistable, INotifyPropertyChanged, IDisposable
Construtores
AverageHoldingTimeParameter
public AverageHoldingTimeParameter()
averageHoldingTimeParameter = AverageHoldingTimeParameter()
Initializes a new instance of the AverageHoldingTimeParameter.
Métodos
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
Retorna: 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
Retorna: Task