本文整理汇总了C#中ConstructGen.EnsureDate方法的典型用法代码示例。如果您正苦于以下问题:C# ConstructGen.EnsureDate方法的具体用法?C# ConstructGen.EnsureDate怎么用?C# ConstructGen.EnsureDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConstructGen
的用法示例。
在下文中一共展示了ConstructGen.EnsureDate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnClick
protected override void OnClick(EventArgs e)
{
ConstructGen<double> shortBasket = new ConstructGen<double>(m_analyzer.SourceWts.ColumnHeadings);
ConstructGen<double> longBasket = new ConstructGen<double>(m_analyzer.SourceWts.ColumnHeadings);
foreach (DateTime date in m_analyzer.SourceWts.Dates)
{
double[] fullWts = m_analyzer.SourceWts.GetValues(date);
shortBasket.EnsureDate(date);
longBasket.EnsureDate(date);
for (int i = 0; i < fullWts.Length; ++i)
if (fullWts[i] > 0d)
longBasket.SetValue(date, i, fullWts[i]);
else if (fullWts[i] < 0d)
shortBasket.SetValue(date, i, fullWts[i]);
}
var allResult = ReturnsFromFXWeights.DoIt_DailyWeights(m_analyzer.SourceWts);
var longREsult = ReturnsFromFXWeights.DoIt_DailyWeights(longBasket);
var shortResult = ReturnsFromFXWeights.DoIt_DailyWeights(shortBasket);
List<ReturnsEval.DataSeriesEvaluator> evals = new List<ReturnsEval.DataSeriesEvaluator>();
//evals.Add(allResult.GetEvaluatorCombinedSpotAndCarry());
//evals.Last().Name = m_analyzer.Name;
//evals.Add(longREsult.GetEvaluatorCombinedSpotAndCarry());
//evals.Last().Name = "LongBasket";
//evals.Add(shortResult.GetEvaluatorCombinedSpotAndCarry());
//evals.Last().Name = "ShortBasket";
evals.Display(string.Format("{0} split into long/short baskets", m_analyzer.Name));
}