Пример #1
0
        /// <summary>
        /// 关闭交易
        /// </summary>
        public void closeTrade()
        {
            if (socketWorker != null)
            {
                socketWorker.closeTrade();
            }

            runStatus = EnumRunStatus.已停止;
            pOut.RealClose();
            pOut = null;
            thread.Abort();
            tradeStop = true;
        }
Пример #2
0
        private void 开启ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (strategyList.SelectedItems.Count != 1)
            {
                return;
            }

            string uid        = strategyList.SelectedItems[0].SubItems[3].Text;
            string coinsymbol = strategyList.SelectedItems[0].SubItems[4].Text;
            bool   isHave     = false;

            for (int i = 0; i < symbols.Length; i++)
            {
                string coinsy = symbols[i].coinSymbol;
                if (coinsy == coinsymbol)
                {
                    isHave = true;
                    break;
                }
            }
            if (!isHave)
            {
                MessageBox.Show("不存在的交易品种,无法启动");
                return;
            }

            foreach (var v in baseList)
            {
                if (uid == v.userId + "")
                {
                    if (v.runStatus == EnumRunStatus.运行中)
                    {
                        MessageBox.Show("已在运行中");
                        return;
                    }
                }
            }
            SYBase bs = new SYStrategy();
            OutPut ot = new OutPut();

            ot.uid        = uid;
            ot.coinSymbol = coinsymbol;

            bs.setPrintDlg(ot);
            // 启动
            bs.Start(uid, coinsymbol);
            strategyList.SelectedItems[0].SubItems[5].Text = EnumRunStatus.运行中.ToString();
            baseList.Add(bs);
        }
Пример #3
0
 public void setOutPut(OutPut _op)
 {
     pOut = _op;
     pOut.Show();
 }
Пример #4
0
 public void setPrintDlg(OutPut _op)
 {
     pOut = _op;
 }