Beispiel #1
0
        public static DateTime[] getTradeDates(MongoDataReader w, string SecCode, DateTime begt, DateTime endt, Cycle cyc)
        {
            BaseDataTable tb  = CommWDToolClass.GetBaseSerialData(w, SecCode, begt, endt, cyc, PriceAdj.UnDo, BaseDataPoint.trade_status, BaseDataPoint.sec_type, BaseDataPoint.close);
            BaseDataTable ttb = tb.AvaliableData;

            return(ttb["DateTime"].ToList <DateTime>().ToArray());
        }
Beispiel #2
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);
        }
Beispiel #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            //RunResultClass ret = CommWDToolClass.GetSetBaseData(gb.w,"000613.SZ,300369.SZ,002512.SZ,600721.SH,300344.SZ,000100.SZ",DateTime.Today);
            ////MACDGuidProcess mp = new MACDGuidProcess(gb.w);
            ////RunResultClass ret = mp.getDateSerialResult("000100.SZ",Convert.ToDateTime("2017/7/7"), DateTime.Today);
            ////BaseDataProcess bp = new BaseDataProcess(gb.w);
            ////RunResultClass bret = bp.getDateSerialResult("000100.SZ", Convert.ToDateTime("2017/7/7"), DateTime.Today);
            //RunResultClass ret =mp.getSetDataResult("000613.SZ,300369.SZ,002512.SZ,600721.SH,300344.SZ,000100.SZ", null, DateTime.Today);
            //RunResultClass ret = CommWDToolClass.(gb.w, "000613.SZ,300369.SZ,002512.SZ,600721.SH,300344.SZ,000100.SZ", DateTime.Today);
            //BaseDataTable dt = CommWDToolClass.GetBaseData(gb.w, "000613.SZ,300369.SZ,002512.SZ,600721.SH,300344.SZ,000100.SZ", Convert.ToDateTime("2018/3/10"), Cycle.Day, PriceAdj.Beyond);

            string        code = new SIIIClass().SummaryCode;
            BaseDataTable bdt  = CommWDToolClass.GetMarketsStocks(this.gb.w,
                                                                  "000300.SH",
                                                                  DateTime.Today,
                                                                  200,
                                                                  true,
                                                                  true,
                                                                  false,
                                                                  null);

            MessageBox.Show(bdt.Count.ToString());

            return;
            //////////MessageBox.Show(WDDayClass.LastTradeDay(gb.w,"002161.SZ",DateTime.Today).ToShortDateString());
            //////////return;
            //////////BaseDataTable dt = CommWDToolClass.GetBaseSerialData(gb.w, "000002.SZ", Convert.ToDateTime("2015/12/7"), Convert.ToDateTime("2016/7/7"));
            //////////if (dt != null)
            //////////{
            //////////    MessageBox.Show(string.Format("交易日数量:{0},股票实际交易日:{1}",dt.Count,dt.AvaliableData.Count));
            //////////    ////MTable tab = ret.Result;
            //////////    ////tab.Union(bret.Result);
            //////////    ////MACDTable mtab = new MACDTable(tab.GetTable());
            //////////    ////MessageBox.Show(mtab[0].ToClassInfo());
            //////////    //MessageBox.Show(new BaseDataTable(ret.Result)[5].IsST(DateTime.Today).ToString());
            //////////}
        }
Beispiel #4
0
        private void btn_query_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)
            {
                return;
            }
            if (mt.Count == 0)
            {
                statusStrip1.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.Beyond,
                                                               false,
                                                               txt_Content.Text);
            DataTable fdt = tmp.GetTable();

            this.dataGridView1.DataSource = fdt;
            dataGridView1.Tag             = fdt;
            dataGridView1.Show();
            this.Cursor = Cursors.Default;
        }
Beispiel #5
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;
        }