Ejemplo n.º 1
0
        private void StartProgress()
        {
            using Progress pro = new Progress();
            IScalar sc = new ScalarKospi200();

            new Task(() => StartBackTesting(sc, pro, string.Concat(Path.Combine(Environment.CurrentDirectory, @"..\"), @"\Statistics\", DateTime.Now.Hour > 23 || DateTime.Now.Hour < 9 ? DateTime.Now.AddDays(-1).ToString("yyMMdd") : DateTime.Now.ToString("yyMMdd"), ".csv"), string.Concat(Path.Combine(Environment.CurrentDirectory, @"..\"), @"\Log\", DateTime.Now.Hour > 23 || DateTime.Now.Hour < 9 ? DateTime.Now.AddDays(-1).ToString("yyMMdd") : DateTime.Now.ToString("yyMMdd"), @"\"))).Start();
            Size          = new Size(5, 5);
            StartPosition = FormStartPosition.Manual;
            Location      = new Point(1, 1010);
            DoubleBufferedTableLayoutPanel db = new DoubleBufferedTableLayoutPanel
            {
                ColumnCount = 1,
                RowCount    = 1,
                AutoSize    = true,
                Margin      = new Padding(0),
                Dock        = DockStyle.Fill,
            };

            pro.Dock = DockStyle.Fill;
            db.Controls.Add(pro);
            Controls.Add(db);
            SendRate += pro.Rate;
            SendRate?.Invoke(this, new Rate(Enum.GetValues(typeof(IStopLossAndRevenue.StopLossAndRevenue)).Length *sc.StopLoss.Length *sc.Revenue.Length *sc.Reaction.Length *sc.ShortMinutePeriod.Length *sc.ShortDayPeriod.Length *sc.LongMinutePeriod.Length *sc.LongDayPeriod.Length));
            ShowDialog();
        }
Ejemplo n.º 2
0
        private string[] ChooseResult(DialogResult result)
        {
            if (result.Equals(DialogResult.Yes))
            {
                using ChooseAnalysis ca = new ChooseAnalysis();
                Size = new Size(5, 5);
                panel.Controls.Add(ca);
                ca.Dock       = DockStyle.Fill;
                StartPosition = FormStartPosition.CenterScreen;
                ca.SendQuit  += OnReceiveDialogClose;
                ShowDialog();

                return(ca.TempText.Split('.'));
            }
            else if (result.Equals(DialogResult.No))
            {
                using Progress pro = new Progress();
                Size          = new Size(5, 5);
                StartPosition = FormStartPosition.Manual;
                Location      = new Point(1, 1010);
                panel.Controls.Add(pro);
                pro.Dock  = DockStyle.Fill;
                SendRate += pro.Rate;
                new Task(() => BackTesting(pro, string.Concat(Environment.CurrentDirectory, @"\Statistics\", DateTime.Now.Hour > 23 || DateTime.Now.Hour < 9 ? DateTime.Now.AddDays(-1).ToString("yyMMdd") : DateTime.Now.ToString("yyMMdd"), ".csv"), string.Concat(Environment.CurrentDirectory, @"\Log\", DateTime.Now.Hour > 23 || DateTime.Now.Hour < 9 ? DateTime.Now.AddDays(-1).ToString("yyMMdd") : DateTime.Now.ToString("yyMMdd"), @"\"))).Start();
                SendRate?.Invoke(this, new ProgressRate(Reaction * smp.Length * sdp.Length * lmp.Length * ldp.Length));
                ShowDialog();
            }
            Dispose();
            Environment.Exit(0);

            return(null);
        }
Ejemplo n.º 3
0
        private string[] ChooseResult(DialogResult result)
        {
            if (result.Equals(DialogResult.Yes))
            {
                using ChooseAnalysis ca = new ChooseAnalysis();
                Size = new Size(5, 5);
                tableLayoutPanel.RowStyles.Clear();
                tableLayoutPanel.Controls.Add(webBrowser, 0, tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 0)));
                tableLayoutPanel.Controls.Add(panel, 0, tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100)));
                panel.Controls.Add(ca);
                ca.Dock      = DockStyle.Fill;
                ca.SendQuit += OnReceiveDialogClose;
                ShowDialog();

                return(ca.TempText.Split('.'));
            }
            else if (result.Equals(DialogResult.No))
            {
                using Progress pro = new Progress();
                tableLayoutPanel.RowStyles.Clear();
                tableLayoutPanel.Controls.Add(webBrowser, 0, tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 70)));
                tableLayoutPanel.Controls.Add(panel, 0, tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 31)));
                panel.Controls.Add(pro);
                pro.Dock          = DockStyle.Fill;
                panel.BorderStyle = BorderStyle.None;
                WindowState       = FormWindowState.Maximized;
                webBrowser.Show();
                SendRate += pro.Rate;
                new Task(() => BackTesting(pro, string.Concat(Environment.CurrentDirectory, @"\Statistics\", DateTime.Now.Hour > 23 || DateTime.Now.Hour < 9 ? DateTime.Now.AddDays(-1).ToString("yyMMdd") : DateTime.Now.ToString("yyMMdd"), ".csv"), string.Concat(Environment.CurrentDirectory, @"\Log\", DateTime.Now.Hour > 23 || DateTime.Now.Hour < 9 ? DateTime.Now.AddDays(-1).ToString("yyMMdd") : DateTime.Now.ToString("yyMMdd"), @"\"))).Start();
                SendRate?.Invoke(this, new ProgressRate(Reaction * smp.Length * sdp.Length * lmp.Length * ldp.Length));
                ShowDialog();
            }
            Dispose();
            Environment.Exit(0);

            return(null);
        }