コード例 #1
0
    public void Bind(ReturnsEval.DataSeries series_)
    {
      lblDailyLargestLoss.Bind(series_, "Min", new Validators.DoubleValidator("#0.00%"));
      lblDailyLargestProfit.Bind(series_, "Max", new Validators.DoubleValidator("#0.00%"));
      lblKurtosis.Bind(series_, "Kurtosis", new Validators.DoubleValidator("#0.00"));
      lblSkew.Bind(series_, "Skewness", new Validators.DoubleValidator("#0.00"));
      lblavgLoss.Bind(series_, "AverageLoss", new Validators.DoubleValidator("#0.00%"));
      lblAvgProfit.Bind(series_, "AverageWin", new Validators.DoubleValidator("#0.00%"));

      m_series = series_;
    }
    public void Bind(ReturnsEval.DataSeriesEvaluator eval_, DateTime startDate_, DateTime endDate_)
    {
      ReturnsEval.DataSeries[] series;
      DataRow row;
      ultraChart.DataSource = null;
      dt.Columns.Clear();
      dt.Rows.Clear();

      if (eval_ == null)
        return;
      if (eval_.InnerSeries.Count == 0)
        return;

      series = new ReturnsEval.DataSeries[eval_.InnerSeries.Count];
      for (int i = 0; i < series.Length; ++i)
      {
        series[i] = eval_.InnerSeries[i][ReturnsEval.Period.Daily];
        dt.Columns.Add(eval_.InnerSeries[i].Name.Replace("_GSLE_1", string.Empty), typeof(double));
      }

      int startIndex = 0;
      int endIndex = 0;

      for(int i=0;i<eval_[ReturnsEval.Period.Daily].Dates.Length;++i)
      {
        if(eval_[ReturnsEval.Period.Daily].Dates[i]<=startDate_)
          startIndex=i;

        if(eval_[ReturnsEval.Period.Daily].Dates[i]>endDate_)
        {
          break;
        }
        else
        {
          endIndex=i;
        }
      }

      row = dt.NewRow();
      for (int j = 0; j < series.Length; ++j)
      {
        row[j] = series[j].Data.Slice(startIndex, endIndex - startIndex).Sum();
      }
      dt.Rows.Add(row);

      ultraChart.DataSource = dt;
      ultraChart.Data.DataBind();

      showChartSeparateControl1.Create(dt, GetType(),
        "Return attribution of " + eval_.Name);
    }
コード例 #3
0
    public void Bind(ReturnsEval.DataSeries series_)
    {
      lblDailyLargestLoss.Bind(series_, "Min", new Validators.DoubleValidator("#0.00%"));
      lblDailyLargestProfit.Bind(series_, "Max", new Validators.DoubleValidator("#0.00%"));
      lblDailyAverageReturn.Bind(series_, "Mean", new Validators.DoubleValidator("#0.00%"));
      lblDailyVolOfReturns.Bind(series_,"RealisedVolPerAnnum",  new Validators.DoubleValidator("#0.00%"));
      lblDailyLosingPeriods.Bind(series_, "NumberOfLosingPeriods", new Validators.DoubleValidator("###"));
      lblDailyWinningPeriods.Bind(series_, "NumberOfWinningPeriods", new Validators.DoubleValidator("###"));
      lblKurtosis.Bind(series_, "Kurtosis", new Validators.DoubleValidator("#0.00"));
      lblSkew.Bind(series_, "Skewness", new Validators.DoubleValidator("#0.00"));
      lblavgLoss.Bind(series_, "AverageLoss", new Validators.DoubleValidator("#0.00%"));
      lblAvgProfit.Bind(series_, "AverageWin", new Validators.DoubleValidator("#0.00%"));

      m_series = series_;
    }
    public void Bind(ReturnsEval.DataSeriesEvaluator eval_, ReturnsEval.Period period_)
    {
      ReturnsEval.DataSeries[] series;
      DataRow row;
      ultraChart.DataSource = null;
      dt.Columns.Clear();
      dt.Rows.Clear();
      if (eval_ == null)
        return;

      // 1 row per period
      // each col is component part (e.g. ccy)

      if (eval_.InnerSeries.Count == 0)
        return;

      series = new ReturnsEval.DataSeries[eval_.InnerSeries.Count];
      for (int i = 0; i < series.Length; ++i)
      {
        series[i] = eval_.InnerSeries[i][period_];
        dt.Columns.Add(eval_.InnerSeries[i].Name.Replace("_GSLE_1",string.Empty), typeof(double));
      }

      row = dt.NewRow();
      for (int j = 0; j < series.Length; ++j)
      {
        row[j] = series[j].TotalReturn;
      }
      dt.Rows.Add(row);

      ultraChart.DataSource = dt;
      ultraChart.Data.DataBind();

      showChartSeparateControl1.Create(dt, GetType(),
        "Return attribution of " + eval_.Name);
    }