From 9906692fee5d6724157a334252a36ad63c7bf1d8 Mon Sep 17 00:00:00 2001 From: kyh <1329522@naver.com> Date: Fri, 21 Oct 2022 10:47:32 +0900 Subject: [PATCH] =?UTF-8?q?Tick=20list=20=EA=B4=80=EB=A0=A8=20=EA=B3=BC?= =?UTF-8?q?=EB=B6=80=ED=95=98=20=EB=A1=9C=EC=A7=81=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Million Buyer/MainForm.Designer.cs | 75 ++++++++++++++----- Million Buyer/MainForm.cs | 19 ++++- Million/Manager/RealtimeDataSettingManager.cs | 4 +- 3 files changed, 76 insertions(+), 22 deletions(-) diff --git a/Million Buyer/MainForm.Designer.cs b/Million Buyer/MainForm.Designer.cs index d586bef..b5a9529 100644 --- a/Million Buyer/MainForm.Designer.cs +++ b/Million Buyer/MainForm.Designer.cs @@ -34,21 +34,21 @@ this.lb_IndiName = new System.Windows.Forms.Label(); this.bt_Modify = new System.Windows.Forms.Button(); this.label6 = new System.Windows.Forms.Label(); + this.lb_TotalMoney = new System.Windows.Forms.Label(); this.tb_CycleMoneyValue = new System.Windows.Forms.TextBox(); this.tb_CycleCount = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.lb_StartDate = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); this.lb_TotalMoneyValue = new System.Windows.Forms.Label(); this.lb_TotalRate = new System.Windows.Forms.Label(); this.lb_BuyMarketCount = new System.Windows.Forms.Label(); - this.lb_TotalMoney = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); this.bt_Start = new System.Windows.Forms.Button(); this.bt_Stop = new System.Windows.Forms.Button(); this.rd_Realtime = new System.Windows.Forms.RadioButton(); @@ -88,6 +88,9 @@ this.Volume = new DevExpress.XtraTreeList.Columns.TreeListColumn(); this.ExecutedVolume = new DevExpress.XtraTreeList.Columns.TreeListColumn(); this.CreateOrderTime = new DevExpress.XtraTreeList.Columns.TreeListColumn(); + this.bt_BuyStop = new System.Windows.Forms.Button(); + this.bt_BuyStart = new System.Windows.Forms.Button(); + this.lb_BuyFlag = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.tl_BuyList)).BeginInit(); @@ -167,6 +170,14 @@ this.label6.TabIndex = 4; this.label6.Text = "조건식"; // + // lb_TotalMoney + // + this.lb_TotalMoney.AutoSize = true; + this.lb_TotalMoney.Location = new System.Drawing.Point(146, 21); + this.lb_TotalMoney.Name = "lb_TotalMoney"; + this.lb_TotalMoney.Size = new System.Drawing.Size(0, 12); + this.lb_TotalMoney.TabIndex = 4; + // // tb_CycleMoneyValue // this.tb_CycleMoneyValue.Location = new System.Drawing.Point(142, 74); @@ -201,6 +212,15 @@ this.label1.TabIndex = 0; this.label1.Text = "한번에 구입 할 종목 수"; // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(47, 21); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(89, 12); + this.label4.TabIndex = 0; + this.label4.Text = "계정 내 총 금액"; + // // groupBox2 // this.groupBox2.Controls.Add(this.lb_StartDate); @@ -259,14 +279,6 @@ this.lb_BuyMarketCount.Size = new System.Drawing.Size(0, 12); this.lb_BuyMarketCount.TabIndex = 5; // - // lb_TotalMoney - // - this.lb_TotalMoney.AutoSize = true; - this.lb_TotalMoney.Location = new System.Drawing.Point(146, 21); - this.lb_TotalMoney.Name = "lb_TotalMoney"; - this.lb_TotalMoney.Size = new System.Drawing.Size(0, 12); - this.lb_TotalMoney.TabIndex = 4; - // // label7 // this.label7.AutoSize = true; @@ -294,15 +306,6 @@ this.label3.TabIndex = 1; this.label3.Text = "구입 종목 수"; // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(47, 21); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(89, 12); - this.label4.TabIndex = 0; - this.label4.Text = "계정 내 총 금액"; - // // bt_Start // this.bt_Start.Location = new System.Drawing.Point(1441, 737); @@ -672,11 +675,42 @@ this.CreateOrderTime.Visible = true; this.CreateOrderTime.VisibleIndex = 7; // + // bt_BuyStop + // + this.bt_BuyStop.Location = new System.Drawing.Point(211, 737); + this.bt_BuyStop.Name = "bt_BuyStop"; + this.bt_BuyStop.Size = new System.Drawing.Size(76, 23); + this.bt_BuyStop.TabIndex = 19; + this.bt_BuyStop.Text = "매수 Stop"; + this.bt_BuyStop.UseVisualStyleBackColor = true; + this.bt_BuyStop.Click += new System.EventHandler(this.bt_BuyStop_Click); + // + // bt_BuyStart + // + this.bt_BuyStart.Location = new System.Drawing.Point(293, 737); + this.bt_BuyStart.Name = "bt_BuyStart"; + this.bt_BuyStart.Size = new System.Drawing.Size(81, 23); + this.bt_BuyStart.TabIndex = 20; + this.bt_BuyStart.Text = "매수 Start"; + this.bt_BuyStart.UseVisualStyleBackColor = true; + this.bt_BuyStart.Click += new System.EventHandler(this.bt_BuyStart_Click); + // + // lb_BuyFlag + // + this.lb_BuyFlag.AutoSize = true; + this.lb_BuyFlag.Location = new System.Drawing.Point(380, 742); + this.lb_BuyFlag.Name = "lb_BuyFlag"; + this.lb_BuyFlag.Size = new System.Drawing.Size(0, 12); + this.lb_BuyFlag.TabIndex = 21; + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1609, 776); + this.Controls.Add(this.lb_BuyFlag); + this.Controls.Add(this.bt_BuyStart); + this.Controls.Add(this.bt_BuyStop); this.Controls.Add(this.label13); this.Controls.Add(this.tl_RealtimeOrder); this.Controls.Add(this.groupBox3); @@ -769,6 +803,9 @@ private DevExpress.XtraTreeList.Columns.TreeListColumn Volume; private DevExpress.XtraTreeList.Columns.TreeListColumn ExecutedVolume; private DevExpress.XtraTreeList.Columns.TreeListColumn CreateOrderTime; + private System.Windows.Forms.Button bt_BuyStop; + private System.Windows.Forms.Button bt_BuyStart; + private System.Windows.Forms.Label lb_BuyFlag; } } diff --git a/Million Buyer/MainForm.cs b/Million Buyer/MainForm.cs index af5bdca..12d1e1f 100644 --- a/Million Buyer/MainForm.cs +++ b/Million Buyer/MainForm.cs @@ -46,6 +46,8 @@ namespace Million_Buyer private int buyCycleCount = 0; + private bool buyFlag = true; + public MainForm() { InitializeComponent(); @@ -78,7 +80,7 @@ namespace Million_Buyer cb_UserList.Items.Add("김영호"); cb_UserList.Items.Add("이찬균"); - cb_UserList.SelectedIndex = 0; + //cb_UserList.SelectedIndex = 0; } /// @@ -221,6 +223,7 @@ namespace Million_Buyer this.BeginInvoke(new Action(delegate () { + tl_RealtimeOrder.Nodes.Clear(); foreach (var item in orderList) { tl_RealtimeOrder.AppendNode(new object[] @@ -410,6 +413,8 @@ namespace Million_Buyer //없을 시 -> BUY if (!buyList.Any(t => t.ConGoodsData.CoinFullName == item)) { + if (!buyFlag) continue; + var flag = buyScript.DicExcuteScript(recentlyData.CalculateFlag); if (flag) { @@ -855,6 +860,18 @@ namespace Million_Buyer lb_TotalMoney.Text = account.Balance.ToString() + subStr; } } + + private void bt_BuyStop_Click(object sender, EventArgs e) + { + buyFlag = false; + lb_BuyFlag.Text = "매수 정지"; + } + + private void bt_BuyStart_Click(object sender, EventArgs e) + { + buyFlag = true; + lb_BuyFlag.Text = "매수 진행 중"; + } } } diff --git a/Million/Manager/RealtimeDataSettingManager.cs b/Million/Manager/RealtimeDataSettingManager.cs index 638818f..0f8d811 100644 --- a/Million/Manager/RealtimeDataSettingManager.cs +++ b/Million/Manager/RealtimeDataSettingManager.cs @@ -340,8 +340,8 @@ namespace Million.Manager { lock (obj) { - if (tickerList.Count > 3600) - tickerList.RemoveRange(0, 1200); + if (tickerList.Count > 200) + tickerList.RemoveRange(0, tickerList.Count - 100); } }