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(); }
private TableLayoutPanel createInternalTable(string text1, string text2, int lengthOfLine) { DoubleBufferedTableLayoutPanel tbl = new DoubleBufferedTableLayoutPanel(); tbl.Dock = DockStyle.Fill; tbl.AutoSize = tlpRecords.AutoSize; tbl.ColumnCount = 1; tbl.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, lengthOfLine)); tbl.AutoSizeMode = tlpRecords.AutoSizeMode; tbl.GrowStyle = TableLayoutPanelGrowStyle.AddRows; tbl.Controls.Add(CreateColumn(text1), 0, 0); tbl.Controls.Add(CreateLineColumn(lengthOfLine), 0, 1); tbl.Controls.Add(CreateColumn(text2), 0, 2); tbl.AutoSize = true; tbl.CellBorderStyle = TableLayoutPanelCellBorderStyle.None; tbl.Margin = new Padding(0); return(tbl); }