SharpeRatioParameter
StockSharp.Algo.Statistics
Sharpe ratio (annualized return - risk-free rate / annualized standard deviation).
Inherits: RiskAdjustedRatioParameter
Constructors
SharpeRatioParameter
public SharpeRatioParameter()
sharpeRatioParameter = SharpeRatioParameter()
Initialize a new instance of the SharpeRatioParameter class.
Methods
AddRiskSample
protected override void AddRiskSample(decimal ret)
sharpeRatioParameter.AddRiskSample(ret)
Adds a new sample to the risk accumulator.
- ret
- The return value.
GetRisk
protected override decimal GetRisk(int count, decimal sumReturn)
result = sharpeRatioParameter.GetRisk(count, sumReturn)
Gets the risk value (e.g., stddev or downside deviation).
- count
- Count of samples.
- sumReturn
- Sum of all returns.
Returns: Risk value.
HasEnoughRiskSamples
protected override bool HasEnoughRiskSamples(int count)
result = sharpeRatioParameter.HasEnoughRiskSamples(count)
Checks if enough risk samples accumulated for calculation.
- count
- Count of samples.
Returns: Check result.
Load
public override void Load(SettingsStorage storage)
sharpeRatioParameter.Load(storage)
To load the state of statistic parameter.
- storage
- Storage.
Save
public override void Save(SettingsStorage storage)
sharpeRatioParameter.Save(storage)
To save the state of statistic parameter.
- storage
- Storage.