示例#1
0
    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
0
    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
0
 protected override void chartSignal(Backtest.ProductBase product_, Controls.LineChartDataDisplay chart_)
 {
   chart_.AddSeries(product_.Prices, "Prices", 40, "##0.0##");
   chart_.AddSeries(GenerateWeightSeries(product_, product_.Prices.Dates[0]), "Score", 80, "##0.0%");
 }
示例#4
0
 protected override void chartSignal(ProductBase product_, Controls.LineChartDataDisplay chart_)
 {
   chart_.AddSeries(product_.Prices, "Pxs", 40, "###0.0##");
   chart_.AddSeries(HelperMethods.GetMA(product_.Prices, FastMA), string.Format("MA({0})", FastMA), 40, "###0.0##");
   chart_.AddSeries(HelperMethods.GetMA(product_.Prices, SlowMA), string.Format("MA({0})", SlowMA), 40, "###0.0##");
 }
    protected override void chartSignal(Backtest.ProductBase product_, Controls.LineChartDataDisplay chart_)
    {
      //chart_.AddSeries(getPeriodReturns(product_.Prices), "NPeriodReturns", 80, "##0.0#%");

      //chart_.AddSeries(getZScores(product_.Prices), "zScores", 80, "##0.0#");

      chart_.AddSeries(GenerateWeightSeries(product_,null), "SignalScores", 80, "##0.0#");
    }
示例#6
0
    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");
    }