diff --git a/AutoSeller.Designer.cs b/AutoSeller.Designer.cs index d4e5d23..02e3def 100644 --- a/AutoSeller.Designer.cs +++ b/AutoSeller.Designer.cs @@ -32,6 +32,7 @@ this.materialTabSelector1 = new MaterialSkin.Controls.MaterialTabSelector(); this.materialTabControl1 = new MaterialSkin.Controls.MaterialTabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); + this.btClearBeforeClosing = new MaterialSkin.Controls.MaterialRaisedButton(); this.btClearAll = new MaterialSkin.Controls.MaterialRaisedButton(); this.lbRQCnt = new MaterialSkin.Controls.MaterialLabel(); this.lbTRCnt = new MaterialSkin.Controls.MaterialLabel(); @@ -40,9 +41,36 @@ this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer3 = new System.Windows.Forms.SplitContainer(); + 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())); + this.chCurPrice = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chCount = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chBookValue = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chCapitalGains = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chAssessedValue = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chValuation = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chYield = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chMaxPrice = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chCheckCountLimit = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chCheckCount = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.splitContainer4 = new System.Windows.Forms.SplitContainer(); + this.lvNCItem = new AutoSellerNS.ListViewNF(); + this.chNCOrderNo = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chNCOrgOrderNo = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chNCCode = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chNCCodeName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + 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.btCancel = new MaterialSkin.Controls.MaterialRaisedButton(); this.btUpdateNC = new MaterialSkin.Controls.MaterialRaisedButton(); 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(); @@ -52,6 +80,11 @@ this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader8 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader9 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader10 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.tabPage3 = new System.Windows.Forms.TabPage(); this.cbMockTrading = new System.Windows.Forms.CheckBox(); this.materialLabel18 = new MaterialSkin.Controls.MaterialLabel(); @@ -104,37 +137,6 @@ this.tbSimulationLog = new System.Windows.Forms.RichTextBox(); this.btSimulate = new MaterialSkin.Controls.MaterialFlatButton(); this.btLoad = new MaterialSkin.Controls.MaterialFlatButton(); - this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader8 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader9 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader10 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - 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())); - this.chCurPrice = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.chCount = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.chBookValue = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.chCapitalGains = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.chAssessedValue = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.chValuation = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.chYield = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.chMaxPrice = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.chCheckCountLimit = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.chCheckCount = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.lvNCItem = new AutoSellerNS.ListViewNF(); - this.chNCOrderNo = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.chNCOrgOrderNo = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.chNCCode = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.chNCCodeName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - 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.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.materialTabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); @@ -190,6 +192,7 @@ // // tabPage1 // + this.tabPage1.Controls.Add(this.btClearBeforeClosing); this.tabPage1.Controls.Add(this.btClearAll); this.tabPage1.Controls.Add(this.lbRQCnt); this.tabPage1.Controls.Add(this.lbTRCnt); @@ -206,6 +209,20 @@ this.tabPage1.Text = "Items"; this.tabPage1.UseVisualStyleBackColor = true; // + // btClearBeforeClosing + // + this.btClearBeforeClosing.AutoSize = true; + this.btClearBeforeClosing.Depth = 0; + this.btClearBeforeClosing.Location = new System.Drawing.Point(782, 3); + this.btClearBeforeClosing.MouseState = MaterialSkin.MouseState.HOVER; + this.btClearBeforeClosing.Name = "btClearBeforeClosing"; + this.btClearBeforeClosing.Primary = true; + this.btClearBeforeClosing.Size = new System.Drawing.Size(128, 28); + this.btClearBeforeClosing.TabIndex = 9; + this.btClearBeforeClosing.Text = "Close Closing"; + this.btClearBeforeClosing.UseVisualStyleBackColor = true; + this.btClearBeforeClosing.Click += new System.EventHandler(this.btClearBeforeClosing_Click); + // // btClearAll // this.btClearAll.AutoSize = true; @@ -225,12 +242,12 @@ this.lbRQCnt.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.lbRQCnt.AutoSize = true; this.lbRQCnt.Depth = 0; - this.lbRQCnt.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + this.lbRQCnt.Font = new System.Drawing.Font("Roboto", 11F); this.lbRQCnt.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.lbRQCnt.Location = new System.Drawing.Point(1026, 6); this.lbRQCnt.MouseState = MaterialSkin.MouseState.HOVER; this.lbRQCnt.Name = "lbRQCnt"; - this.lbRQCnt.Size = new System.Drawing.Size(0, 18); + this.lbRQCnt.Size = new System.Drawing.Size(0, 19); this.lbRQCnt.TabIndex = 7; // // lbTRCnt @@ -238,12 +255,12 @@ this.lbTRCnt.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.lbTRCnt.AutoSize = true; this.lbTRCnt.Depth = 0; - this.lbTRCnt.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + this.lbTRCnt.Font = new System.Drawing.Font("Roboto", 11F); this.lbTRCnt.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.lbTRCnt.Location = new System.Drawing.Point(1060, 6); this.lbTRCnt.MouseState = MaterialSkin.MouseState.HOVER; this.lbTRCnt.Name = "lbTRCnt"; - this.lbTRCnt.Size = new System.Drawing.Size(0, 18); + this.lbTRCnt.Size = new System.Drawing.Size(0, 19); this.lbTRCnt.TabIndex = 6; // // lbSBCnt @@ -251,12 +268,12 @@ this.lbSBCnt.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.lbSBCnt.AutoSize = true; this.lbSBCnt.Depth = 0; - this.lbSBCnt.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + this.lbSBCnt.Font = new System.Drawing.Font("Roboto", 11F); this.lbSBCnt.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.lbSBCnt.Location = new System.Drawing.Point(1094, 6); this.lbSBCnt.MouseState = MaterialSkin.MouseState.HOVER; this.lbSBCnt.Name = "lbSBCnt"; - this.lbSBCnt.Size = new System.Drawing.Size(0, 18); + this.lbSBCnt.Size = new System.Drawing.Size(0, 19); this.lbSBCnt.TabIndex = 5; // // btSell @@ -330,6 +347,99 @@ this.splitContainer3.SplitterDistance = 273; this.splitContainer3.TabIndex = 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.chCheckCountLimit, + this.chCheckCount}); + this.lvItems.Dock = System.Windows.Forms.DockStyle.Fill; + this.lvItems.FullRowSelect = true; + this.lvItems.GridLines = true; + this.lvItems.Location = new System.Drawing.Point(0, 0); + this.lvItems.Name = "lvItems"; + this.lvItems.Size = new System.Drawing.Size(859, 273); + this.lvItems.TabIndex = 0; + this.lvItems.UseCompatibleStateImageBehavior = false; + this.lvItems.View = System.Windows.Forms.View.Details; + this.lvItems.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lvItems_ColumnClick); + this.lvItems.SelectedIndexChanged += new System.EventHandler(this.lvList_SelectedIndexChanged); + // + // chCode + // + this.chCode.Text = "코드"; + this.chCode.Width = 77; + // + // chCodeName + // + this.chCodeName.Text = "종목명"; + this.chCodeName.Width = 86; + // + // chCurPrice + // + this.chCurPrice.Text = "현재가"; + this.chCurPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.chCurPrice.Width = 71; + // + // chCount + // + this.chCount.Text = "잔고수량"; + this.chCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // chBookValue + // + this.chBookValue.Text = "장부가"; + this.chBookValue.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.chBookValue.Width = 72; + // + // chCapitalGains + // + this.chCapitalGains.Text = "손익단가"; + this.chCapitalGains.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.chCapitalGains.Width = 73; + // + // chAssessedValue + // + this.chAssessedValue.Text = "평가금액"; + this.chAssessedValue.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.chAssessedValue.Width = 76; + // + // chValuation + // + this.chValuation.Text = "평가손익"; + this.chValuation.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.chValuation.Width = 79; + // + // chYield + // + this.chYield.Text = "수익률"; + this.chYield.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.chYield.Width = 79; + // + // chMaxPrice + // + this.chMaxPrice.Text = "최고가"; + this.chMaxPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // chCheckCountLimit + // + this.chCheckCountLimit.Text = "조건제한"; + this.chCheckCountLimit.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // chCheckCount + // + this.chCheckCount.Text = "조건횟수"; + this.chCheckCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // // splitContainer4 // this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill; @@ -342,11 +452,83 @@ // // splitContainer4.Panel2 // + this.splitContainer4.Panel2.Controls.Add(this.btCancel); this.splitContainer4.Panel2.Controls.Add(this.btUpdateNC); this.splitContainer4.Size = new System.Drawing.Size(859, 138); this.splitContainer4.SplitterDistance = 772; this.splitContainer4.TabIndex = 2; // + // lvNCItem + // + this.lvNCItem.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.chNCOrderNo, + this.chNCOrgOrderNo, + 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; + this.lvNCItem.Location = new System.Drawing.Point(0, 0); + this.lvNCItem.Name = "lvNCItem"; + this.lvNCItem.Size = new System.Drawing.Size(772, 138); + this.lvNCItem.TabIndex = 1; + this.lvNCItem.UseCompatibleStateImageBehavior = false; + this.lvNCItem.View = System.Windows.Forms.View.Details; + this.lvNCItem.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lvNCItem_ColumnClick); + // + // chNCOrderNo + // + this.chNCOrderNo.Text = "주문번호"; + // + // chNCOrgOrderNo + // + this.chNCOrgOrderNo.Text = "원주문번호"; + this.chNCOrgOrderNo.Width = 91; + // + // chNCCode + // + this.chNCCode.Text = "코드"; + this.chNCCode.Width = 77; + // + // chNCCodeName + // + this.chNCCodeName.Text = "종목명"; + this.chNCCodeName.Width = 101; + // + // chNCType + // + this.chNCType.Text = "매매구분"; + this.chNCType.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.chNCType.Width = 106; + // + // chNCPrice + // + this.chNCPrice.Text = "주문단가"; + this.chNCPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.chNCPrice.Width = 72; + // + // chNCCount + // + this.chNCCount.Text = "미체결량"; + this.chNCCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // btCancel + // + this.btCancel.AutoSize = true; + this.btCancel.Depth = 0; + this.btCancel.Location = new System.Drawing.Point(2, 37); + this.btCancel.MouseState = MaterialSkin.MouseState.HOVER; + this.btCancel.Name = "btCancel"; + this.btCancel.Primary = true; + this.btCancel.Size = new System.Drawing.Size(77, 28); + this.btCancel.TabIndex = 4; + this.btCancel.Text = "Cancel"; + this.btCancel.UseVisualStyleBackColor = true; + this.btCancel.Click += new System.EventHandler(this.btCancel_Click); + // // btUpdateNC // this.btUpdateNC.AutoSize = true; @@ -370,6 +552,44 @@ 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.lvCurPrice.Dock = System.Windows.Forms.DockStyle.Fill; + this.lvCurPrice.FullRowSelect = true; + this.lvCurPrice.GridLines = true; + this.lvCurPrice.Location = new System.Drawing.Point(0, 0); + this.lvCurPrice.Name = "lvCurPrice"; + this.lvCurPrice.Size = new System.Drawing.Size(264, 598); + this.lvCurPrice.TabIndex = 0; + this.lvCurPrice.UseCompatibleStateImageBehavior = false; + this.lvCurPrice.View = System.Windows.Forms.View.Details; + // + // columnHeader1 + // + this.columnHeader1.Width = 10; + // + // chAskCount + // + this.chAskCount.Text = "매도잔량"; + this.chAskCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.chAskCount.Width = 75; + // + // chCallPrice + // + this.chCallPrice.Text = "호가"; + this.chCallPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // chBidCount + // + this.chBidCount.Text = "매수잔량"; + this.chBidCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.chBidCount.Width = 75; + // // btUpdate // this.btUpdate.AutoSize = true; @@ -463,6 +683,26 @@ // this.columnHeader5.Text = "약정금액"; // + // columnHeader6 + // + this.columnHeader6.Text = "정산금액"; + // + // columnHeader7 + // + this.columnHeader7.Text = "수수료"; + // + // columnHeader8 + // + this.columnHeader8.Text = "거래세"; + // + // columnHeader9 + // + this.columnHeader9.Text = "농특세"; + // + // columnHeader10 + // + this.columnHeader10.Text = "날짜"; + // // tabPage3 // this.tabPage3.BackColor = System.Drawing.Color.White; @@ -522,12 +762,12 @@ // this.materialLabel18.AutoSize = true; this.materialLabel18.Depth = 0; - this.materialLabel18.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + this.materialLabel18.Font = new System.Drawing.Font("Roboto", 11F); this.materialLabel18.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.materialLabel18.Location = new System.Drawing.Point(99, 455); this.materialLabel18.MouseState = MaterialSkin.MouseState.HOVER; this.materialLabel18.Name = "materialLabel18"; - this.materialLabel18.Size = new System.Drawing.Size(114, 18); + this.materialLabel18.Size = new System.Drawing.Size(98, 19); this.materialLabel18.TabIndex = 37; this.materialLabel18.Text = "원 이하 체결 무시"; // @@ -551,12 +791,12 @@ // this.materialLabel17.AutoSize = true; this.materialLabel17.Depth = 0; - this.materialLabel17.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + this.materialLabel17.Font = new System.Drawing.Font("Roboto", 11F); this.materialLabel17.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.materialLabel17.Location = new System.Drawing.Point(187, 424); this.materialLabel17.MouseState = MaterialSkin.MouseState.HOVER; this.materialLabel17.Name = "materialLabel17"; - this.materialLabel17.Size = new System.Drawing.Size(107, 18); + this.materialLabel17.Size = new System.Drawing.Size(94, 19); this.materialLabel17.TabIndex = 35; this.materialLabel17.Text = "초 이상이면 매도"; // @@ -564,12 +804,12 @@ // this.materialLabel14.AutoSize = true; this.materialLabel14.Depth = 0; - this.materialLabel14.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + this.materialLabel14.Font = new System.Drawing.Font("Roboto", 11F); this.materialLabel14.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.materialLabel14.Location = new System.Drawing.Point(209, 389); this.materialLabel14.MouseState = MaterialSkin.MouseState.HOVER; this.materialLabel14.Name = "materialLabel14"; - this.materialLabel14.Size = new System.Drawing.Size(13, 18); + this.materialLabel14.Size = new System.Drawing.Size(13, 19); this.materialLabel14.TabIndex = 34; this.materialLabel14.Text = "-"; // @@ -577,12 +817,12 @@ // this.materialLabel13.AutoSize = true; this.materialLabel13.Depth = 0; - this.materialLabel13.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + this.materialLabel13.Font = new System.Drawing.Font("Roboto", 11F); this.materialLabel13.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.materialLabel13.Location = new System.Drawing.Point(143, 390); this.materialLabel13.MouseState = MaterialSkin.MouseState.HOVER; this.materialLabel13.Name = "materialLabel13"; - this.materialLabel13.Size = new System.Drawing.Size(17, 18); + this.materialLabel13.Size = new System.Drawing.Size(18, 19); this.materialLabel13.TabIndex = 34; this.materialLabel13.Text = "+"; // @@ -638,12 +878,12 @@ // this.materialLabel15.AutoSize = true; this.materialLabel15.Depth = 0; - this.materialLabel15.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + this.materialLabel15.Font = new System.Drawing.Font("Roboto", 11F); this.materialLabel15.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.materialLabel15.Location = new System.Drawing.Point(25, 391); this.materialLabel15.MouseState = MaterialSkin.MouseState.HOVER; this.materialLabel15.Name = "materialLabel15"; - this.materialLabel15.Size = new System.Drawing.Size(64, 18); + this.materialLabel15.Size = new System.Drawing.Size(57, 19); this.materialLabel15.TabIndex = 30; this.materialLabel15.Text = "저 변동성"; // @@ -651,12 +891,12 @@ // this.materialLabel11.AutoSize = true; this.materialLabel11.Depth = 0; - this.materialLabel11.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + this.materialLabel11.Font = new System.Drawing.Font("Roboto", 11F); this.materialLabel11.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.materialLabel11.Location = new System.Drawing.Point(209, 355); this.materialLabel11.MouseState = MaterialSkin.MouseState.HOVER; this.materialLabel11.Name = "materialLabel11"; - this.materialLabel11.Size = new System.Drawing.Size(13, 18); + this.materialLabel11.Size = new System.Drawing.Size(13, 19); this.materialLabel11.TabIndex = 29; this.materialLabel11.Text = "-"; // @@ -664,12 +904,12 @@ // this.materialLabel8.AutoSize = true; this.materialLabel8.Depth = 0; - this.materialLabel8.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + this.materialLabel8.Font = new System.Drawing.Font("Roboto", 11F); this.materialLabel8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.materialLabel8.Location = new System.Drawing.Point(143, 355); this.materialLabel8.MouseState = MaterialSkin.MouseState.HOVER; this.materialLabel8.Name = "materialLabel8"; - this.materialLabel8.Size = new System.Drawing.Size(17, 18); + this.materialLabel8.Size = new System.Drawing.Size(18, 19); this.materialLabel8.TabIndex = 29; this.materialLabel8.Text = "+"; // @@ -725,12 +965,12 @@ // this.materialLabel12.AutoSize = true; this.materialLabel12.Depth = 0; - this.materialLabel12.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + this.materialLabel12.Font = new System.Drawing.Font("Roboto", 11F); this.materialLabel12.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.materialLabel12.Location = new System.Drawing.Point(25, 356); this.materialLabel12.MouseState = MaterialSkin.MouseState.HOVER; this.materialLabel12.Name = "materialLabel12"; - this.materialLabel12.Size = new System.Drawing.Size(64, 18); + this.materialLabel12.Size = new System.Drawing.Size(57, 19); this.materialLabel12.TabIndex = 25; this.materialLabel12.Text = "고 변동성"; // @@ -786,12 +1026,12 @@ // this.materialLabel16.AutoSize = true; this.materialLabel16.Depth = 0; - this.materialLabel16.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + this.materialLabel16.Font = new System.Drawing.Font("Roboto", 11F); this.materialLabel16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.materialLabel16.Location = new System.Drawing.Point(99, 424); this.materialLabel16.MouseState = MaterialSkin.MouseState.HOVER; this.materialLabel16.Name = "materialLabel16"; - this.materialLabel16.Size = new System.Drawing.Size(34, 18); + this.materialLabel16.Size = new System.Drawing.Size(31, 19); this.materialLabel16.TabIndex = 22; this.materialLabel16.Text = "감소"; // @@ -799,12 +1039,12 @@ // this.materialLabel9.AutoSize = true; this.materialLabel9.Depth = 0; - this.materialLabel9.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + this.materialLabel9.Font = new System.Drawing.Font("Roboto", 11F); this.materialLabel9.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.materialLabel9.Location = new System.Drawing.Point(26, 424); this.materialLabel9.MouseState = MaterialSkin.MouseState.HOVER; this.materialLabel9.Name = "materialLabel9"; - this.materialLabel9.Size = new System.Drawing.Size(34, 18); + this.materialLabel9.Size = new System.Drawing.Size(31, 19); this.materialLabel9.TabIndex = 22; this.materialLabel9.Text = "초당"; // @@ -812,12 +1052,12 @@ // this.materialLabel10.AutoSize = true; this.materialLabel10.Depth = 0; - this.materialLabel10.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + this.materialLabel10.Font = new System.Drawing.Font("Roboto", 11F); this.materialLabel10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.materialLabel10.Location = new System.Drawing.Point(25, 322); this.materialLabel10.MouseState = MaterialSkin.MouseState.HOVER; this.materialLabel10.Name = "materialLabel10"; - this.materialLabel10.Size = new System.Drawing.Size(51, 18); + this.materialLabel10.Size = new System.Drawing.Size(46, 19); this.materialLabel10.TabIndex = 22; this.materialLabel10.Text = "체결 수"; // @@ -825,12 +1065,12 @@ // this.materialLabel7.AutoSize = true; this.materialLabel7.Depth = 0; - this.materialLabel7.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + 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(21, 18); + this.materialLabel7.Size = new System.Drawing.Size(20, 19); this.materialLabel7.TabIndex = 12; this.materialLabel7.Text = "회"; // @@ -854,12 +1094,12 @@ // this.materialLabel6.AutoSize = true; this.materialLabel6.Depth = 0; - this.materialLabel6.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + 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(21, 18); + this.materialLabel6.Size = new System.Drawing.Size(20, 19); this.materialLabel6.TabIndex = 10; this.materialLabel6.Text = "%"; // @@ -883,12 +1123,12 @@ // this.materialLabel5.AutoSize = true; this.materialLabel5.Depth = 0; - this.materialLabel5.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + 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(77, 18); + this.materialLabel5.Size = new System.Drawing.Size(68, 19); this.materialLabel5.TabIndex = 8; this.materialLabel5.Text = "최고가 대비"; // @@ -896,12 +1136,12 @@ // this.materialLabel4.AutoSize = true; this.materialLabel4.Depth = 0; - this.materialLabel4.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + 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(64, 18); + this.materialLabel4.Size = new System.Drawing.Size(57, 19); this.materialLabel4.TabIndex = 7; this.materialLabel4.Text = "조건 횟수"; // @@ -910,12 +1150,12 @@ 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.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, 614); this.materialLabel3.MouseState = MaterialSkin.MouseState.HOVER; this.materialLabel3.Name = "materialLabel3"; - this.materialLabel3.Size = new System.Drawing.Size(162, 18); + this.materialLabel3.Size = new System.Drawing.Size(165, 19); this.materialLabel3.TabIndex = 6; this.materialLabel3.Text = "Version : 2018.01.04.12"; // @@ -923,12 +1163,12 @@ // this.materialLabel2.AutoSize = true; this.materialLabel2.Depth = 0; - this.materialLabel2.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + 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(21, 18); + this.materialLabel2.Size = new System.Drawing.Size(20, 19); this.materialLabel2.TabIndex = 5; this.materialLabel2.Text = "회"; // @@ -952,12 +1192,12 @@ // this.materialLabel1.AutoSize = true; this.materialLabel1.Depth = 0; - this.materialLabel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); + 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(62, 18); + this.materialLabel1.Size = new System.Drawing.Size(65, 19); this.materialLabel1.TabIndex = 3; this.materialLabel1.Text = "Account"; // @@ -1032,7 +1272,7 @@ // this.chSMHalfTrailing.AutoSize = true; this.chSMHalfTrailing.Depth = 0; - this.chSMHalfTrailing.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); + this.chSMHalfTrailing.Font = new System.Drawing.Font("Roboto", 10F); this.chSMHalfTrailing.Location = new System.Drawing.Point(516, 116); this.chSMHalfTrailing.Margin = new System.Windows.Forms.Padding(0); this.chSMHalfTrailing.MouseLocation = new System.Drawing.Point(-1, -1); @@ -1181,214 +1421,6 @@ this.btLoad.UseVisualStyleBackColor = true; this.btLoad.Click += new System.EventHandler(this.btLoad_Click); // - // columnHeader6 - // - this.columnHeader6.Text = "정산금액"; - // - // columnHeader7 - // - this.columnHeader7.Text = "수수료"; - // - // columnHeader8 - // - this.columnHeader8.Text = "거래세"; - // - // columnHeader9 - // - this.columnHeader9.Text = "농특세"; - // - // columnHeader10 - // - this.columnHeader10.Text = "날짜"; - // - // 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.chCheckCountLimit, - this.chCheckCount}); - this.lvItems.Dock = System.Windows.Forms.DockStyle.Fill; - this.lvItems.FullRowSelect = true; - this.lvItems.GridLines = true; - this.lvItems.Location = new System.Drawing.Point(0, 0); - this.lvItems.Name = "lvItems"; - this.lvItems.Size = new System.Drawing.Size(859, 273); - this.lvItems.TabIndex = 0; - this.lvItems.UseCompatibleStateImageBehavior = false; - this.lvItems.View = System.Windows.Forms.View.Details; - this.lvItems.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lvItems_ColumnClick); - this.lvItems.SelectedIndexChanged += new System.EventHandler(this.lvList_SelectedIndexChanged); - // - // chCode - // - this.chCode.Text = "코드"; - this.chCode.Width = 77; - // - // chCodeName - // - this.chCodeName.Text = "종목명"; - this.chCodeName.Width = 86; - // - // chCurPrice - // - this.chCurPrice.Text = "현재가"; - this.chCurPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.chCurPrice.Width = 71; - // - // chCount - // - this.chCount.Text = "잔고수량"; - this.chCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // chBookValue - // - this.chBookValue.Text = "장부가"; - this.chBookValue.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.chBookValue.Width = 72; - // - // chCapitalGains - // - this.chCapitalGains.Text = "손익단가"; - this.chCapitalGains.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.chCapitalGains.Width = 73; - // - // chAssessedValue - // - this.chAssessedValue.Text = "평가금액"; - this.chAssessedValue.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.chAssessedValue.Width = 76; - // - // chValuation - // - this.chValuation.Text = "평가손익"; - this.chValuation.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.chValuation.Width = 79; - // - // chYield - // - this.chYield.Text = "수익률"; - this.chYield.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.chYield.Width = 79; - // - // chMaxPrice - // - this.chMaxPrice.Text = "최고가"; - this.chMaxPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // chCheckCountLimit - // - this.chCheckCountLimit.Text = "조건제한"; - this.chCheckCountLimit.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // chCheckCount - // - this.chCheckCount.Text = "조건횟수"; - this.chCheckCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // lvNCItem - // - this.lvNCItem.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.chNCOrderNo, - this.chNCOrgOrderNo, - 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; - this.lvNCItem.Location = new System.Drawing.Point(0, 0); - this.lvNCItem.Name = "lvNCItem"; - this.lvNCItem.Size = new System.Drawing.Size(772, 138); - this.lvNCItem.TabIndex = 1; - this.lvNCItem.UseCompatibleStateImageBehavior = false; - this.lvNCItem.View = System.Windows.Forms.View.Details; - this.lvNCItem.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lvNCItem_ColumnClick); - // - // chNCOrderNo - // - this.chNCOrderNo.Text = "주문번호"; - // - // chNCOrgOrderNo - // - this.chNCOrgOrderNo.Text = "원주문번호"; - this.chNCOrgOrderNo.Width = 91; - // - // chNCCode - // - this.chNCCode.Text = "코드"; - this.chNCCode.Width = 77; - // - // chNCCodeName - // - this.chNCCodeName.Text = "종목명"; - this.chNCCodeName.Width = 101; - // - // chNCType - // - this.chNCType.Text = "매매구분"; - this.chNCType.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.chNCType.Width = 106; - // - // chNCPrice - // - this.chNCPrice.Text = "주문단가"; - this.chNCPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.chNCPrice.Width = 72; - // - // chNCCount - // - this.chNCCount.Text = "미체결량"; - this.chNCCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // lvCurPrice - // - this.lvCurPrice.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader1, - this.chAskCount, - this.chCallPrice, - this.chBidCount}); - this.lvCurPrice.Dock = System.Windows.Forms.DockStyle.Fill; - this.lvCurPrice.FullRowSelect = true; - this.lvCurPrice.GridLines = true; - this.lvCurPrice.Location = new System.Drawing.Point(0, 0); - this.lvCurPrice.Name = "lvCurPrice"; - this.lvCurPrice.Size = new System.Drawing.Size(264, 598); - this.lvCurPrice.TabIndex = 0; - this.lvCurPrice.UseCompatibleStateImageBehavior = false; - this.lvCurPrice.View = System.Windows.Forms.View.Details; - // - // columnHeader1 - // - this.columnHeader1.Width = 10; - // - // chAskCount - // - this.chAskCount.Text = "매도잔량"; - this.chAskCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.chAskCount.Width = 75; - // - // chCallPrice - // - this.chCallPrice.Text = "호가"; - this.chCallPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // chBidCount - // - this.chBidCount.Text = "매수잔량"; - this.chBidCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.chBidCount.Width = 75; - // // AutoSeller // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); @@ -1535,5 +1567,7 @@ private System.Windows.Forms.ColumnHeader columnHeader8; private System.Windows.Forms.ColumnHeader columnHeader9; private System.Windows.Forms.ColumnHeader columnHeader10; + private MaterialSkin.Controls.MaterialRaisedButton btClearBeforeClosing; + private MaterialSkin.Controls.MaterialRaisedButton btCancel; } } \ No newline at end of file diff --git a/AutoSeller.cs b/AutoSeller.cs index 7cb2276..2f140fb 100644 --- a/AutoSeller.cs +++ b/AutoSeller.cs @@ -67,6 +67,7 @@ namespace AutoSellerNS List m_NCItems = new List(); string m_strSelectedCode = ""; bool m_bSell = false; + bool m_bClearBeforeClosing = false; System.Timers.Timer m_Timer = new System.Timers.Timer(); @@ -339,6 +340,21 @@ namespace AutoSellerNS } } + private async void ClearBeforeClsosingProc() + { + if(DateTime.Now >= m_CybosHelper.GetMarketEndTime()-TimeSpan.FromMinutes(10)) + { + // 미체결 모두 취소 + foreach (var ncitem in m_NCItems) + await m_CybosHelper.CancelItem(ncitem.m_strCode, ncitem.m_iOrgOrderNo); + + // 잔량 모두 시장가로 매도 + foreach (var item in m_Items) + await m_CybosHelper.SellItem(item.m_strCode, item.m_iAvailableQuantity); + } + + } + private async void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { await CorrectItems(); @@ -352,6 +368,9 @@ namespace AutoSellerNS lbSBCnt.Invoke(new Action(delegate { lbSBCnt.Text = $"{m_CybosHelper.GetLimitRemainCountSB(), 3}"; })); + + if(m_bClearBeforeClosing == true) + ClearBeforeClsosingProc(); } private void btUpdate_Click(object sender, EventArgs e) @@ -455,6 +474,40 @@ namespace AutoSellerNS return m_bSell; } + private void btClearBeforeClosing_Click(object sender, EventArgs e) + { + btClearBeforeClosing.Primary = !btClearBeforeClosing.Primary; + m_bClearBeforeClosing = (btClearBeforeClosing.Primary == false); + } + + private async void btClearAll_Click(object sender, EventArgs e) + { + List cloned; + lock (m_Items) + cloned = m_Items.ConvertAll(s => s); + foreach (var item in cloned) + { + await m_CybosHelper.SellItem(item.m_strCode, item.m_iItemCnt); + } + } + + private void btUpdateNC_Click(object sender, EventArgs e) + { + UpdateNCItem(); + } + + private async void btCancel_Click(object sender, EventArgs e) + { + foreach(ListViewItem nc in lvNCItem.SelectedItems) + { + string strCode = nc.SubItems[chNCCode.Index].Text; + string strOrgOrderNo = nc.SubItems[chNCOrgOrderNo.Index].Text; + int iOrgOrderNo = int.Parse(strOrgOrderNo); + + await m_CybosHelper.CancelItem(strCode, iOrgOrderNo); + } + } + public void OnReceivedCurPrice(string strCode, int iPrice, int iMaxPrice, double dCheckCountLimit, int iCheckCount, bool bReal) { ITEM Item = m_Items.FirstOrDefault(s => s.m_strCode == strCode); @@ -639,11 +692,6 @@ namespace AutoSellerNS SimulationHelper helper = new SimulationHelper(this, m_CybosHelper, tbSimulationLog); helper.StartSimuation2(); } - - private void btUpdateNC_Click(object sender, EventArgs e) - { - UpdateNCItem(); - } #endregion private void lvItems_ColumnClick(object sender, ColumnClickEventArgs e) @@ -664,17 +712,6 @@ namespace AutoSellerNS lvNCItem.Sort(); } - private async void btClearAll_Click(object sender, EventArgs e) - { - List cloned; - lock (m_Items) - cloned = m_Items.ConvertAll(s => s); - foreach(var item in cloned) - { - await m_CybosHelper.SellItem(item.m_strCode, item.m_iItemCnt); - } - } - private void btUpdateConclusion_Click(object sender, EventArgs e) { m_CybosHelper.GetConclusion(); diff --git a/CybosHelper.cs b/CybosHelper.cs index 18dc2d8..19d40dc 100644 --- a/CybosHelper.cs +++ b/CybosHelper.cs @@ -14,6 +14,7 @@ namespace AutoSellerNS AutoSeller m_Listener = null; CPUTILLib.CpCybos m_CPCybos = new CPUTILLib.CpCybos(); + CPUTILLib.CpCodeMgr m_CPCodeMgr = new CPUTILLib.CpCodeMgr(); CPFORETRADELib.CpForeTdUtil m_CPUtil = new CPFORETRADELib.CpForeTdUtil(); DSCBO1Lib.CpConclusion m_CpConclusion = new DSCBO1Lib.CpConclusion(); @@ -28,6 +29,10 @@ namespace AutoSellerNS ConcurrentDictionary m_SellingCode = new ConcurrentDictionary(); ConcurrentDictionary m_ItemsInCorrection = new ConcurrentDictionary(); + ConcurrentQueue m_TRQueue = new ConcurrentQueue(); + + DateTime m_MarketStartTime; + DateTime m_MarketEndTime; public CybosHelper(AutoSeller Listener) { @@ -65,7 +70,14 @@ namespace AutoSellerNS m_Listener.SetAccountList(m_CPUtil.AccountNumber); m_CpConclusion.Received += CpConclusion_Received; m_CpConclusion.Subscribe(); - } + + int iStartTime = (int)m_CPCodeMgr.GetMarketStartTime(); + int iEndTime = (int)m_CPCodeMgr.GetMarketEndTime(); + + m_MarketStartTime = DateTime.Parse(string.Format("{0:00}:{1:00}:{2:00}", iStartTime/100, iStartTime%100, 0)); + m_MarketEndTime = DateTime.Parse(string.Format("{0:00}:{1:00}:{2:00}", iEndTime / 100, iEndTime % 100, 0)); + + } public async Task InitCybosAsync() { @@ -118,23 +130,32 @@ namespace AutoSellerNS } } - int iTdDibWaitCnt = 0; - ConcurrentQueue m_TRQueue = new ConcurrentQueue(); + void BlockRequestTRProc() + { + if (m_TRQueue.Count == 0) + return; + + lock (m_RequestTRLock) + { + CPTRADELib.ICpTdDib tr; + bool bContinue = true; + while (bContinue == true && m_TRQueue.TryDequeue(out tr) == true && GetLimitRemainCountTrade() > 0) + { + var ret = tr.BlockRequest2(0); + if (ret == -1) + Util.Log(Util.LOG_TYPE.DEBUG, "BlockRequest TR 오류"); + else if (ret == 1) + Util.Log(Util.LOG_TYPE.DEBUG, "BlockRequest TR 수신대기"); + bContinue = (ret == 0); + } + } + } + //int iTdDibWaitCnt = 0; void BlockRequest(CPTRADELib.ICpTdDib dib) { m_TRQueue.Enqueue(dib); - CPTRADELib.ICpTdDib tr; - bool bContinue = true; - while(bContinue == true && m_TRQueue.TryDequeue(out tr) == true) - { - var ret = tr.BlockRequest2(0); - if (ret == -1) - Util.Log(Util.LOG_TYPE.DEBUG, "BlockRequest TR 오류"); - else if (ret == 1) - Util.Log(Util.LOG_TYPE.DEBUG, "BlockRequest TR 수신대기"); - bContinue = (ret == 0); - } + BlockRequestTRProc(); ////lock (m_RequestTRLock) //{ @@ -458,6 +479,16 @@ namespace AutoSellerNS return (iValue/iUnit)*iUnit; } + public DateTime GetMarketStartTime() + { + return m_MarketStartTime; + } + + public DateTime GetMarketEndTime() + { + return m_MarketEndTime; + } + public async Task SellItem(string strCode, int iCnt, int iAskPrice) { if (iCnt <= 0 || m_SellingCode.ContainsKey(strCode) == true) @@ -486,9 +517,11 @@ namespace AutoSellerNS public async Task SellItem(string strCode, int iCnt) { - if (iCnt <= 0) + if (iCnt <= 0 || m_SellingCode.ContainsKey(strCode) == true) return; + m_SellingCode.TryAdd(strCode, 0); + await Task.Run(() => { CPTRADELib.CpTd0311 Td0311 = new CPTRADELib.CpTd0311(); @@ -499,6 +532,9 @@ namespace AutoSellerNS Td0311.SetInputValue(4, iCnt); Td0311.SetInputValue(8, "03"); BlockRequest(Td0311); + + int val; + m_SellingCode.TryRemove(strCode, out val); }); }