Example #1
0
 private void ContinueBackTest()
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new ContinueBackTestDelegate(ContinueBackTest));
     }
     else
     {
         GridRowTag         grt  = (GridRowTag)grid_stocks.Rows[currentBackTestCount].Tag;
         string             name = this.grid_stocks.Rows[currentBackTestCount].Cells[3].Value.ToString();
         frm_BackTestResult frm  = new frm_BackTestResult(grt.si, grt.assembly, grt.parameter);
         frm.Test_Finished += frm_Test_Finished;
         frm.Text           = string.Format("{0}-{1}-{2}", grt.si.Code, grt.si.Name, name);
         frm.Show();
     }
 }
Example #2
0
 private void StartBackTest(int count)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new StartBackTestDelegate(StartBackTest), new object[] { count });
     }
     else
     {
         for (int i = 0; i < count; i++)
         {
             if (i < totalBackTestCount)
             {
                 GridRowTag         grt  = (GridRowTag)grid_stocks.Rows[i].Tag;
                 string             name = this.grid_stocks.Rows[i].Cells[3].Value.ToString();
                 frm_BackTestResult frm  = new frm_BackTestResult(grt.si, grt.assembly, grt.parameter);
                 frm.Test_Finished += frm_Test_Finished;
                 frm.Text           = string.Format("{0}-{1}-{2}", grt.si.Code, grt.si.Name, name);
                 frm.Show();
             }
         }
     }
 }
Example #3
0
        private void bt_add_Click(object sender, EventArgs e)
        {
            string policyname;

            try
            {
                policyname = this.cb_policy.SelectedItem.ToString();
            }
            catch
            {
                policyname = string.Empty;
            }
            if (policyname == string.Empty)
            {
                MessageBox.Show("请选择策略名称", "错误");
                return;
            }
            string code = string.Empty;

            code = this.comboBox2.Text.Trim();

            if (code == string.Empty)
            {
                MessageBox.Show(this, "请输入股票代码", "错误");
            }
            List <SecurityInfo> lists = GlobalValue.GetFutureByCode(code);

            if (lists.Count == 0)
            {
                MessageBox.Show("找不到股票代码");
                return;
            }

            if (lists.Count == 1)
            {
                si = lists[0];
            }
            else
            {
                uc_StockSelect uc_select = new uc_StockSelect();
                uc_select.Top  = this.comboBox2.Top + this.comboBox2.Height;
                uc_select.Left = this.comboBox2.Left;
                this.Controls.Add(uc_select);
                uc_select.BringToFront();
                uc_select.DataSource = lists;
                uc_select.DataBind();
                uc_select.Show();
                uc_select.Focus();
                uc_select.Stock_Selected += uc_select_Stock_Selected;
                uc_select.Leave          += uc_select_Leave;
            }
            GridRowTag grt   = new GridRowTag(assembly, this.propertyGrid1.SelectedObject, si);
            int        index = this.grid_stocks.Rows.Add();

            this.grid_stocks.Rows[index].Cells[0].Value = si.Code;
            this.grid_stocks.Rows[index].Cells[1].Value = si.Name;
            this.grid_stocks.Rows[index].Cells[2].Value = si.Market;
            this.grid_stocks.Rows[index].Cells[3].Value = policyname;
            this.grid_stocks.Rows[index].Cells[4].Value = "删除";
            this.grid_stocks.Rows[index].Tag            = grt;
            cb_policy_SelectedIndexChanged(this, new EventArgs());
        }