diff --git a/AutoSeller.Designer.cs b/AutoSeller.Designer.cs index 60ed410..8237049 100644 --- a/AutoSeller.Designer.cs +++ b/AutoSeller.Designer.cs @@ -36,35 +36,6 @@ this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer3 = new System.Windows.Forms.SplitContainer(); - this.tbLog = new System.Windows.Forms.RichTextBox(); - this.btUpdate = new MaterialSkin.Controls.MaterialRaisedButton(); - this.btCybos = new MaterialSkin.Controls.MaterialRaisedButton(); - this.tabPage2 = new System.Windows.Forms.TabPage(); - this.materialLabel7 = new MaterialSkin.Controls.MaterialLabel(); - this.tbTrailingCnt = new MaterialSkin.Controls.MaterialSingleLineTextField(); - this.materialLabel6 = new MaterialSkin.Controls.MaterialLabel(); - this.tbTrailingP = new MaterialSkin.Controls.MaterialSingleLineTextField(); - this.materialLabel5 = new MaterialSkin.Controls.MaterialLabel(); - this.materialLabel4 = new MaterialSkin.Controls.MaterialLabel(); - this.materialLabel3 = new MaterialSkin.Controls.MaterialLabel(); - this.materialLabel2 = new MaterialSkin.Controls.MaterialLabel(); - this.tbBidCount = new MaterialSkin.Controls.MaterialSingleLineTextField(); - this.materialLabel1 = new MaterialSkin.Controls.MaterialLabel(); - this.btApply = new MaterialSkin.Controls.MaterialFlatButton(); - this.tbSubAccount = new MaterialSkin.Controls.MaterialSingleLineTextField(); - this.cbAccount = new System.Windows.Forms.ComboBox(); - this.tabPage3 = new System.Windows.Forms.TabPage(); - this.cbSMMethod = new System.Windows.Forms.ComboBox(); - this.tbSMListSize = new System.Windows.Forms.TextBox(); - this.tbSMSlowUpCnt = new System.Windows.Forms.TextBox(); - this.tbSMSlowSD = new System.Windows.Forms.TextBox(); - this.tbSMFastUpCnt = new System.Windows.Forms.TextBox(); - this.tbSMFastSD = new System.Windows.Forms.TextBox(); - this.tbSimulationLog = new System.Windows.Forms.RichTextBox(); - this.btSimulate = new MaterialSkin.Controls.MaterialFlatButton(); - this.btLoad = new MaterialSkin.Controls.MaterialFlatButton(); - this.tbSMFastDownCnt = new System.Windows.Forms.TextBox(); - this.tbSMSlowDownCnt = new System.Windows.Forms.TextBox(); this.lvItems = new AutoSellerNS.ListViewNF(); this.chCode = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.chCodeName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); @@ -83,11 +54,40 @@ this.chNCType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.chNCPrice = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.chNCCount = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.tbLog = new System.Windows.Forms.RichTextBox(); this.lvCurPrice = new AutoSellerNS.ListViewNF(); this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.chAskCount = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.chCallPrice = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.chBidCount = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.btUpdate = new MaterialSkin.Controls.MaterialRaisedButton(); + this.btCybos = new MaterialSkin.Controls.MaterialRaisedButton(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.materialLabel7 = new MaterialSkin.Controls.MaterialLabel(); + this.tbTrailingCnt = new MaterialSkin.Controls.MaterialSingleLineTextField(); + this.materialLabel6 = new MaterialSkin.Controls.MaterialLabel(); + this.tbTrailingP = new MaterialSkin.Controls.MaterialSingleLineTextField(); + this.materialLabel5 = new MaterialSkin.Controls.MaterialLabel(); + this.materialLabel4 = new MaterialSkin.Controls.MaterialLabel(); + this.materialLabel3 = new MaterialSkin.Controls.MaterialLabel(); + this.materialLabel2 = new MaterialSkin.Controls.MaterialLabel(); + this.tbBidCount = new MaterialSkin.Controls.MaterialSingleLineTextField(); + this.materialLabel1 = new MaterialSkin.Controls.MaterialLabel(); + this.btApply = new MaterialSkin.Controls.MaterialFlatButton(); + this.tbSubAccount = new MaterialSkin.Controls.MaterialSingleLineTextField(); + this.cbAccount = new System.Windows.Forms.ComboBox(); + this.tabPage3 = new System.Windows.Forms.TabPage(); + this.tbSMSlowDownCnt = new System.Windows.Forms.TextBox(); + this.tbSMFastDownCnt = new System.Windows.Forms.TextBox(); + this.cbSMMethod = new System.Windows.Forms.ComboBox(); + this.tbSMListSize = new System.Windows.Forms.TextBox(); + this.tbSMSlowUpCnt = new System.Windows.Forms.TextBox(); + this.tbSMSlowSD = new System.Windows.Forms.TextBox(); + this.tbSMFastUpCnt = new System.Windows.Forms.TextBox(); + this.tbSMFastSD = new System.Windows.Forms.TextBox(); + this.tbSimulationLog = new System.Windows.Forms.RichTextBox(); + this.btSimulate = new MaterialSkin.Controls.MaterialFlatButton(); + this.btLoad = new MaterialSkin.Controls.MaterialFlatButton(); this.materialTabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); @@ -109,7 +109,7 @@ // materialTabSelector1 // this.materialTabSelector1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + | System.Windows.Forms.AnchorStyles.Right))); this.materialTabSelector1.BaseTabControl = this.materialTabControl1; this.materialTabSelector1.Depth = 0; this.materialTabSelector1.Location = new System.Drawing.Point(0, 64); @@ -122,8 +122,8 @@ // materialTabControl1 // this.materialTabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.materialTabControl1.Controls.Add(this.tabPage1); this.materialTabControl1.Controls.Add(this.tabPage2); this.materialTabControl1.Controls.Add(this.tabPage3); @@ -166,8 +166,8 @@ // splitContainer2 // this.splitContainer2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.splitContainer2.IsSplitterFixed = true; this.splitContainer2.Location = new System.Drawing.Point(3, 34); this.splitContainer2.Name = "splitContainer2"; @@ -220,394 +220,20 @@ this.splitContainer3.SplitterDistance = 300; this.splitContainer3.TabIndex = 1; // - // tbLog - // - this.tbLog.Dock = System.Windows.Forms.DockStyle.Fill; - this.tbLog.Location = new System.Drawing.Point(0, 0); - this.tbLog.Name = "tbLog"; - this.tbLog.Size = new System.Drawing.Size(804, 196); - this.tbLog.TabIndex = 0; - this.tbLog.Text = ""; - // - // btUpdate - // - this.btUpdate.AutoSize = true; - this.btUpdate.Depth = 0; - this.btUpdate.Location = new System.Drawing.Point(74, 3); - this.btUpdate.MouseState = MaterialSkin.MouseState.HOVER; - this.btUpdate.Name = "btUpdate"; - this.btUpdate.Primary = true; - this.btUpdate.Size = new System.Drawing.Size(68, 28); - this.btUpdate.TabIndex = 3; - this.btUpdate.Text = "Update"; - this.btUpdate.UseVisualStyleBackColor = true; - this.btUpdate.Click += new System.EventHandler(this.btUpdate_Click); - // - // btCybos - // - this.btCybos.AutoSize = true; - this.btCybos.Depth = 0; - this.btCybos.Location = new System.Drawing.Point(3, 3); - this.btCybos.MouseState = MaterialSkin.MouseState.HOVER; - this.btCybos.Name = "btCybos"; - this.btCybos.Primary = true; - this.btCybos.Size = new System.Drawing.Size(66, 28); - this.btCybos.TabIndex = 3; - this.btCybos.Text = "Cybos"; - this.btCybos.UseVisualStyleBackColor = true; - this.btCybos.Click += new System.EventHandler(this.btCybos_Click); - // - // tabPage2 - // - this.tabPage2.BackColor = System.Drawing.Color.White; - this.tabPage2.Controls.Add(this.materialLabel7); - this.tabPage2.Controls.Add(this.tbTrailingCnt); - this.tabPage2.Controls.Add(this.materialLabel6); - this.tabPage2.Controls.Add(this.tbTrailingP); - this.tabPage2.Controls.Add(this.materialLabel5); - this.tabPage2.Controls.Add(this.materialLabel4); - this.tabPage2.Controls.Add(this.materialLabel3); - this.tabPage2.Controls.Add(this.materialLabel2); - this.tabPage2.Controls.Add(this.tbBidCount); - this.tabPage2.Controls.Add(this.materialLabel1); - this.tabPage2.Controls.Add(this.btApply); - this.tabPage2.Controls.Add(this.tbSubAccount); - this.tabPage2.Controls.Add(this.cbAccount); - this.tabPage2.Location = new System.Drawing.Point(4, 22); - this.tabPage2.Name = "tabPage2"; - this.tabPage2.Padding = new System.Windows.Forms.Padding(3); - this.tabPage2.Size = new System.Drawing.Size(1060, 693); - this.tabPage2.TabIndex = 1; - this.tabPage2.Text = "Preference"; - // - // materialLabel7 - // - this.materialLabel7.AutoSize = true; - this.materialLabel7.Depth = 0; - this.materialLabel7.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); - this.materialLabel7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.materialLabel7.Location = new System.Drawing.Point(224, 229); - this.materialLabel7.MouseState = MaterialSkin.MouseState.HOVER; - this.materialLabel7.Name = "materialLabel7"; - this.materialLabel7.Size = new System.Drawing.Size(21, 18); - this.materialLabel7.TabIndex = 12; - this.materialLabel7.Text = "회"; - // - // tbTrailingCnt - // - this.tbTrailingCnt.Depth = 0; - this.tbTrailingCnt.Hint = ""; - this.tbTrailingCnt.Location = new System.Drawing.Point(188, 225); - this.tbTrailingCnt.MouseState = MaterialSkin.MouseState.HOVER; - this.tbTrailingCnt.Name = "tbTrailingCnt"; - this.tbTrailingCnt.PasswordChar = '\0'; - this.tbTrailingCnt.SelectedText = ""; - this.tbTrailingCnt.SelectionLength = 0; - this.tbTrailingCnt.SelectionStart = 0; - this.tbTrailingCnt.Size = new System.Drawing.Size(30, 23); - this.tbTrailingCnt.TabIndex = 11; - this.tbTrailingCnt.Text = "2"; - this.tbTrailingCnt.UseSystemPasswordChar = false; - // - // materialLabel6 - // - this.materialLabel6.AutoSize = true; - this.materialLabel6.Depth = 0; - this.materialLabel6.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); - this.materialLabel6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.materialLabel6.Location = new System.Drawing.Point(152, 229); - this.materialLabel6.MouseState = MaterialSkin.MouseState.HOVER; - this.materialLabel6.Name = "materialLabel6"; - this.materialLabel6.Size = new System.Drawing.Size(21, 18); - this.materialLabel6.TabIndex = 10; - this.materialLabel6.Text = "%"; - // - // tbTrailingP - // - this.tbTrailingP.Depth = 0; - this.tbTrailingP.Hint = ""; - this.tbTrailingP.Location = new System.Drawing.Point(116, 225); - this.tbTrailingP.MouseState = MaterialSkin.MouseState.HOVER; - this.tbTrailingP.Name = "tbTrailingP"; - this.tbTrailingP.PasswordChar = '\0'; - this.tbTrailingP.SelectedText = ""; - this.tbTrailingP.SelectionLength = 0; - this.tbTrailingP.SelectionStart = 0; - this.tbTrailingP.Size = new System.Drawing.Size(30, 23); - this.tbTrailingP.TabIndex = 9; - this.tbTrailingP.Text = "1.0"; - this.tbTrailingP.UseSystemPasswordChar = false; - // - // materialLabel5 - // - this.materialLabel5.AutoSize = true; - this.materialLabel5.Depth = 0; - this.materialLabel5.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); - this.materialLabel5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.materialLabel5.Location = new System.Drawing.Point(25, 229); - this.materialLabel5.MouseState = MaterialSkin.MouseState.HOVER; - this.materialLabel5.Name = "materialLabel5"; - this.materialLabel5.Size = new System.Drawing.Size(77, 18); - this.materialLabel5.TabIndex = 8; - this.materialLabel5.Text = "최고가 대비"; - // - // materialLabel4 - // - this.materialLabel4.AutoSize = true; - this.materialLabel4.Depth = 0; - this.materialLabel4.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); - this.materialLabel4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.materialLabel4.Location = new System.Drawing.Point(25, 144); - this.materialLabel4.MouseState = MaterialSkin.MouseState.HOVER; - this.materialLabel4.Name = "materialLabel4"; - this.materialLabel4.Size = new System.Drawing.Size(64, 18); - this.materialLabel4.TabIndex = 7; - this.materialLabel4.Text = "조건 횟수"; - // - // materialLabel3 - // - this.materialLabel3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.materialLabel3.AutoSize = true; - this.materialLabel3.Depth = 0; - this.materialLabel3.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); - this.materialLabel3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.materialLabel3.Location = new System.Drawing.Point(6, 671); - this.materialLabel3.MouseState = MaterialSkin.MouseState.HOVER; - this.materialLabel3.Name = "materialLabel3"; - this.materialLabel3.Size = new System.Drawing.Size(162, 18); - this.materialLabel3.TabIndex = 6; - this.materialLabel3.Text = "Version : 2017.02.20.12"; - // - // materialLabel2 - // - this.materialLabel2.AutoSize = true; - this.materialLabel2.Depth = 0; - this.materialLabel2.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); - this.materialLabel2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.materialLabel2.Location = new System.Drawing.Point(152, 148); - this.materialLabel2.MouseState = MaterialSkin.MouseState.HOVER; - this.materialLabel2.Name = "materialLabel2"; - this.materialLabel2.Size = new System.Drawing.Size(21, 18); - this.materialLabel2.TabIndex = 5; - this.materialLabel2.Text = "회"; - // - // tbBidCount - // - this.tbBidCount.Depth = 0; - this.tbBidCount.Hint = ""; - this.tbBidCount.Location = new System.Drawing.Point(116, 144); - this.tbBidCount.MouseState = MaterialSkin.MouseState.HOVER; - this.tbBidCount.Name = "tbBidCount"; - this.tbBidCount.PasswordChar = '\0'; - this.tbBidCount.SelectedText = ""; - this.tbBidCount.SelectionLength = 0; - this.tbBidCount.SelectionStart = 0; - this.tbBidCount.Size = new System.Drawing.Size(30, 23); - this.tbBidCount.TabIndex = 4; - this.tbBidCount.Text = "5"; - this.tbBidCount.UseSystemPasswordChar = false; - // - // materialLabel1 - // - this.materialLabel1.AutoSize = true; - this.materialLabel1.Depth = 0; - this.materialLabel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); - this.materialLabel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.materialLabel1.Location = new System.Drawing.Point(25, 29); - this.materialLabel1.MouseState = MaterialSkin.MouseState.HOVER; - this.materialLabel1.Name = "materialLabel1"; - this.materialLabel1.Size = new System.Drawing.Size(62, 18); - this.materialLabel1.TabIndex = 3; - this.materialLabel1.Text = "Account"; - // - // btApply - // - this.btApply.AutoSize = true; - this.btApply.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.btApply.Depth = 0; - this.btApply.Location = new System.Drawing.Point(844, 483); - this.btApply.Margin = new System.Windows.Forms.Padding(4, 6, 4, 6); - this.btApply.MinimumSize = new System.Drawing.Size(120, 36); - this.btApply.MouseState = MaterialSkin.MouseState.HOVER; - this.btApply.Name = "btApply"; - this.btApply.Primary = false; - this.btApply.Size = new System.Drawing.Size(120, 36); - this.btApply.TabIndex = 2; - this.btApply.Text = "적용하기"; - this.btApply.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.btApply.UseVisualStyleBackColor = true; - this.btApply.Click += new System.EventHandler(this.btApply_Click); - // - // tbSubAccount - // - this.tbSubAccount.Depth = 0; - this.tbSubAccount.Hint = ""; - this.tbSubAccount.Location = new System.Drawing.Point(154, 62); - this.tbSubAccount.MouseState = MaterialSkin.MouseState.HOVER; - this.tbSubAccount.Name = "tbSubAccount"; - this.tbSubAccount.PasswordChar = '\0'; - this.tbSubAccount.SelectedText = ""; - this.tbSubAccount.SelectionLength = 0; - this.tbSubAccount.SelectionStart = 0; - this.tbSubAccount.Size = new System.Drawing.Size(25, 23); - this.tbSubAccount.TabIndex = 1; - this.tbSubAccount.Text = "10"; - this.tbSubAccount.UseSystemPasswordChar = false; - // - // cbAccount - // - this.cbAccount.FormattingEnabled = true; - this.cbAccount.Location = new System.Drawing.Point(25, 62); - this.cbAccount.Name = "cbAccount"; - this.cbAccount.Size = new System.Drawing.Size(121, 20); - this.cbAccount.TabIndex = 0; - // - // tabPage3 - // - this.tabPage3.Controls.Add(this.tbSMSlowDownCnt); - this.tabPage3.Controls.Add(this.tbSMFastDownCnt); - this.tabPage3.Controls.Add(this.cbSMMethod); - this.tabPage3.Controls.Add(this.tbSMListSize); - this.tabPage3.Controls.Add(this.tbSMSlowUpCnt); - this.tabPage3.Controls.Add(this.tbSMSlowSD); - this.tabPage3.Controls.Add(this.tbSMFastUpCnt); - this.tabPage3.Controls.Add(this.tbSMFastSD); - this.tabPage3.Controls.Add(this.tbSimulationLog); - this.tabPage3.Controls.Add(this.btSimulate); - this.tabPage3.Controls.Add(this.btLoad); - this.tabPage3.Location = new System.Drawing.Point(4, 22); - this.tabPage3.Name = "tabPage3"; - this.tabPage3.Padding = new System.Windows.Forms.Padding(3); - this.tabPage3.Size = new System.Drawing.Size(1060, 693); - this.tabPage3.TabIndex = 2; - this.tabPage3.Text = "Simulation"; - this.tabPage3.UseVisualStyleBackColor = true; - // - // cbSMMethod - // - this.cbSMMethod.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbSMMethod.FormattingEnabled = true; - this.cbSMMethod.Items.AddRange(new object[] { - "평균 비교", - "마지막 비교"}); - this.cbSMMethod.Location = new System.Drawing.Point(477, 24); - this.cbSMMethod.Name = "cbSMMethod"; - this.cbSMMethod.Size = new System.Drawing.Size(121, 20); - this.cbSMMethod.TabIndex = 9; - // - // tbSMListSize - // - this.tbSMListSize.Location = new System.Drawing.Point(333, 20); - this.tbSMListSize.Name = "tbSMListSize"; - this.tbSMListSize.Size = new System.Drawing.Size(36, 21); - this.tbSMListSize.TabIndex = 3; - this.tbSMListSize.Text = "20"; - // - // tbSMSlowUpCnt - // - this.tbSMSlowUpCnt.Location = new System.Drawing.Point(375, 74); - this.tbSMSlowUpCnt.Name = "tbSMSlowUpCnt"; - this.tbSMSlowUpCnt.Size = new System.Drawing.Size(36, 21); - this.tbSMSlowUpCnt.TabIndex = 7; - this.tbSMSlowUpCnt.Text = "0.1"; - // - // tbSMSlowSD - // - this.tbSMSlowSD.Location = new System.Drawing.Point(333, 74); - this.tbSMSlowSD.Name = "tbSMSlowSD"; - this.tbSMSlowSD.Size = new System.Drawing.Size(36, 21); - this.tbSMSlowSD.TabIndex = 6; - this.tbSMSlowSD.Text = "0.2"; - // - // tbSMFastUpCnt - // - this.tbSMFastUpCnt.Location = new System.Drawing.Point(375, 47); - this.tbSMFastUpCnt.Name = "tbSMFastUpCnt"; - this.tbSMFastUpCnt.Size = new System.Drawing.Size(36, 21); - this.tbSMFastUpCnt.TabIndex = 5; - this.tbSMFastUpCnt.Text = "0.3"; - // - // tbSMFastSD - // - this.tbSMFastSD.Location = new System.Drawing.Point(333, 47); - this.tbSMFastSD.Name = "tbSMFastSD"; - this.tbSMFastSD.Size = new System.Drawing.Size(36, 21); - this.tbSMFastSD.TabIndex = 4; - this.tbSMFastSD.Text = "0.75"; - // - // tbSimulationLog - // - this.tbSimulationLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tbSimulationLog.Location = new System.Drawing.Point(0, 204); - this.tbSimulationLog.Name = "tbSimulationLog"; - this.tbSimulationLog.Size = new System.Drawing.Size(1060, 489); - this.tbSimulationLog.TabIndex = 2; - this.tbSimulationLog.Text = ""; - // - // btSimulate - // - this.btSimulate.AutoSize = true; - this.btSimulate.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.btSimulate.Depth = 0; - this.btSimulate.Location = new System.Drawing.Point(44, 95); - this.btSimulate.Margin = new System.Windows.Forms.Padding(4, 6, 4, 6); - this.btSimulate.MouseState = MaterialSkin.MouseState.HOVER; - this.btSimulate.Name = "btSimulate"; - this.btSimulate.Primary = false; - this.btSimulate.Size = new System.Drawing.Size(139, 36); - this.btSimulate.TabIndex = 1; - this.btSimulate.Text = "simulation start"; - this.btSimulate.UseVisualStyleBackColor = true; - this.btSimulate.Click += new System.EventHandler(this.btSimulate_Click); - // - // btLoad - // - this.btLoad.AutoSize = true; - this.btLoad.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.btLoad.Depth = 0; - this.btLoad.Location = new System.Drawing.Point(44, 47); - this.btLoad.Margin = new System.Windows.Forms.Padding(4, 6, 4, 6); - this.btLoad.MouseState = MaterialSkin.MouseState.HOVER; - this.btLoad.Name = "btLoad"; - this.btLoad.Primary = false; - this.btLoad.Size = new System.Drawing.Size(86, 36); - this.btLoad.TabIndex = 0; - this.btLoad.Text = "Load data"; - this.btLoad.UseVisualStyleBackColor = true; - this.btLoad.Click += new System.EventHandler(this.btLoad_Click); - // - // tbSMFastDownCnt - // - this.tbSMFastDownCnt.Location = new System.Drawing.Point(417, 47); - this.tbSMFastDownCnt.Name = "tbSMFastDownCnt"; - this.tbSMFastDownCnt.Size = new System.Drawing.Size(36, 21); - this.tbSMFastDownCnt.TabIndex = 6; - this.tbSMFastDownCnt.Text = "0.3"; - // - // tbSMSlowDownCnt - // - this.tbSMSlowDownCnt.Location = new System.Drawing.Point(417, 74); - this.tbSMSlowDownCnt.Name = "tbSMSlowDownCnt"; - this.tbSMSlowDownCnt.Size = new System.Drawing.Size(36, 21); - this.tbSMSlowDownCnt.TabIndex = 8; - this.tbSMSlowDownCnt.Text = "0.1"; - // // lvItems // this.lvItems.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.chCode, - this.chCodeName, - this.chCurPrice, - this.chCount, - this.chBookValue, - this.chCapitalGains, - this.chAssessedValue, - this.chValuation, - this.chYield, - this.chMaxPrice, - this.chCheckCount}); + this.chCode, + this.chCodeName, + this.chCurPrice, + this.chCount, + this.chBookValue, + this.chCapitalGains, + this.chAssessedValue, + this.chValuation, + this.chYield, + this.chMaxPrice, + this.chCheckCount}); this.lvItems.Dock = System.Windows.Forms.DockStyle.Fill; this.lvItems.FullRowSelect = true; this.lvItems.GridLines = true; @@ -683,11 +309,11 @@ // lvNCItem // this.lvNCItem.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.chNCCode, - this.chNCCodeName, - this.chNCType, - this.chNCPrice, - this.chNCCount}); + this.chNCCode, + this.chNCCodeName, + this.chNCType, + this.chNCPrice, + this.chNCCount}); this.lvNCItem.Dock = System.Windows.Forms.DockStyle.Fill; this.lvNCItem.FullRowSelect = true; this.lvNCItem.GridLines = true; @@ -725,13 +351,22 @@ this.chNCCount.Text = "미체결량"; this.chNCCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; // + // tbLog + // + this.tbLog.Dock = System.Windows.Forms.DockStyle.Fill; + this.tbLog.Location = new System.Drawing.Point(0, 0); + this.tbLog.Name = "tbLog"; + this.tbLog.Size = new System.Drawing.Size(804, 196); + this.tbLog.TabIndex = 0; + this.tbLog.Text = ""; + // // lvCurPrice // this.lvCurPrice.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader1, - this.chAskCount, - this.chCallPrice, - this.chBidCount}); + this.columnHeader1, + this.chAskCount, + this.chCallPrice, + this.chBidCount}); this.lvCurPrice.Dock = System.Windows.Forms.DockStyle.Fill; this.lvCurPrice.FullRowSelect = true; this.lvCurPrice.GridLines = true; @@ -763,6 +398,371 @@ this.chBidCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.chBidCount.Width = 75; // + // btUpdate + // + this.btUpdate.AutoSize = true; + this.btUpdate.Depth = 0; + this.btUpdate.Location = new System.Drawing.Point(74, 3); + this.btUpdate.MouseState = MaterialSkin.MouseState.HOVER; + this.btUpdate.Name = "btUpdate"; + this.btUpdate.Primary = true; + this.btUpdate.Size = new System.Drawing.Size(68, 28); + this.btUpdate.TabIndex = 3; + this.btUpdate.Text = "Update"; + this.btUpdate.UseVisualStyleBackColor = true; + this.btUpdate.Click += new System.EventHandler(this.btUpdate_Click); + // + // btCybos + // + this.btCybos.AutoSize = true; + this.btCybos.Depth = 0; + this.btCybos.Location = new System.Drawing.Point(3, 3); + this.btCybos.MouseState = MaterialSkin.MouseState.HOVER; + this.btCybos.Name = "btCybos"; + this.btCybos.Primary = true; + this.btCybos.Size = new System.Drawing.Size(66, 28); + this.btCybos.TabIndex = 3; + this.btCybos.Text = "Cybos"; + this.btCybos.UseVisualStyleBackColor = true; + this.btCybos.Click += new System.EventHandler(this.btCybos_Click); + // + // tabPage2 + // + this.tabPage2.BackColor = System.Drawing.Color.White; + this.tabPage2.Controls.Add(this.materialLabel7); + this.tabPage2.Controls.Add(this.tbTrailingCnt); + this.tabPage2.Controls.Add(this.materialLabel6); + this.tabPage2.Controls.Add(this.tbTrailingP); + this.tabPage2.Controls.Add(this.materialLabel5); + this.tabPage2.Controls.Add(this.materialLabel4); + this.tabPage2.Controls.Add(this.materialLabel3); + this.tabPage2.Controls.Add(this.materialLabel2); + this.tabPage2.Controls.Add(this.tbBidCount); + this.tabPage2.Controls.Add(this.materialLabel1); + this.tabPage2.Controls.Add(this.btApply); + this.tabPage2.Controls.Add(this.tbSubAccount); + this.tabPage2.Controls.Add(this.cbAccount); + this.tabPage2.Location = new System.Drawing.Point(4, 22); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(1060, 693); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "Preference"; + // + // materialLabel7 + // + this.materialLabel7.AutoSize = true; + this.materialLabel7.Depth = 0; + this.materialLabel7.Font = new System.Drawing.Font("Roboto", 11F); + this.materialLabel7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.materialLabel7.Location = new System.Drawing.Point(224, 229); + this.materialLabel7.MouseState = MaterialSkin.MouseState.HOVER; + this.materialLabel7.Name = "materialLabel7"; + this.materialLabel7.Size = new System.Drawing.Size(20, 19); + this.materialLabel7.TabIndex = 12; + this.materialLabel7.Text = "회"; + // + // tbTrailingCnt + // + this.tbTrailingCnt.Depth = 0; + this.tbTrailingCnt.Hint = ""; + this.tbTrailingCnt.Location = new System.Drawing.Point(188, 225); + this.tbTrailingCnt.MouseState = MaterialSkin.MouseState.HOVER; + this.tbTrailingCnt.Name = "tbTrailingCnt"; + this.tbTrailingCnt.PasswordChar = '\0'; + this.tbTrailingCnt.SelectedText = ""; + this.tbTrailingCnt.SelectionLength = 0; + this.tbTrailingCnt.SelectionStart = 0; + this.tbTrailingCnt.Size = new System.Drawing.Size(30, 23); + this.tbTrailingCnt.TabIndex = 11; + this.tbTrailingCnt.Text = "2"; + this.tbTrailingCnt.UseSystemPasswordChar = false; + // + // materialLabel6 + // + this.materialLabel6.AutoSize = true; + this.materialLabel6.Depth = 0; + this.materialLabel6.Font = new System.Drawing.Font("Roboto", 11F); + this.materialLabel6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.materialLabel6.Location = new System.Drawing.Point(152, 229); + this.materialLabel6.MouseState = MaterialSkin.MouseState.HOVER; + this.materialLabel6.Name = "materialLabel6"; + this.materialLabel6.Size = new System.Drawing.Size(20, 19); + this.materialLabel6.TabIndex = 10; + this.materialLabel6.Text = "%"; + // + // tbTrailingP + // + this.tbTrailingP.Depth = 0; + this.tbTrailingP.Hint = ""; + this.tbTrailingP.Location = new System.Drawing.Point(116, 225); + this.tbTrailingP.MouseState = MaterialSkin.MouseState.HOVER; + this.tbTrailingP.Name = "tbTrailingP"; + this.tbTrailingP.PasswordChar = '\0'; + this.tbTrailingP.SelectedText = ""; + this.tbTrailingP.SelectionLength = 0; + this.tbTrailingP.SelectionStart = 0; + this.tbTrailingP.Size = new System.Drawing.Size(30, 23); + this.tbTrailingP.TabIndex = 9; + this.tbTrailingP.Text = "1.0"; + this.tbTrailingP.UseSystemPasswordChar = false; + // + // materialLabel5 + // + this.materialLabel5.AutoSize = true; + this.materialLabel5.Depth = 0; + this.materialLabel5.Font = new System.Drawing.Font("Roboto", 11F); + this.materialLabel5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.materialLabel5.Location = new System.Drawing.Point(25, 229); + this.materialLabel5.MouseState = MaterialSkin.MouseState.HOVER; + this.materialLabel5.Name = "materialLabel5"; + this.materialLabel5.Size = new System.Drawing.Size(68, 19); + this.materialLabel5.TabIndex = 8; + this.materialLabel5.Text = "최고가 대비"; + // + // materialLabel4 + // + this.materialLabel4.AutoSize = true; + this.materialLabel4.Depth = 0; + this.materialLabel4.Font = new System.Drawing.Font("Roboto", 11F); + this.materialLabel4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.materialLabel4.Location = new System.Drawing.Point(25, 144); + this.materialLabel4.MouseState = MaterialSkin.MouseState.HOVER; + this.materialLabel4.Name = "materialLabel4"; + this.materialLabel4.Size = new System.Drawing.Size(57, 19); + this.materialLabel4.TabIndex = 7; + this.materialLabel4.Text = "조건 횟수"; + // + // materialLabel3 + // + this.materialLabel3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.materialLabel3.AutoSize = true; + this.materialLabel3.Depth = 0; + this.materialLabel3.Font = new System.Drawing.Font("Roboto", 11F); + this.materialLabel3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.materialLabel3.Location = new System.Drawing.Point(6, 671); + this.materialLabel3.MouseState = MaterialSkin.MouseState.HOVER; + this.materialLabel3.Name = "materialLabel3"; + this.materialLabel3.Size = new System.Drawing.Size(165, 19); + this.materialLabel3.TabIndex = 6; + this.materialLabel3.Text = "Version : 2017.02.22.20"; + // + // materialLabel2 + // + this.materialLabel2.AutoSize = true; + this.materialLabel2.Depth = 0; + this.materialLabel2.Font = new System.Drawing.Font("Roboto", 11F); + this.materialLabel2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.materialLabel2.Location = new System.Drawing.Point(152, 148); + this.materialLabel2.MouseState = MaterialSkin.MouseState.HOVER; + this.materialLabel2.Name = "materialLabel2"; + this.materialLabel2.Size = new System.Drawing.Size(20, 19); + this.materialLabel2.TabIndex = 5; + this.materialLabel2.Text = "회"; + // + // tbBidCount + // + this.tbBidCount.Depth = 0; + this.tbBidCount.Hint = ""; + this.tbBidCount.Location = new System.Drawing.Point(116, 144); + this.tbBidCount.MouseState = MaterialSkin.MouseState.HOVER; + this.tbBidCount.Name = "tbBidCount"; + this.tbBidCount.PasswordChar = '\0'; + this.tbBidCount.SelectedText = ""; + this.tbBidCount.SelectionLength = 0; + this.tbBidCount.SelectionStart = 0; + this.tbBidCount.Size = new System.Drawing.Size(30, 23); + this.tbBidCount.TabIndex = 4; + this.tbBidCount.Text = "5"; + this.tbBidCount.UseSystemPasswordChar = false; + // + // materialLabel1 + // + this.materialLabel1.AutoSize = true; + this.materialLabel1.Depth = 0; + this.materialLabel1.Font = new System.Drawing.Font("Roboto", 11F); + this.materialLabel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.materialLabel1.Location = new System.Drawing.Point(25, 29); + this.materialLabel1.MouseState = MaterialSkin.MouseState.HOVER; + this.materialLabel1.Name = "materialLabel1"; + this.materialLabel1.Size = new System.Drawing.Size(65, 19); + this.materialLabel1.TabIndex = 3; + this.materialLabel1.Text = "Account"; + // + // btApply + // + this.btApply.AutoSize = true; + this.btApply.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btApply.Depth = 0; + this.btApply.Location = new System.Drawing.Point(844, 483); + this.btApply.Margin = new System.Windows.Forms.Padding(4, 6, 4, 6); + this.btApply.MinimumSize = new System.Drawing.Size(120, 36); + this.btApply.MouseState = MaterialSkin.MouseState.HOVER; + this.btApply.Name = "btApply"; + this.btApply.Primary = false; + this.btApply.Size = new System.Drawing.Size(120, 36); + this.btApply.TabIndex = 2; + this.btApply.Text = "적용하기"; + this.btApply.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.btApply.UseVisualStyleBackColor = true; + this.btApply.Click += new System.EventHandler(this.btApply_Click); + // + // tbSubAccount + // + this.tbSubAccount.Depth = 0; + this.tbSubAccount.Hint = ""; + this.tbSubAccount.Location = new System.Drawing.Point(154, 62); + this.tbSubAccount.MouseState = MaterialSkin.MouseState.HOVER; + this.tbSubAccount.Name = "tbSubAccount"; + this.tbSubAccount.PasswordChar = '\0'; + this.tbSubAccount.SelectedText = ""; + this.tbSubAccount.SelectionLength = 0; + this.tbSubAccount.SelectionStart = 0; + this.tbSubAccount.Size = new System.Drawing.Size(25, 23); + this.tbSubAccount.TabIndex = 1; + this.tbSubAccount.Text = "10"; + this.tbSubAccount.UseSystemPasswordChar = false; + // + // cbAccount + // + this.cbAccount.FormattingEnabled = true; + this.cbAccount.Location = new System.Drawing.Point(25, 62); + this.cbAccount.Name = "cbAccount"; + this.cbAccount.Size = new System.Drawing.Size(121, 20); + this.cbAccount.TabIndex = 0; + // + // tabPage3 + // + this.tabPage3.Controls.Add(this.tbSMSlowDownCnt); + this.tabPage3.Controls.Add(this.tbSMFastDownCnt); + this.tabPage3.Controls.Add(this.cbSMMethod); + this.tabPage3.Controls.Add(this.tbSMListSize); + this.tabPage3.Controls.Add(this.tbSMSlowUpCnt); + this.tabPage3.Controls.Add(this.tbSMSlowSD); + this.tabPage3.Controls.Add(this.tbSMFastUpCnt); + this.tabPage3.Controls.Add(this.tbSMFastSD); + this.tabPage3.Controls.Add(this.tbSimulationLog); + this.tabPage3.Controls.Add(this.btSimulate); + this.tabPage3.Controls.Add(this.btLoad); + this.tabPage3.Location = new System.Drawing.Point(4, 22); + this.tabPage3.Name = "tabPage3"; + this.tabPage3.Padding = new System.Windows.Forms.Padding(3); + this.tabPage3.Size = new System.Drawing.Size(1060, 693); + this.tabPage3.TabIndex = 2; + this.tabPage3.Text = "Simulation"; + this.tabPage3.UseVisualStyleBackColor = true; + // + // tbSMSlowDownCnt + // + this.tbSMSlowDownCnt.Location = new System.Drawing.Point(417, 74); + this.tbSMSlowDownCnt.Name = "tbSMSlowDownCnt"; + this.tbSMSlowDownCnt.Size = new System.Drawing.Size(36, 21); + this.tbSMSlowDownCnt.TabIndex = 8; + this.tbSMSlowDownCnt.Text = "0.1"; + // + // tbSMFastDownCnt + // + this.tbSMFastDownCnt.Location = new System.Drawing.Point(417, 47); + this.tbSMFastDownCnt.Name = "tbSMFastDownCnt"; + this.tbSMFastDownCnt.Size = new System.Drawing.Size(36, 21); + this.tbSMFastDownCnt.TabIndex = 6; + this.tbSMFastDownCnt.Text = "0.3"; + // + // cbSMMethod + // + this.cbSMMethod.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbSMMethod.FormattingEnabled = true; + this.cbSMMethod.Items.AddRange(new object[] { + "평균 비교", + "마지막 비교"}); + this.cbSMMethod.Location = new System.Drawing.Point(477, 24); + this.cbSMMethod.Name = "cbSMMethod"; + this.cbSMMethod.Size = new System.Drawing.Size(121, 20); + this.cbSMMethod.TabIndex = 9; + // + // tbSMListSize + // + this.tbSMListSize.Location = new System.Drawing.Point(333, 20); + this.tbSMListSize.Name = "tbSMListSize"; + this.tbSMListSize.Size = new System.Drawing.Size(36, 21); + this.tbSMListSize.TabIndex = 3; + this.tbSMListSize.Text = "20"; + // + // tbSMSlowUpCnt + // + this.tbSMSlowUpCnt.Location = new System.Drawing.Point(375, 74); + this.tbSMSlowUpCnt.Name = "tbSMSlowUpCnt"; + this.tbSMSlowUpCnt.Size = new System.Drawing.Size(36, 21); + this.tbSMSlowUpCnt.TabIndex = 7; + this.tbSMSlowUpCnt.Text = "0.1"; + // + // tbSMSlowSD + // + this.tbSMSlowSD.Location = new System.Drawing.Point(333, 74); + this.tbSMSlowSD.Name = "tbSMSlowSD"; + this.tbSMSlowSD.Size = new System.Drawing.Size(36, 21); + this.tbSMSlowSD.TabIndex = 6; + this.tbSMSlowSD.Text = "0.2"; + // + // tbSMFastUpCnt + // + this.tbSMFastUpCnt.Location = new System.Drawing.Point(375, 47); + this.tbSMFastUpCnt.Name = "tbSMFastUpCnt"; + this.tbSMFastUpCnt.Size = new System.Drawing.Size(36, 21); + this.tbSMFastUpCnt.TabIndex = 5; + this.tbSMFastUpCnt.Text = "0.3"; + // + // tbSMFastSD + // + this.tbSMFastSD.Location = new System.Drawing.Point(333, 47); + this.tbSMFastSD.Name = "tbSMFastSD"; + this.tbSMFastSD.Size = new System.Drawing.Size(36, 21); + this.tbSMFastSD.TabIndex = 4; + this.tbSMFastSD.Text = "0.75"; + // + // tbSimulationLog + // + this.tbSimulationLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbSimulationLog.Location = new System.Drawing.Point(0, 204); + this.tbSimulationLog.Name = "tbSimulationLog"; + this.tbSimulationLog.Size = new System.Drawing.Size(1060, 489); + this.tbSimulationLog.TabIndex = 2; + this.tbSimulationLog.Text = ""; + // + // btSimulate + // + this.btSimulate.AutoSize = true; + this.btSimulate.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btSimulate.Depth = 0; + this.btSimulate.Location = new System.Drawing.Point(44, 95); + this.btSimulate.Margin = new System.Windows.Forms.Padding(4, 6, 4, 6); + this.btSimulate.MouseState = MaterialSkin.MouseState.HOVER; + this.btSimulate.Name = "btSimulate"; + this.btSimulate.Primary = false; + this.btSimulate.Size = new System.Drawing.Size(139, 36); + this.btSimulate.TabIndex = 1; + this.btSimulate.Text = "simulation start"; + this.btSimulate.UseVisualStyleBackColor = true; + this.btSimulate.Click += new System.EventHandler(this.btSimulate_Click); + // + // btLoad + // + this.btLoad.AutoSize = true; + this.btLoad.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btLoad.Depth = 0; + this.btLoad.Location = new System.Drawing.Point(44, 47); + this.btLoad.Margin = new System.Windows.Forms.Padding(4, 6, 4, 6); + this.btLoad.MouseState = MaterialSkin.MouseState.HOVER; + this.btLoad.Name = "btLoad"; + this.btLoad.Primary = false; + this.btLoad.Size = new System.Drawing.Size(86, 36); + this.btLoad.TabIndex = 0; + this.btLoad.Text = "Load data"; + this.btLoad.UseVisualStyleBackColor = true; + this.btLoad.Click += new System.EventHandler(this.btLoad_Click); + // // AutoSeller // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); diff --git a/AutoSeller.cs b/AutoSeller.cs index 4d41c09..5863561 100644 --- a/AutoSeller.cs +++ b/AutoSeller.cs @@ -428,31 +428,6 @@ namespace AutoSellerNS { SimulationHelper helper = new SimulationHelper(this, m_CybosHelper, tbSimulationLog); helper.StartSimuation2(); - return; - - - //int iOrgBidCount = Config.GetBidCount(); - //float fOrgTrailingRate = Config.GetTrailingRate(); - //int iOrgTraililngCount = Config.GetTrailingCnt(); - - //for(int iTrailingCount = 2; iTrailingCount <= 4; iTrailingCount++) - //{ - // for(float fTrailingRate=2.5f; fTrailingRate <= 5.0f; fTrailingRate += 0.5f) - // { - // for(int iBidCount = 4; iBidCount <= 8; iBidCount++) - // { - // Config.SetBidCount(iBidCount); - // Config.SetTrailing(fTrailingRate, iTrailingCount); - - // helper.StartSimuation(); - // } - // } - //} - - //Config.SetBidCount(iOrgBidCount); - //Config.SetTrailing(fOrgTrailingRate, iOrgTraililngCount); - - //Console.WriteLine("end"); } #endregion } diff --git a/CybosHelper.cs b/CybosHelper.cs index fe107c4..1750218 100644 --- a/CybosHelper.cs +++ b/CybosHelper.cs @@ -27,10 +27,41 @@ namespace AutoSellerNS public int m_iTrailingCount = 0; + public List m_PriceList = new List(); + public double m_dCheckCount = 5; + + double m_dFastSD = 0.75; + double m_dFastUpCnt = 0.05; + double m_dFastDownCnt = 0.05; + double m_dSlowSD = 0.2; + double m_dSlowUpCnt = 0.4; + double m_dSlowDownCnt = 0.4; + public void OnRecievedPrice() { bool bReal = (m_StockCur.GetHeaderValue(19) == '2'); m_iCurPrice = m_StockCur.GetHeaderValue(13); + + m_PriceList.Add(m_iCurPrice); + double dAverage = (float)m_PriceList.Average(); + double sumOfSquaresOfDifferences = m_PriceList.Select(val => Math.Pow((val-dAverage)/m_CybosHelper.GetUnitValue(val), 2)).Sum(); + double dStdDev = Math.Sqrt(sumOfSquaresOfDifferences / m_PriceList.Count); + if(dStdDev >= m_dFastSD) + { + if(m_iCurPrice >= dAverage) + m_dCheckCount += m_dFastUpCnt; + else + m_dCheckCount -= m_dFastDownCnt; + + } + else if(dStdDev <= m_dSlowSD) + { + if(m_iCurPrice >= dAverage) + m_dCheckCount += m_dSlowUpCnt; + else + m_dCheckCount -= m_dSlowDownCnt; + } + if(m_iCurPrice > m_iMaxPrice) m_iTrailingCount = 0; @@ -46,7 +77,7 @@ namespace AutoSellerNS m_iCheckCount = 0; } - if(m_iCheckCount >= Config.GetBidCount() && m_Listener.IsSelling() == true) + if(m_iCheckCount >= m_dCheckCount && m_Listener.IsSelling() == true) { m_CybosHelper.SellItem(m_strCode, m_Listener.GetSellableCount(m_strCode), m_aiAskPrice[0]); Util.Log(Util.LOG_TYPE.SELL, string.Format("[조건 완료 매도] {0} ({1}회) (현재가 {2:n0}원, 최고가 {3:n0}원)", m_strCodeName, Config.GetBidCount(), m_iCurPrice, m_iMaxPrice)); diff --git a/SimulationHelper.cs b/SimulationHelper.cs index a312d4c..f825357 100644 --- a/SimulationHelper.cs +++ b/SimulationHelper.cs @@ -3,6 +3,7 @@ using DSCBO1Lib; using OfficeOpenXml; using System; using System.Collections.Generic; +using System.Drawing; using System.Globalization; using System.IO; using System.Linq; @@ -97,7 +98,7 @@ namespace AutoSellerNS if(bContinue == true) CPStockChart.BlockRequest2(0); - m_tbLogView.AppendText(string.Format("RequestRQ({0})", m_CybosHelper.GetLimitRemainCountRQ())); + m_tbLogView.AppendText(string.Format("RequestRQ({0}) ", m_CybosHelper.GetLimitRemainCountRQ())); } if(strOutLine.Length > 0) @@ -126,6 +127,7 @@ namespace AutoSellerNS var strNewTime = tokens[1]; var strSimulationTime = tokens[2]; var strCodeName = tokens[3]; + strCodeName = strCodeName.Trim(); var strCode = tokens[4]; var strStartPrice = tokens[5]; @@ -184,7 +186,7 @@ namespace AutoSellerNS if(bContinue == true) CPStockChart.BlockRequest2(0); - m_tbLogView.AppendText(string.Format("RequestRQ({0})\n", m_CybosHelper.GetLimitRemainCountRQ())); + m_tbLogView.AppendText(string.Format("RequestRQ({0}) ", m_CybosHelper.GetLimitRemainCountRQ())); } aaRows.Reverse(); @@ -212,6 +214,7 @@ namespace AutoSellerNS var strNewTime = tokens[1]; var strSimulationTime = tokens[2]; var strCodeName = tokens[3]; + strCodeName = strCodeName.Trim(); var strCode = tokens[4]; var strStartPrice = tokens[5]; @@ -260,7 +263,7 @@ namespace AutoSellerNS CPStockBid.BlockRequest2(0); } - m_tbLogView.AppendText(string.Format("RequestRQ({0})\n", m_CybosHelper.GetLimitRemainCountRQ())); + m_tbLogView.AppendText(string.Format("RequestRQ({0}) ", m_CybosHelper.GetLimitRemainCountRQ())); } aaRows.Reverse(); @@ -291,6 +294,7 @@ namespace AutoSellerNS var strNewTime = tokens[1]; var strSimulationTime = tokens[2]; var strCodeName = tokens[3]; + strCodeName = strCodeName.Trim(); var strCode = tokens[4]; var strStartPrice = tokens[5]; @@ -401,6 +405,368 @@ namespace AutoSellerNS m_tbLogView.ScrollToCaret(); } + void InsertLog(string strMsg) + { + m_tbLogView.Invoke(new Action(() => { + int iPrevSelectionStart = m_tbLogView.SelectionStart; + int iPrevSelectionLength = m_tbLogView.SelectionLength; + bool bScroll = m_tbLogView.SelectionStart == m_tbLogView.TextLength; + + m_tbLogView.AppendText(strMsg); + if(bScroll == true) + { + m_tbLogView.SelectionStart = m_tbLogView.TextLength; + m_tbLogView.ScrollToCaret(); + } + else + { + m_tbLogView.SelectionStart = iPrevSelectionStart; + m_tbLogView.SelectionLength = iPrevSelectionLength; + } + })); + } + + object SimulationWork(object param) + { + object[] aParams = (object[])param; + + int iListCnt = (int)aParams[0]; + double dFastSD = (double)aParams[1]; + double dFastUpCnt = (double)aParams[2]; + double dFastDownCnt = (double)aParams[3]; + double dSlowSD = (double)aParams[4]; + double dSlowUpCnt = (double)aParams[5]; + double dSlowDownCnt = (double)aParams[6]; + bool bAverageCompare = (bool)aParams[7]; + string strMethod = (string)aParams[8]; + string strLine = (string)aParams[9]; + + + var tokens = strLine.Split('\t'); + + var strDate = tokens[0]; + var strNewTime = tokens[1]; + var strSimulationTime = tokens[2]; + var strCodeName = tokens[3]; + strCodeName = strCodeName.Trim(); + var strCode = tokens[4]; + var strStartPrice = tokens[5]; + + DateTime StartDT; + DateTime.TryParse(strDate+" "+strSimulationTime, out StartDT); + + int iStartPrice; + int.TryParse(strStartPrice, NumberStyles.AllowThousands, CultureInfo.CurrentCulture, out iStartPrice); + + int iSellPrice = iStartPrice; + + string strFileName = Util.GetSimulationPath() + "/" + StartDT.ToString("yyyy-MM-dd") + "-JpBid-" + strCodeName + ".xlsx"; + if(File.Exists(strFileName) == false) + return new object[] { string.Format("[{0}] [{1}] 파일이 없음\n", StartDT.ToString("yyyy-MM-dd"), strCodeName) , 0 }; + + FileInfo newFile = new FileInfo(strFileName); + ExcelPackage package = new ExcelPackage(newFile); + ExcelWorksheet Sheet = package.Workbook.Worksheets["sheet"]; + + int iMaxRow = Sheet.Dimension.Rows; + + DateTime RowDT = DateTime.Now; + + bool bStart = false; + int iAskCount = 0; + + int iTrailingCount = 0; + int iMaxPrice = int.MinValue; + int iStockCount = 0; + int iStartRow = 0; + int iPrevPrice = 0; + + double dCheckCount = 5.0; + List m_PriceList = new List(); + + //Sheet.Column(7).Style.Font.Color.SetColor(Color.Black); + //Sheet.DeleteColumn(8, 11); + + //Sheet.Cells[1, 8].Value = "평균"; + //Sheet.Cells[1, 9].Value = "표준편차"; + //Sheet.Cells[1, 10].Value = "매도 제한"; + //Sheet.Cells[1, 11].Value = "매도 수"; + //Sheet.View.FreezePanes(2, 1); + + double dPrevStdDev = 0; + string strReturnMsg = ""; + + for(int iRow = 2; iRow<=iMaxRow; iRow++) + { + if((string)Sheet.Cells[iRow, 2].Value == "*") + continue; + + int iTime = (int)(double)Sheet.Cells[iRow, 1].Value; + int iPrice = (int)(double)Sheet.Cells[iRow, 3].Value; + int iAskPrice = (int)(double)Sheet.Cells[iRow, 4].Value; + int iBidPrice = (int)(double)Sheet.Cells[iRow, 5].Value; + + DateTime.TryParse(strDate+" "+string.Format("{0}:{1}:{2}", iTime/10000, (iTime/100)%100, iTime%100), out RowDT); + + iStockCount = 1000000/iStartPrice; + + if(bStart == false) + { + if(RowDT >= StartDT && iPrice==iStartPrice) + { + bStart = true; + iStartRow = iRow; + + m_PriceList.Clear(); + m_PriceList.Add(iPrice); + } + } + else + { + m_PriceList.Add(iPrice); + if(m_PriceList.Count > iListCnt) + m_PriceList.RemoveAt(0); + + double dAverage = (float)m_PriceList.Average(); + double sumOfSquaresOfDifferences = m_PriceList.Select(val => Math.Pow((val-dAverage)/m_CybosHelper.GetUnitValue(val), 2)).Sum(); + double dStdDev = Math.Sqrt(sumOfSquaresOfDifferences / m_PriceList.Count); + //if(dStdDev < dPrevStdDev) + //{ + // dCheckCount -= dSlowDownCnt; + //} + //else + if(dStdDev >= dFastSD) + { + if(bAverageCompare == true) + { + if(iPrice >= dAverage) + dCheckCount += dFastUpCnt; + else// if(dCheckCount > 3) + dCheckCount -= dFastDownCnt; + } + else + { + if(iPrice >= m_PriceList[m_PriceList.Count-2]) + dCheckCount += dFastUpCnt; + else// if(dCheckCount > 3) + dCheckCount -= dFastDownCnt; + } + + } + else if(dStdDev <= dSlowSD) + { + if(bAverageCompare == true) + { + if(iPrice >= dAverage) + dCheckCount += dSlowUpCnt; + else// if(dCheckCount > 3) + dCheckCount -= dSlowDownCnt; + } + else + { + if(iPrice >= m_PriceList[m_PriceList.Count-2]) + dCheckCount += dSlowUpCnt; + else// if(dCheckCount > 3) + dCheckCount -= dSlowUpCnt; + } + } + + //dCheckCount = Math.Min(Math.Max(dCheckCount, 0), 15); + + //Sheet.Cells[iRow, 8].Value = dAverage; + //Sheet.Cells[iRow, 9].Value = dStdDev; + //Sheet.Cells[iRow, 9].Style.Numberformat.Format = "0.00"; + //Sheet.Cells[iRow, 10].Value = dCheckCount; + + // 호가 비교 - 매수호가 기준 + if(iPrice <= iBidPrice) + { + iAskCount++; + Sheet.Cells[iRow, 7].Style.Font.Color.SetColor(Color.Blue); + } + else + { + iAskCount = 0; + Sheet.Cells[iRow, 7].Style.Font.Color.SetColor(Color.Red); + } + + //Sheet.Cells[iRow, 11].Value = iAskCount; + + if(iAskCount >= Math.Round(dCheckCount)) + { + iSellPrice = iPrice - m_CybosHelper.GetUnitValue(iPrice); + strReturnMsg = string.Format("[{0}] [{1}] 조건1 매도 (매수: {2:n0}원, {3}, line:{4}) (매도: {5:n0}원(매도가:{6:n0}원) {7} line:{8}) (손익: {9}, {10:n0} : {11:n2}%) {12} \n", + StartDT.ToString("yyyy-MM-dd"), + strCodeName, + + iStartPrice, + StartDT.ToString("HH:mm:ss"), + iStartRow, + + iPrice, + iSellPrice, + RowDT.ToString("HH:mm:ss"), + iRow, + + iSellPrice-iStartPrice, + (iSellPrice-iStartPrice)*iStockCount, + (iSellPrice-iStartPrice)*100/(float)iStartPrice, + + dCheckCount + ); + break; + } + + if(iPrice > iMaxPrice) + iTrailingCount = 0; + else if(iPrice <= iMaxPrice*(100-Config.GetTrailingRate())/100) + iTrailingCount++; + iMaxPrice = Math.Max(iPrice, iMaxPrice); + + if(iTrailingCount >= Config.GetTrailingCnt()) + { + iSellPrice = iPrice - m_CybosHelper.GetUnitValue(iPrice); + strReturnMsg = string.Format("[{0}] [{1}] 트레일링 매도 (매수: {2:n0}원, {3}, line:{4}) (매도: {5:n0}원(매도가:{6:n0}원) {7} line:{8}) (손익: {9}, {10:n0} : {11:n2}%) {12} \n", + StartDT.ToString("yyyy-MM-dd"), + strCodeName, + + iStartPrice, + StartDT.ToString("HH:mm:ss"), + iStartRow, + + iPrice, + iSellPrice, + RowDT.ToString("HH:mm:ss"), + iRow, + + iSellPrice-iStartPrice, + (iSellPrice-iStartPrice)*iStockCount, + (iSellPrice-iStartPrice)*100/(float)iStartPrice, + + dCheckCount + + ); + + break; + } + + //if(iPrice < iStartPrice) + //{ + // iSellPrice = iPrice - m_CybosHelper.GetUnitValue(iPrice); + // strReturnMsg = string.Format("[{0}] 손절 매도 (매수: {1:n0}원, {2}, line:{3}) (매도: {4:n0}원(매도가:{5:n0}원) {6} line:{7}) (손익: {8}, {9:n0} : {10:n2}%) {11} \n", + // strCodeName, + + // iStartPrice, + // StartDT.ToString("HH:mm:ss"), + // iStartRow, + + // iPrice, + // iSellPrice, + // RowDT.ToString("HH:mm:ss"), + // iRow, + + // iSellPrice-iStartPrice, + // (iSellPrice-iStartPrice)*iStockCount, + // (iSellPrice-iStartPrice)*100/(float)iStartPrice, + + // dCheckCount + + // ); + + // iTotalProfit += (iSellPrice-iStartPrice)*iStockCount; + // iTotalBid += iStartPrice*iStockCount; + // break; + //} + + dPrevStdDev = dStdDev; + } + + if(iRow == iMaxRow) + { + iSellPrice = iPrice - m_CybosHelper.GetUnitValue(iPrice); + strReturnMsg = string.Format("[{0}] [{1}] 종료 매도 (매수: {2:n0}원, {3}, line:{4}) (매도: {5:n0}원(매도가:{6:n0}원) {7} line:{8}) (손익: {9}, {10:n0} : {11:n2}%) {12} \n", + StartDT.ToString("yyyy-MM-dd"), + strCodeName, + + iStartPrice, + StartDT.ToString("HH:mm:ss"), + iStartRow, + + iPrice, + iSellPrice, + RowDT.ToString("HH:mm:ss"), + iRow, + + iSellPrice-iStartPrice, + (iSellPrice-iStartPrice)*iStockCount, + (iSellPrice-iStartPrice)*100/(float)iStartPrice, + + dCheckCount + + ); + + break; + } + + iPrevPrice = iPrice; + } + + //Sheet.Cells.AutoFitColumns(0); + //Sheet.Select(ExcelAddress.GetAddress(Math.Max(iStartRow, 1), 1), true); + + //package.Save(); + + return new object[] { strReturnMsg, (iSellPrice-iStartPrice)*iStockCount }; + } + + int Simulation(object param) + { + object[] aParams = (object[])param; + + int iListCnt = (int)aParams[0]; + double dFastSD = (double)aParams[1]; + double dFastUpCnt = (double)aParams[2]; + double dFastDownCnt = (double)aParams[3]; + double dSlowSD = (double)aParams[4]; + double dSlowUpCnt = (double)aParams[5]; + double dSlowDownCnt = (double)aParams[6]; + bool bAverageCompare = (bool)aParams[7]; + string strMethod = (string)aParams[8]; + + InsertLog(string.Format("[시뮬레이션 시작] 조건 : {0}회, 트레일링 : {1}%, {2}회\n \t\t리스트 크기:{3}, Fast : {4}, {5}, {6}, Slow : {7}, {8}, {9}, 비교 방식 : {10}\n", + Config.GetBidCount(), Config.GetTrailingRate(), Config.GetTrailingCnt(), + iListCnt, dFastSD, dFastUpCnt, dFastDownCnt, dSlowSD, dSlowUpCnt, dSlowDownCnt, strMethod + )); + + + + List aLines = new List(); + List> aTasks = new List>(); + foreach(string strLine in File.ReadLines(Util.GetSimulationPath()+"/0-input.txt", Encoding.UTF8)) + { + var task = Task.Factory.StartNew(() => SimulationWork(new object[] { + iListCnt, + dFastSD, dFastUpCnt, dFastDownCnt, + dSlowSD, dSlowUpCnt, dSlowDownCnt, + bAverageCompare, strMethod, + strLine })); + + aTasks.Add(task); + } + + int iTotalProfit = 0; + foreach(var task in aTasks) + { + object[] aResult = (object[])task.Result; + InsertLog((string)aResult[0]); + iTotalProfit += (int)aResult[1]; + } + + InsertLog(string.Format("[시뮬레이션 종료] 총수익 : {0:n0}원 : {1:n2}%\n\n", iTotalProfit, iTotalProfit*100/(float)1000000)); + InsertLog("======================================================================\n"); + return 0; + } + public void StartSimuation2() { int iListCnt; @@ -419,323 +785,37 @@ namespace AutoSellerNS double.TryParse(m_AutoSeller.tbSMSlowUpCnt.Text, out dSlowUpCnt); double.TryParse(m_AutoSeller.tbSMSlowDownCnt.Text, out dSlowDownCnt); + string strMethod = ""; + m_AutoSeller.cbSMMethod.Invoke(new Action(() => { + strMethod = (string)m_AutoSeller.cbSMMethod.SelectedItem; + })); + bool bAverageCompare; - if((string)m_AutoSeller.cbSMMethod.SelectedItem == "평균 비교") + if(strMethod == "평균 비교") bAverageCompare = true; else bAverageCompare = false; - m_tbLogView.AppendText(string.Format("[시뮬레이션 시작] 조건 : {0}회, 트레일링 : {1}%, {2}회\n \t\t리스트 크기:{3}, Fast : {4}, {5}, Slow : {6}, {7}, 비교 방식 : {8}\n", - Config.GetBidCount(), Config.GetTrailingRate(), Config.GetTrailingCnt(), - iListCnt, dFastSD, dFastUpCnt, dSlowSD, dSlowUpCnt, m_AutoSeller.cbSMMethod.SelectedItem - )); - - int iTotalProfit = 0; - int iTotalBid = 0; - DateTime PrevDT; - DateTime.TryParse("0000-00-00 00:00:00", out PrevDT); - - foreach(string strLine in File.ReadLines(Util.GetSimulationPath()+"/0-input.txt", Encoding.UTF8)) - { - var tokens = strLine.Split('\t'); - - var strDate = tokens[0]; - var strNewTime = tokens[1]; - var strSimulationTime = tokens[2]; - var strCodeName = tokens[3]; - strCodeName = strCodeName.Trim(); - var strCode = tokens[4]; - var strStartPrice = tokens[5]; - - DateTime StartDT; - DateTime.TryParse(strDate+" "+strSimulationTime, out StartDT); - - if(iTotalBid > 0 && StartDT.DayOfYear != PrevDT.DayOfYear) - { - m_tbLogView.AppendText(string.Format("[시뮬레이션 종료] 총수익 : {0:n0}원 : {1:n2}%\n\n", iTotalProfit, iTotalProfit*100/(float)1000000)); - - iTotalProfit = 0; - iTotalBid = 0; - } - - if(iTotalBid == 0) - { - m_tbLogView.AppendText(string.Format("{0}\n", StartDT.ToString("yyyy-MM-dd"))); - } - - int iStartPrice; - int.TryParse(strStartPrice, NumberStyles.AllowThousands, CultureInfo.CurrentCulture, out iStartPrice); - - string strFileName = Util.GetSimulationPath() + "/" + StartDT.ToString("yyyy-MM-dd") + "-JpBid-" + strCodeName + ".xlsx"; - if(File.Exists(strFileName) == false) - continue; - - FileInfo newFile = new FileInfo(strFileName); - ExcelPackage package = new ExcelPackage(newFile); - ExcelWorksheet Sheet = package.Workbook.Worksheets["sheet"]; - - int iMaxRow = Sheet.Dimension.Rows; - - DateTime RowDT = DateTime.Now; - List aPrevDT = new List(); - - bool bStart = false; - int iAskCount = 0; - int iAskDownCount = 0; - int iDealCountInSec = 0; - - int iTrailingCount = 0; - int iMaxPrice = int.MinValue; - int iStockCount = 0; - int iStartRow = 0; - int iPrevPrice = 0; - bool bPrevAsk = false; - int iMaxAskPrice = 0; - - double dCheckCount = 5.0; - List m_PriceList = new List(); - - int iPrevAskPrice = 0; - - for(int iRow = 2; iRow<=iMaxRow; iRow++) - { - if((string)Sheet.Cells[iRow, 2].Value == "*") - continue; - - int iTime = (int)(double)Sheet.Cells[iRow, 1].Value; - int iPrice = (int)(double)Sheet.Cells[iRow, 3].Value; - int iAskPrice = (int)(double)Sheet.Cells[iRow, 4].Value; - int iBidPrice = (int)(double)Sheet.Cells[iRow, 5].Value; - - DateTime.TryParse(strDate+" "+string.Format("{0}:{1}:{2}", iTime/10000, (iTime/100)%100, iTime%100), out RowDT); - - iStockCount = 1000000/iStartPrice; - - if(bStart == false) - { - if(RowDT >= StartDT && iPrice==iStartPrice) - { - bStart = true; - iStartRow = iRow; - iMaxAskPrice = iAskPrice; - iPrevAskPrice = iAskPrice; - - m_PriceList.Clear(); - m_PriceList.Add(iPrice); - } - } - else - { - m_PriceList.Add(iPrice); - if(m_PriceList.Count > iListCnt) - m_PriceList.RemoveAt(0); - - double dAverage = (float)m_PriceList.Average(); - double sumOfSquaresOfDifferences = m_PriceList.Select(val => Math.Pow((val-dAverage)/m_CybosHelper.GetUnitValue(val), 2)).Sum(); - double sd = Math.Sqrt(sumOfSquaresOfDifferences / m_PriceList.Count); - - if(sd >= dFastSD) - { - if(bAverageCompare == true) - { - if(iPrice >= dAverage) - dCheckCount += dFastUpCnt; - else// if(dCheckCount > 3) - dCheckCount -= dFastDownCnt; - } - else - { - if(iPrice >= m_PriceList[m_PriceList.Count-2]) - dCheckCount += dFastUpCnt; - else// if(dCheckCount > 3) - dCheckCount -= dFastDownCnt; - } - - } - else if(sd <= dSlowSD) - { - if(bAverageCompare == true) - { - if(iPrice >= dAverage) - dCheckCount += dSlowUpCnt; - else// if(dCheckCount > 3) - dCheckCount -= dSlowDownCnt; - } - else - { - if(iPrice >= m_PriceList[m_PriceList.Count-2]) - dCheckCount += dSlowUpCnt; - else// if(dCheckCount > 3) - dCheckCount -= dSlowUpCnt; - } - } - //dCheckCount = Math.Min(Math.Max(dCheckCount, 0), 15); - - //// 체결가 비교 - //if(iPrice > iPrevPrice) - //{ - // iAskCount = 0; - // bPrevAsk = false; - //} - //else if(iPrice < iPrevPrice) - //{ - // iAskCount++; - // bPrevAsk = true; - //} - //else if(bPrevAsk == true) - //{ - // iAskCount++; - //} - - //// 호가 비교 - 중간 유지 - //if(iPrice >= iAskPrice) - //{ - // iAskCount = 0; - // bPrevAsk = false; - //} - //else if(iPrice <= iBidPrice) - //{ - // iAskCount++; - // bPrevAsk = true; - //} - //else if(bPrevAsk == true) - //{ - // iAskCount++; - //} - - // 호가 비교 - 매수호가 기준 - if(iPrice <= iBidPrice) - iAskCount++; - else - iAskCount = 0; - - //// 호가 비교 - 매도호가 기준 - //if(iPrice < iAskPrice) - // iAskCount++; - //else - // iAskCount = 0; - - //// 매도호가 최고가 미만 연속 - //if(iAskPrice < iMaxAskPrice) - // iAskDownCount++; - //else - // iAskDownCount=0; - //iMaxAskPrice = Math.Max(iMaxAskPrice, iAskPrice); - - //// 매도호가 최고가 미만 누적 - //if(iAskPrice < iMaxAskPrice) - // iAskDownCount++; - //int iNextMaxAskPrice = Math.Max(iMaxAskPrice, iAskPrice); - //if(iNextMaxAskPrice > iMaxAskPrice) - // iAskDownCount = 0; - //iMaxAskPrice = iNextMaxAskPrice; - - //// 매도호가 하락 - 최고 갱신시 리셋 - //if(iAskPrice < iPrevAskPrice) - // iAskDownCount++; - //int iNextMaxAskPrice = Math.Max(iMaxAskPrice, iAskPrice); - //if(iNextMaxAskPrice > iMaxAskPrice) - // iAskDownCount = 0; - //iMaxAskPrice = iNextMaxAskPrice; - - //if(PrevRowDT.Second == RowDT.Second) - // iDealCountInSec++; - //else - // iDealCountInSec = 1; - - if(iAskCount >= Math.Round(dCheckCount)) - { - int iSellPrice = iPrice - m_CybosHelper.GetUnitValue(iPrice); - m_tbLogView.AppendText(string.Format("[{0}] 조건1 매도 (매수 : {1:n0}원, {2}, line:{3}) (매도 : {4:n0}원(매도가:{5:n0}원) {6} line:{7}) ({8}, {9:n0} : {10:n2}%) {11} \n", - strCodeName, - - iStartPrice, - StartDT.ToString("HH:mm:ss"), - iStartRow, - - iPrice, - iSellPrice, - RowDT.ToString("HH:mm:ss"), - iRow, - - iSellPrice-iStartPrice, - (iSellPrice-iStartPrice)*iStockCount, - (iSellPrice-iStartPrice)*100/(float)iStartPrice, - - dCheckCount - )); - iTotalProfit += (iSellPrice-iStartPrice)*iStockCount; - iTotalBid += iStartPrice*iStockCount; - break; - } - - //if(aPrevDT.Count > 3 && aPrevDT.Last() - aPrevDT[aPrevDT.Count-3] > TimeSpan.FromSeconds(1) && iAskDownCount >= Config.GetBidCount()) - //if(iAskDownCount >= 5) - //{ - // m_tbLogView.AppendText(string.Format("[{0}] 조건2 매도 {1} line:{2} {3:n0}원 ({4} : {5:n2}%) (매수 : {6:n0}원, {7}, line:{8})\n", - // strCodeName, - // RowDT.ToString("HH:mm:ss"), - // iRow, - // iPrice, - // iPrice-iStartPrice, - // (iPrice-iStartPrice)*100/(float)iStartPrice, - // iStartPrice, - // StartDT.ToString("HH:mm:ss"), - // iStartRow - // )); - // iTotalProfit += (iPrice-iStartPrice)*iStockCount; - // iTotalBid += iStartPrice*iStockCount; - // break; - //} - - if(iPrice > iMaxPrice) - iTrailingCount = 0; - else if(iPrice <= iMaxPrice*(100-Config.GetTrailingRate())/100) - iTrailingCount++; - iMaxPrice = Math.Max(iPrice, iMaxPrice); - - if(iTrailingCount >= Config.GetTrailingCnt()) - { - int iSellPrice = iPrice - m_CybosHelper.GetUnitValue(iPrice); - m_tbLogView.AppendText(string.Format("[{0}] 트레일링 매도 (매수 : {1:n0}원, {2}, line:{3}) (매도 : {4:n0}원(매도가:{5:n0}원) {6} line:{7}) ({8}, {9:n0} : {10:n2}%) {11} \n", - strCodeName, - - iStartPrice, - StartDT.ToString("HH:mm:ss"), - iStartRow, - - iPrice, - iSellPrice, - RowDT.ToString("HH:mm:ss"), - iRow, - - iSellPrice-iStartPrice, - (iSellPrice-iStartPrice)*iStockCount, - (iSellPrice-iStartPrice)*100/(float)iStartPrice, - - dCheckCount - - )); - - iTotalProfit += (iSellPrice-iStartPrice)*iStockCount; - iTotalBid += iStartPrice*iStockCount; - break; - } - } - - iPrevPrice = iPrice; - iPrevAskPrice = iAskPrice; - aPrevDT.Add(RowDT); - if(aPrevDT.Count > 15) - aPrevDT.RemoveAt(0); - - PrevDT = StartDT; - } - } - - m_tbLogView.AppendText(string.Format("[시뮬레이션 종료] 총수익 : {0:n0}원 : {1:n2}%\n\n", iTotalProfit, iTotalProfit*100/(float)1000000)); - m_tbLogView.SelectionStart = m_tbLogView.TextLength; - m_tbLogView.ScrollToCaret(); + Task.Factory.StartNew(() => { + // for(double dFastSD = 0.75; dFastSD<=0.75; dFastSD+=0.05) + // { + // for(double dFastUpCnt = 0; dFastUpCnt<=0; dFastUpCnt+=0.05) + // { + // for(double dSlowSD = 0.2; dSlowSD<=0.2; dSlowSD+=0.05) + // { + // for(double dSlowUpCnt = 0; dSlowUpCnt<=0; dSlowUpCnt+=0.05) + // { + Simulation(new object[] { + iListCnt, + dFastSD, dFastUpCnt, dFastUpCnt, + dSlowSD, dSlowUpCnt, dSlowUpCnt, + bAverageCompare, strMethod + }); + // } + // } + // } + // } + }); } } }