本文整理汇总了C#中ConstructGen.GetInnerData方法的典型用法代码示例。如果您正苦于以下问题:C# ConstructGen.GetInnerData方法的具体用法?C# ConstructGen.GetInnerData怎么用?C# ConstructGen.GetInnerData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConstructGen
的用法示例。
在下文中一共展示了ConstructGen.GetInnerData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: reloadBottomLeft
private void reloadBottomLeft(IDictionary<string, DataEncapsValue> list)
{
if (list.Count == 0 || m_blArgs.Locked)
return;
ConstructGen<double> conBottomLeft = new ConstructGen<double>(list.Count);
conBottomLeft.ColumnHeadings = new string[conBottomLeft.ArrayLength];
int i = 0;
foreach (string s in list.Keys)
{
conBottomLeft.ColumnHeadings[i] = s;
DatedDataCollectionGen<double> coll = list[s].Data;
DatedDataCollectionGen<double> monthly = coll.ToPeriod(m_blArgs.Period, m_blArgs.Collation);
for (int j = 0; j < monthly.Length; ++j)
conBottomLeft.SetValue(monthly.Dates[j], i, monthly.Data[j]);
++i;
}
conBottomLeft.SortKeys();
StringBuilder titleBuilder = new StringBuilder();
foreach (string s in list.Values.Select<DataEncapsValue, string>(x => x.Name).Distinct<string>())
titleBuilder.Append(s).Append(" / ");
titleBuilder.Length -= 3;
lbl_BL_title.Text = titleBuilder.ToString();
simpleWtsColumnChart2.Create<DateTime, string>(new SortedDictionary<DateTime, double[]>(conBottomLeft.GetInnerData()), conBottomLeft.ColumnHeadings, ExtensionMethods.FormatStringForPeriodicity(m_blArgs.Period));
//simpleWtsColumnChart2.SetYAxisScaleRange(0d, double.MinValue);
}
示例2: getRollingVols
private SortedDictionary<DateTime, double[]> getRollingVols()
{
int[] selIndexes = getSelectedIndixes();
ConstructGen<double> cum = new ConstructGen<double>(selIndexes.Length);
DateTime startDate = m_comp.GetDate(m_focus);
for (int i = 0; i < cum.ArrayLength; ++i)
{
ReturnsEval.DataSeriesEvaluator e = m_comp.GetEval(selIndexes[i]);
if(e.Daily.Dates[0]>startDate)
e.Evaluate();
e.Daily.GenerateRollingWindowSeries(m_extraArgs.RollingWindowLength);
for (int j = 0; j < e.Daily.RollingSharpeSeries[m_extraArgs.RollingSeriesType].Dates.Length; ++j)
{
DateTime date = e.Daily.RollingSharpeSeries[m_extraArgs.RollingSeriesType].Dates[j];
if (date < startDate)
continue;
double val = e.Daily.RollingSharpeSeries[m_extraArgs.RollingSeriesType].Data[j];
if(m_extraArgs.RollingSeriesType==SI.ReturnsEval.RollingSeriesType.Vol)
val /= 100.0;
cum.SetValue(date, i, val);
}
}
cum.SortKeys();
return new SortedDictionary<DateTime, double[]>(cum.GetInnerData());
}
示例3: reloadTopRight
private void reloadTopRight(IDictionary<string, DataEncapsValue> list)
{
if (list.Count == 0 || m_trArgs.Locked)
return;
ConstructGen<double> conTopRight = new ConstructGen<double>(list.Count);
conTopRight.ColumnHeadings = new string[conTopRight.ArrayLength];
int i = 0;
foreach (string s in list.Keys)
{
conTopRight.ColumnHeadings[i] = s;
DatedDataCollectionGen<double> coll = list[s].Data;
double[] series = (cbTopRightCumulative.Checked) ? coll.Data.Cumulative() : coll.Data;
for (int j = 0; j < series.Length; ++j)
conTopRight.SetValue(coll.Dates[j], i, series[j]);
++i;
}
conTopRight.SortKeys();
StringBuilder titleBuilder=new StringBuilder();
foreach (string s in list.Values.Select<DataEncapsValue, string>(x => x.Name).Distinct<string>())
titleBuilder.Append(s).Append(" / ");
titleBuilder.Length -= 3;
lbl_TR_title.Text = titleBuilder.ToString();
dataCollectionDisplay1.Create(new SortedDictionary<DateTime, double[]>(conTopRight.GetInnerData()), conTopRight.ColumnHeadings);
}
示例4: getCumulativePnls
private SortedDictionary<DateTime, double[]> getCumulativePnls()
{
int[] selIndexes = getSelectedIndixes();
ConstructGen<double> cum = new ConstructGen<double>(selIndexes.Length);
DateTime prevDate = DateTime.MinValue;
DateTime startDate = m_comp.GetDate(m_focus);
int startI = m_comp.PnlConstruct.Dates.IndexOf(startDate);
int endI = m_comp.PnlConstruct.Dates.IndexOf(m_comp.AsOfDate);
for (int i = startI; i <= endI; ++i)
{
DateTime date = m_comp.PnlConstruct.Dates[i];
for (int j = 0; j < selIndexes.Length; ++j)
{
if (i == startI)
{
cum.SetValue(date, j, m_comp.PnlConstruct.GetValue(date, selIndexes[j]));
}
else
{
cum.SetValue(date, j, m_comp.PnlConstruct.GetValue(date, selIndexes[j]) + cum.GetValue(prevDate, j));
}
}
prevDate = date;
}
return new SortedDictionary<DateTime, double[]>(cum.GetInnerData());
}