本文整理汇总了C#中StockSerie.CalculateSarReturn方法的典型用法代码示例。如果您正苦于以下问题:C# StockSerie.CalculateSarReturn方法的具体用法?C# StockSerie.CalculateSarReturn怎么用?C# StockSerie.CalculateSarReturn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StockSerie
的用法示例。
在下文中一共展示了StockSerie.CalculateSarReturn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EvalPersonalityList
private SortedDictionary<float, StockPersonality> EvalPersonalityList(StockSerie stockSerie, List<StockPersonality> personalityList)
{
SortedDictionary<float, StockPersonality> returnDico = new SortedDictionary<float, StockPersonality>();
float returnValue;
foreach (StockPersonality stockPersonality in personalityList)
{
stockSerie.StockAnalysis.StockPersonality = stockPersonality;
stockSerie.AddSerie(StockDataType.SAREX_FOLLOWER_CUSTOM, null);
stockSerie.AddSerie(StockIndicatorType.BUY_SELL_RATE, null);
returnValue = stockSerie.CalculateSarReturn(StockDataType.SAREX_FOLLOWER_CUSTOM);
if (returnValue >0 && !returnDico.ContainsKey(returnValue))
{
returnDico.Add(returnValue, stockPersonality);
}
}
return returnDico;
}
示例2: UpdateBestForValue
private void UpdateBestForValue(StockSerie stockSerie, FloatPropertyRange range, bool refreshGUI,
ref float bestReturn, ref StockPersonality bestPersonality, float currentValue)
{
stockSerie.StockAnalysis.StockPersonality.SetFloatPropertyValue(range, currentValue);
stockSerie.ResetSAREX();
float currentReturn = stockSerie.CalculateSarReturn(StockDataType.SAREX_FOLLOWER_CUSTOM);
if ( currentReturn > bestReturn)
{
bestPersonality = stockSerie.StockAnalysis.StockPersonality.Clone();
bestReturn = currentReturn;
// Refresh GUI
if (refreshGUI)
{
this.simulationParameterControl.Personality = bestPersonality;
}
}
if (!this.allStocksCheckBox.Checked)
{
if (this.progressBar.Value < this.progressBar.Maximum)
{
this.progressBar.Value++;
}
else
{
this.progressBar.Value = 0;
}
}
}