예제 #1
0
        public override BaseDataTable GetData(int RecordCnt)
        {
            if (this.ExecStrategy == null)
            {
                throw (new Exception("必须先指定策略!"));
            }
            WindAPI   wa   = this.ExecStrategy.w;
            MACDTable data = new MACDTable();

            CommWDToolClass.GetMutliSerialData(wa,
                                               this.secCode,
                                               WDDayClass.Offset(wa, Endt, this.PassViewDays, this.Cycle),
                                               this.Endt,
                                               this.Cycle,
                                               this.Rate,
                                               true,
                                               "MACD.DIFF,MACD.DEA,MACD.MACD"
                                               );
            return(null);
        }
예제 #2
0
        private void btn_run_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            string indexcode = new SIIIClass().SummaryCode; //必须先主动获取
            MTable mt        = CommWDToolClass.getBkList(this.gb.w, indexcode, this.txt_EndT.Value);

            if (mt == null)
            {
                MessageBox.Show("股票池数据为空");
                return;
            }
            if (mt.Count == 0)
            {
                toolStripStatus_left.Text  = string.Format("共计记录条数:{0}", 0);
                toolStripStatus_Right.Text = "无法查找到记录";
                dataGridView1.DataSource   = null;
                dataGridView1.Show();
                this.Cursor = Cursors.Default;
                return;
            }
            MTable secTab = mt["wind_code"];

            string[] sectors = secTab.ToList <string>().ToArray();
            MTable   tmp     = CommWDToolClass.GetMutliSetData(this.gb.w,
                                                               sectors,
                                                               this.txt_EndT.Value,
                                                               (Cycle)this.ddl_cycle.SelectedIndex,
                                                               (PriceAdj)this.ddl_priceAdj.SelectedIndex,
                                                               false,
                                                               "KDJ.J");

            mt.AddColumnByArray("CurrCycleValue", tmp, "J");
            DateTime preDate = WDDayClass.Offset(this.gb.w, this.txt_EndT.Value, -1, (Cycle)this.ddl_cycle.SelectedIndex);

            tmp = CommWDToolClass.GetMutliSetData(this.gb.w,
                                                  sectors,
                                                  preDate,
                                                  (Cycle)this.ddl_cycle.SelectedIndex,
                                                  (PriceAdj)this.ddl_priceAdj.SelectedIndex,
                                                  false,
                                                  "KDJ.J");
            mt.AddColumnByArray("PreCycleValue", tmp, "J");
            //高一频度周期数据
            if (this.ddl_cycle.SelectedIndex > 0)
            {
                tmp = CommWDToolClass.GetMutliSetData(this.gb.w,
                                                      sectors,
                                                      this.txt_EndT.Value,
                                                      (Cycle)(this.ddl_cycle.SelectedIndex - 1),
                                                      (PriceAdj)this.ddl_priceAdj.SelectedIndex,
                                                      false,
                                                      "KDJ.K,KDJ.J");
                mt.AddColumnByArray("LowCycleValue", tmp, "J");
                mt.AddColumnByArray("LowCycleK", tmp, "K");
                tmp = CommWDToolClass.GetMutliSetData(this.gb.w,
                                                      sectors,
                                                      preDate,
                                                      (Cycle)(this.ddl_cycle.SelectedIndex - 1),
                                                      (PriceAdj)this.ddl_priceAdj.SelectedIndex,
                                                      false,
                                                      "KDJ.J");
                mt.AddColumnByArray("PreLowCycleValue", tmp, "J");
            }
            MTable dte = mt;
            MTable fdt = dte.Select("PreCycleValue>CurrCycleValue And (PreCycleValue <5 and CurrCycleValue<5)  And (LowCycleK<20 Or LowCycleValue<=5 Or PreLowCycleValue>LowCycleValue)");

            toolStripStatus_Right.Text          = "完成";
            toolStripStatus_left.Text           = string.Format("共计记录条数:{0}", fdt.Count);
            dataGridView1.CellMouseDoubleClick += new DataGridViewCellMouseEventHandler(dataGridView1_CellMouseDoubleClick);
            dataGridView1.DataSource            = fdt.GetTable();
            dataGridView1.Tag = fdt;
            dataGridView1.Show();
            this.Cursor = Cursors.Default;
        }