public void Create(WtsSeriesAnalyzer analyzer_, DateTime? startDate_=null, DateTime? endDate_=null)
    {
      m_analyzer = analyzer_;
      m_startDate = startDate_;
      m_endDate = endDate_;

      if (m_wtsChart == null)
      {
        m_wtsChart = new DataCollectionDisplay();
        m_wtsChart.Dock = DockStyle.Fill;
        panel3.ClientArea.Controls.Add(m_wtsChart);
      }

      if (m_perfAndWeightsChart == null)
      {
        m_perfAndWeightsChart = new ZoneChart();
        m_perfAndWeightsChart.Dock = DockStyle.Fill;
        panel1.ClientArea.Controls.Add(m_perfAndWeightsChart);
      }

      if (m_c2vWeightsChart == null)
      {
        m_c2vWeightsChart = new ZoneChart();
        m_c2vWeightsChart.Dock = DockStyle.Fill;
        panel2.ClientArea.Controls.Add(m_c2vWeightsChart);
      }

      if (m_monthlyPnlChart == null)
      {
        m_monthlyPnlChart = new SimpleWtsColumnChart();
        m_monthlyPnlChart.Dock = DockStyle.Fill;
        panel4.ClientArea.Controls.Add(m_monthlyPnlChart);
      }

      if (m_annotatedChart == null)
      {
        m_annotatedChart = new LineChartWithAnnotations();
        m_annotatedChart.Dock = DockStyle.Fill;
        panel5.ClientArea.Controls.Add(m_annotatedChart);
      }

      ultraListBar1.Groups[0].Items.Clear();

      for(int i=0;i<m_analyzer.SourceWts.ColumnHeadings.Length;++i)
      {
        string s = m_analyzer.SourceWts.ColumnHeadings[i];
        
        //Currency c = Singleton<FXIDs>.Instance[s];

        Infragistics.Win.UltraWinListBar.Item item =  ultraListBar1.Groups[0].Items.Add(key: s, text: s);

        item.Tag = i;
      }
      
    }
Exemplo n.º 2
0
    private void add(WtsSeriesAnalyzer analyzer_, SI.Controls.Panel panel_, FXGroup group_)
    {
      ZoneChart zc = new ZoneChart();
      zc.Dock = DockStyle.Fill;
      panel_.ClientArea.Controls.Add(zc);

      double[] pnl = new double[analyzer_.Performance.Dates.Count];
      double[] wts = new double[analyzer_.SourceWts.Dates.Count];

      for (int i = 0; i < analyzer_.Performance.ArrayLength; ++i)
      {
        Currency ccy = Singleton<FXIDs>.Instance[i];

        if (ccy.IsGroup(group_) == false)
          continue;

        for (int j = 0; j < pnl.Length; ++j)
        {
          pnl[j] += analyzer_.Performance.GetValue(analyzer_.Performance.Dates[j], i);
        }

        for (int j = 0; j < wts.Length; ++j)
        {
          wts[j] += analyzer_.SourceWts.GetValue(analyzer_.SourceWts.Dates[j], i);
        }

        DatedDataCollectionGen<double> perf = new DatedDataCollectionGen<double>(analyzer_.Performance.Dates.ToArray(), pnl);
        DatedDataCollectionGen<double> wwww = new DatedDataCollectionGen<double>(analyzer_.SourceWts.Dates.ToArray(), wts);
        if (m_startDate != null && m_endDate != null)
        {
          perf = perf.GetSubValues(m_startDate.Value, m_endDate.Value);
          wwww = wwww.GetSubValues(m_startDate.Value, m_endDate.Value);
        }


        zc.Create(
          new DatedDataCollectionGen<double>(perf.Dates, perf.Data.Cumulative()),
          wwww,
          new ZoneDefinition[] {
            new ZoneDefinition("Short",double.MinValue,0d,Color.IndianRed),
            new ZoneDefinition("Long",0d,double.MaxValue,Color.LightGreen)
          });
      }
    }