예제 #1
0
        public static void loadmodel()
        {
            string strpath = FormLoadModel.getfilename();

            string info = "";

            StreamReader sr = new StreamReader(strpath, Encoding.Unicode, true);

            //涨停板股票卖出策略#涨停板股票卖出策略1#1;222;222.0000;22.00;22.00;222.00;0;3;1,;#0.0000#

            while (!sr.EndOfStream)
            {
                info = sr.ReadLine();

                if (info != "")
                {
                    string[] v = info.Split('#');

                    if (v.Length < 3)
                    {
                        continue;
                    }

                    modelAll.Add(v[1], info);
                }
            }

            sr.Close();
        }
예제 #2
0
        public void save()
        {
            string strpath = FormLoadModel.getfilename();

            StreamWriter sw = new StreamWriter(strpath, false, Encoding.Unicode);

            Dictionary <string, string> .ValueCollection valueColAll = modelAll.Values;

            foreach (string value in valueColAll)
            {
                sw.WriteLine(value);
            }


            sw.Flush();

            sw.Close();
        }
예제 #3
0
        private void 加载模型ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            formmodelrun.timer1.Enabled = false;

            FormLoadModel lm = new FormLoadModel();

            if (lm.sm == null)
            {
                lm.sm = stragegymanager;
            }

            lm.loadstrategy = new delegate_AddRunStrategy(axHSQuanTrade1.AddRunStrategy);

            lm.trans = new delete_init(axHSQuanTrade1.Init);

            if (lm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
            }



            formmodelrun.timer1.Enabled = true;
        }