Пример #1
0
        public static WindData windNetProfitBelongToParComSH(String strWindCode, DateTime dtReportDate)
        {
            WindData wd = ConnWindData.fetchTimeSeriesSecInfo(strWindCode, "np_belongto_parcomsh", dtReportDate, dtReportDate, "rptType=1");

            ConnWind.windEnsureNoErr(wd);
            return(wd);
        }
Пример #2
0
        /// <summary>
        /// 预告净利润同比增长下限
        /// </summary>
        /// <param name="strWindCode"></param>
        /// <param name="dtReportDate"></param>
        public static WindData windProfitNoticeChangeMin(String strWindCode, DateTime dtReportDate)
        {
            WindData wd = ConnWindData.fetchTimeSeriesSecInfo(strWindCode, "profitnotice_changemin", dtReportDate, dtReportDate);

            ConnWind.windEnsureNoErr(wd);
            return(wd);
        }
Пример #3
0
        private DataTable fetchPeriodPctChgTable()
        {
            DateTime  dtBegin = dateTimePicker1.Value;
            DateTime  dtEnd;
            DataTable dtIndustryPctChg;
            //DataTable dtIndustryVolume;

            string strWindCode = UtilityTable.getCodeStringFromDataTableCol(dtIndustryIndex, 1);

            if (UtilityCalendar.isAfterTradeHour(dateTimePicker1.Value))
            {
                dtBegin = dateTimePicker1.Value;
            }
            else
            {
                dtBegin = UtilityCalendar.fetchDayOffset(DateTime.Now.AddDays(-1), 0);
            }
            dtEnd = dtBegin;

            WindData wd = ConnWindData.fetchTimeSeriesSecInfo(strWindCode, "pct_chg", dtEnd, dtBegin);

            dtIndustryPctChg = ConnWindData.convertWindDatatoTable(wd);

            //wd = ConnWindData.fetchTimeSeriesSecInfo(strWindCode, "volume", dtEnd, dtBegin);
            //dtIndustryVolume = ConnWindData.convertWindDatatoTable(wd);

            dtIndustryPctChg.Columns.Add("Sector Name");
            dtIndustryPctChg.Columns.Add("Sector Code");
            dtIndustryPctChg.Columns.Add("PCT CHG", typeof(double));
            dtIndustryPctChg.Columns.Add("Volume", typeof(double));
            for (int i = 0; i < dtIndustryPctChg.Rows.Count; i++)
            {
                string strIndustryName = dtIndustryIndex.Rows[i][2].ToString();
                dtIndustryPctChg.Rows[i]["Sector Name"] = strIndustryName.Substring(0, strIndustryName.Length - 4);
                dtIndustryPctChg.Rows[i]["Sector Code"] = dtIndustryIndex.Rows[i][1];
                dtIndustryPctChg.Rows[i]["PCT CHG"]     = double.Parse(dtIndustryPctChg.Rows[i]["PCT_CHG"].ToString()) / 100;
                //dtIndustryPctChg.Rows[i]["Volume"] = double.Parse(dtIndustryVolume.Rows[i]["VOLUME"].ToString()) / 10000;
            }

            dtIndustryPctChg.Columns["PCT_CHG"].Dispose();
            DataView dv = dtIndustryPctChg.DefaultView;

            dv.Sort = "PCT CHG Asc";
            return(dv.ToTable());
        }
Пример #4
0
        private void plotIndexPriceSeries(Chart chartPlot)
        {
            string strBenchmark = "000300.SH";

            WindData  wd          = ConnWindData.fetchTimeSeriesSecInfo(strSelectedWindCode, "close", dateTimePicker1.Value.AddMonths(-3), dateTimePicker1.Value);
            DataTable dtIndex     = ConnWindData.convertWindDatatoTable(wd);
            DataTable dtBenchmark = ConnWindData.convertWindDatatoTable(
                ConnWindData.fetchTimeSeriesSecInfo(strBenchmark, "close", dateTimePicker1.Value.AddMonths(-3), dateTimePicker1.Value));

            DataTable dtMixTable = new DataTable("Mix Data Table");

            dtMixTable.Columns.Add("DateTime", typeof(DateTime));
            dtMixTable.Columns.Add("Index", typeof(Double));
            dtMixTable.Columns.Add("Benchmark", typeof(double));

            for (int i = 0; i < dtBenchmark.Rows.Count; i++)
            {
                DataRow dr = dtMixTable.NewRow();
                dr["DateTime"]  = wd.timeList[i];
                dr["Index"]     = dtIndex.Rows[i]["CLOSE"];
                dr["Benchmark"] = dtBenchmark.Rows[i]["CLOSE"];
                dtMixTable.Rows.Add(dr);
            }

            DataView dv = dtMixTable.DefaultView;

            dv.Sort = "Index";
            double dMinimal = (double)dtMixTable.Rows[0]["Index"];

            dv.Sort = "Benchmark";
            double dMinimalBenchmark = (double)dtMixTable.Rows[0]["Benchmark"];

            chartPlot.ChartAreas[0].AxisY.Minimum            = dMinimal * 0.95;
            chartPlot.ChartAreas[0].AxisY2.Minimum           = dMinimalBenchmark * 0.95;
            chartPlot.ChartAreas[0].AxisY.LabelStyle.Format  = "N1";
            chartPlot.ChartAreas[0].AxisY2.LabelStyle.Format = "N1";
            chartPlot.ChartAreas[0].AxisY.LabelAutoFitStyle  = LabelAutoFitStyles.DecreaseFont;
            chartPlot.ChartAreas[0].AxisY2.LabelAutoFitStyle = LabelAutoFitStyles.DecreaseFont;
            chartPlot.ChartAreas[0].AxisX.LabelAutoFitStyle  = LabelAutoFitStyles.DecreaseFont;

            chartPlot.ChartAreas[0].AxisY.MajorGrid.Enabled  = false;
            chartPlot.ChartAreas[0].AxisY2.MajorGrid.Enabled = false;
            chartPlot.ChartAreas[0].AxisX.MajorGrid.Enabled  = false;
            chartPlot.ChartAreas[0].AxisX2.MajorGrid.Enabled = false;
            chartPlot.Legends[0].Docking = Docking.Right;

            chartPlot.Titles.Clear();
            chartPlot.Titles.Add(strSelectIndexName + "vs 沪深300 近三个月走势");
            chartPlot.DataSource = dtMixTable;
            chartPlot.Series.Clear();

            Series SeriesIndex = chartPlot.Series.Add("Industry Close Price");

            SeriesIndex.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;

            SeriesIndex.MarkerStyle = MarkerStyle.Circle;
            SeriesIndex.MarkerSize  = 5;

            SeriesIndex.XValueMember  = "DateTime";
            SeriesIndex.YValueMembers = "Index";

            SeriesIndex.ToolTip = strSelectedWindCode + "\r\n收盘价: #VAL\r\n日期: #VALX";

            Series SeriesBenchmark = chartPlot.Series.Add("BenchMark Close Price");

            SeriesBenchmark.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;

            SeriesBenchmark.YAxisType = AxisType.Secondary;

            SeriesBenchmark.MarkerStyle = MarkerStyle.Circle;
            SeriesBenchmark.MarkerSize  = 5;

            SeriesBenchmark.XValueMember  = "DateTime";
            SeriesBenchmark.YValueMembers = "Benchmark";

            SeriesBenchmark.ToolTip = strBenchmark + "\r\n收盘价: #VAL\r\n日期: #VALX";
        }