本文整理汇总了C#中Controls.ClearSeries方法的典型用法代码示例。如果您正苦于以下问题:C# Controls.ClearSeries方法的具体用法?C# Controls.ClearSeries怎么用?C# Controls.ClearSeries使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Controls
的用法示例。
在下文中一共展示了Controls.ClearSeries方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: chartSignal
protected override void chartSignal(Backtest.ProductBase product_, Controls.LineChartDataDisplay chart_)
{
chart_.ClearSeries();
chart_.AddSeries(product_.Prices, "Prices", 40, "##0.0##");
chart_.AddSeries(HelperMethods.GetRollingStat(product_.Prices, MA, Statistics.Average), "MA", 40, "##0.0##");
var series = product_.Prices;
var rollingStdev = HelperMethods.GetRollingStat(product_.Prices.ToReturns(), 252, x => Statistics.Stdev(x)*Math.Sqrt(252d));
chart_.AddSeries(rollingStdev, "Stdev", 80,
"##0.0#%");
chart_.AddSeries(
HelperMethods.GetRollingStat(rollingStdev, 252, x => HelperMethods.GetPercentRank(x, x.Length - 1)),
"Stdev_Pctile", 120, "0.00");
}
示例2: Chart
public override void Chart(Controls.LineChartDataDisplay lcdd_, Backtest.ProductBase product_)
{
var pxs = product_.Prices;
lcdd_.ClearSeries();
lcdd_.AddSeries(pxs, string.Format("{0} price", product_.Name), 40, "##0.0##");
if (MA1.HasValue)
lcdd_.AddSeries(HelperMethods.GetRollingStat(pxs, MA1.Value, Statistics.Average),
string.Format("MA({0})", MA1), 40, "##0.0##");
if(MA2.HasValue)
lcdd_.AddSeries(HelperMethods.GetRollingStat(pxs, MA2.Value, Statistics.Average),
string.Format("MA({0})", MA2), 40, "##0.0##");
if (MA3.HasValue)
lcdd_.AddSeries(HelperMethods.GetRollingStat(pxs, MA3.Value, Statistics.Average),
string.Format("MA({0})", MA3), 40, "##0.0##");
}
示例3: chartSignal
protected override void chartSignal(Backtest.ProductBase product_, Controls.LineChartDataDisplay chart_)
{
var cumultRet = product_.Prices.ToReturns(product_.Convention).ToCumulative();
var ma1 = HelperMethods.GetMA(cumultRet, MA1);
var ma2 = HelperMethods.GetMA(cumultRet, MA2);
var ma3 = HelperMethods.GetMA(cumultRet, MA3);
var ks = HelperMethods.GetRollingStat(cumultRet, KWindow, HelperMethods.GetK);
chart_.ClearSeries();
chart_.AddSeries(cumultRet, "Prices", 40, "##0.0##");
chart_.AddSeries(ma1, string.Format("MA({0})", MA1), 40, "##0.0##");
chart_.AddSeries(ma2, string.Format("MA({0})", MA2), 40, "##0.0##");
chart_.AddSeries(ma3, string.Format("MA({0})", MA3), 40, "##0.0##");
chart_.AddSeries(ks, string.Format("K({0})", KWindow), 80, "##0.0");
}