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)); }