diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index 984ced0..111a088 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -28,441 +28,441 @@ /// private void InitializeComponent() { - this.tbLog = new System.Windows.Forms.TextBox(); - this.tbSearchMax = new System.Windows.Forms.TextBox(); - this.tbBidMin = new System.Windows.Forms.TextBox(); - this.tbBidAmount = new System.Windows.Forms.TextBox(); - this.tbTimeout = new System.Windows.Forms.TextBox(); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.tbTrailing = new System.Windows.Forms.TextBox(); - this.label5 = new System.Windows.Forms.Label(); - this.tbLossCut = new System.Windows.Forms.TextBox(); - this.label6 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.tbSearchMin = new System.Windows.Forms.TextBox(); - this.btApply = new System.Windows.Forms.Button(); - this.btCancel = new System.Windows.Forms.Button(); - this.tbBidMax = new System.Windows.Forms.TextBox(); - this.label8 = new System.Windows.Forms.Label(); - this.btBalance = new System.Windows.Forms.Button(); - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.splitContainer2 = new System.Windows.Forms.SplitContainer(); - this.splitContainer3 = new System.Windows.Forms.SplitContainer(); - this.btTimeSync = new System.Windows.Forms.Button(); - this.cbStart = new System.Windows.Forms.CheckBox(); - this.btCybosPlus = new System.Windows.Forms.Button(); - this.btCybos5 = new System.Windows.Forms.Button(); - this.lbSBCnt = new System.Windows.Forms.Label(); - this.lbRQCnt = new System.Windows.Forms.Label(); - this.statusBar1 = new System.Windows.Forms.StatusBar(); - this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel(); - this.statusBarPanel2 = new System.Windows.Forms.StatusBarPanel(); - this.button1 = new System.Windows.Forms.Button(); - this.btMATest = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); - this.splitContainer1.Panel1.SuspendLayout(); - this.splitContainer1.Panel2.SuspendLayout(); - this.splitContainer1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); - this.splitContainer2.Panel1.SuspendLayout(); - this.splitContainer2.Panel2.SuspendLayout(); - this.splitContainer2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit(); - this.splitContainer3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).BeginInit(); - this.SuspendLayout(); - // - // tbLog - // - this.tbLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.tbLog = new System.Windows.Forms.TextBox(); + this.tbSearchMax = new System.Windows.Forms.TextBox(); + this.tbBidMin = new System.Windows.Forms.TextBox(); + this.tbBidAmount = new System.Windows.Forms.TextBox(); + this.tbTimeout = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.tbTrailing = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.tbLossCut = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.tbSearchMin = new System.Windows.Forms.TextBox(); + this.btApply = new System.Windows.Forms.Button(); + this.btCancel = new System.Windows.Forms.Button(); + this.tbBidMax = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + this.btBalance = new System.Windows.Forms.Button(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.splitContainer3 = new System.Windows.Forms.SplitContainer(); + this.btMATest = new System.Windows.Forms.Button(); + this.button1 = new System.Windows.Forms.Button(); + this.btTimeSync = new System.Windows.Forms.Button(); + this.cbStart = new System.Windows.Forms.CheckBox(); + this.btCybosPlus = new System.Windows.Forms.Button(); + this.btCybos5 = new System.Windows.Forms.Button(); + this.lbSBCnt = new System.Windows.Forms.Label(); + this.lbRQCnt = new System.Windows.Forms.Label(); + this.statusBar1 = new System.Windows.Forms.StatusBar(); + this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel(); + this.statusBarPanel2 = new System.Windows.Forms.StatusBarPanel(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); + this.splitContainer2.Panel1.SuspendLayout(); + this.splitContainer2.Panel2.SuspendLayout(); + this.splitContainer2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit(); + this.splitContainer3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).BeginInit(); + this.SuspendLayout(); + // + // tbLog + // + this.tbLog.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.tbLog.BackColor = System.Drawing.SystemColors.Control; - this.tbLog.HideSelection = false; - this.tbLog.Location = new System.Drawing.Point(12, 3); - this.tbLog.Multiline = true; - this.tbLog.Name = "tbLog"; - this.tbLog.ReadOnly = true; - this.tbLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.tbLog.Size = new System.Drawing.Size(862, 84); - this.tbLog.TabIndex = 2; - // - // tbSearchMax - // - this.tbSearchMax.Location = new System.Drawing.Point(160, 23); - this.tbSearchMax.Name = "tbSearchMax"; - this.tbSearchMax.Size = new System.Drawing.Size(37, 21); - this.tbSearchMax.TabIndex = 6; - this.tbSearchMax.Text = "10.5%"; - this.tbSearchMax.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // tbBidMin - // - this.tbBidMin.Location = new System.Drawing.Point(97, 50); - this.tbBidMin.Name = "tbBidMin"; - this.tbBidMin.Size = new System.Drawing.Size(37, 21); - this.tbBidMin.TabIndex = 8; - this.tbBidMin.Text = "9.0%"; - this.tbBidMin.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // tbBidAmount - // - this.tbBidAmount.Location = new System.Drawing.Point(97, 77); - this.tbBidAmount.Name = "tbBidAmount"; - this.tbBidAmount.Size = new System.Drawing.Size(100, 21); - this.tbBidAmount.TabIndex = 9; - this.tbBidAmount.Text = "100,000"; - this.tbBidAmount.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // tbTimeout - // - this.tbTimeout.Location = new System.Drawing.Point(97, 104); - this.tbTimeout.Name = "tbTimeout"; - this.tbTimeout.Size = new System.Drawing.Size(100, 21); - this.tbTimeout.TabIndex = 10; - this.tbTimeout.Text = "120"; - this.tbTimeout.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(38, 26); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(53, 12); - this.label1.TabIndex = 11; - this.label1.Text = "검색범위"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(38, 53); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(53, 12); - this.label2.TabIndex = 12; - this.label2.Text = "매수범위"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(38, 80); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(41, 12); - this.label3.TabIndex = 13; - this.label3.Text = "매수금"; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(38, 107); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(53, 12); - this.label4.TabIndex = 13; - this.label4.Text = "타임아웃"; - // - // tbTrailing - // - this.tbTrailing.Location = new System.Drawing.Point(97, 131); - this.tbTrailing.Name = "tbTrailing"; - this.tbTrailing.Size = new System.Drawing.Size(100, 21); - this.tbTrailing.TabIndex = 10; - this.tbTrailing.Text = "3.0%"; - this.tbTrailing.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(38, 134); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(53, 12); - this.label5.TabIndex = 13; - this.label5.Text = "트레일링"; - // - // tbLossCut - // - this.tbLossCut.Location = new System.Drawing.Point(97, 158); - this.tbLossCut.Name = "tbLossCut"; - this.tbLossCut.Size = new System.Drawing.Size(100, 21); - this.tbLossCut.TabIndex = 10; - this.tbLossCut.Text = "3.0%"; - this.tbLossCut.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // label6 - // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(38, 161); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(29, 12); - this.label6.TabIndex = 13; - this.label6.Text = "손절"; - // - // label7 - // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(140, 26); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(14, 12); - this.label7.TabIndex = 11; - this.label7.Text = "~"; - // - // tbSearchMin - // - this.tbSearchMin.Location = new System.Drawing.Point(97, 23); - this.tbSearchMin.Name = "tbSearchMin"; - this.tbSearchMin.Size = new System.Drawing.Size(37, 21); - this.tbSearchMin.TabIndex = 14; - this.tbSearchMin.Text = "7.0%"; - this.tbSearchMin.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // btApply - // - this.btApply.Location = new System.Drawing.Point(97, 185); - this.btApply.Name = "btApply"; - this.btApply.Size = new System.Drawing.Size(44, 23); - this.btApply.TabIndex = 15; - this.btApply.Text = "적용"; - this.btApply.UseVisualStyleBackColor = true; - this.btApply.Click += new System.EventHandler(this.btApply_Click); - // - // btCancel - // - this.btCancel.Location = new System.Drawing.Point(153, 185); - this.btCancel.Name = "btCancel"; - this.btCancel.Size = new System.Drawing.Size(44, 23); - this.btCancel.TabIndex = 16; - this.btCancel.Text = "취소"; - this.btCancel.UseVisualStyleBackColor = true; - this.btCancel.Click += new System.EventHandler(this.btCancel_Click); - // - // tbBidMax - // - this.tbBidMax.Location = new System.Drawing.Point(160, 50); - this.tbBidMax.Name = "tbBidMax"; - this.tbBidMax.Size = new System.Drawing.Size(37, 21); - this.tbBidMax.TabIndex = 8; - this.tbBidMax.Text = "10.0%"; - this.tbBidMax.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // label8 - // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(140, 53); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(14, 12); - this.label8.TabIndex = 11; - this.label8.Text = "~"; - // - // btBalance - // - this.btBalance.Location = new System.Drawing.Point(122, 214); - this.btBalance.Name = "btBalance"; - this.btBalance.Size = new System.Drawing.Size(75, 23); - this.btBalance.TabIndex = 17; - this.btBalance.Text = "잔고"; - this.btBalance.UseVisualStyleBackColor = true; - // - // splitContainer1 - // - this.splitContainer1.Location = new System.Drawing.Point(0, 0); - this.splitContainer1.Name = "splitContainer1"; - this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer1.Panel1 - // - this.splitContainer1.Panel1.Controls.Add(this.splitContainer2); - // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.Controls.Add(this.tbLog); - this.splitContainer1.Size = new System.Drawing.Size(886, 714); - this.splitContainer1.SplitterDistance = 611; - this.splitContainer1.TabIndex = 20; - // - // splitContainer2 - // - this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer2.Location = new System.Drawing.Point(0, 0); - this.splitContainer2.Name = "splitContainer2"; - // - // splitContainer2.Panel1 - // - this.splitContainer2.Panel1.Controls.Add(this.splitContainer3); - // - // splitContainer2.Panel2 - // - this.splitContainer2.Panel2.Controls.Add(this.btMATest); - this.splitContainer2.Panel2.Controls.Add(this.button1); - this.splitContainer2.Panel2.Controls.Add(this.btTimeSync); - this.splitContainer2.Panel2.Controls.Add(this.cbStart); - this.splitContainer2.Panel2.Controls.Add(this.btCybosPlus); - this.splitContainer2.Panel2.Controls.Add(this.btCybos5); - this.splitContainer2.Panel2.Controls.Add(this.lbSBCnt); - this.splitContainer2.Panel2.Controls.Add(this.lbRQCnt); - this.splitContainer2.Panel2.Controls.Add(this.btBalance); - this.splitContainer2.Panel2.Controls.Add(this.label1); - this.splitContainer2.Panel2.Controls.Add(this.label5); - this.splitContainer2.Panel2.Controls.Add(this.tbTimeout); - this.splitContainer2.Panel2.Controls.Add(this.tbSearchMax); - this.splitContainer2.Panel2.Controls.Add(this.label7); - this.splitContainer2.Panel2.Controls.Add(this.btCancel); - this.splitContainer2.Panel2.Controls.Add(this.label6); - this.splitContainer2.Panel2.Controls.Add(this.label2); - this.splitContainer2.Panel2.Controls.Add(this.label4); - this.splitContainer2.Panel2.Controls.Add(this.tbBidMin); - this.splitContainer2.Panel2.Controls.Add(this.tbBidAmount); - this.splitContainer2.Panel2.Controls.Add(this.tbLossCut); - this.splitContainer2.Panel2.Controls.Add(this.label8); - this.splitContainer2.Panel2.Controls.Add(this.btApply); - this.splitContainer2.Panel2.Controls.Add(this.tbSearchMin); - this.splitContainer2.Panel2.Controls.Add(this.tbTrailing); - this.splitContainer2.Panel2.Controls.Add(this.label3); - this.splitContainer2.Panel2.Controls.Add(this.tbBidMax); - this.splitContainer2.Size = new System.Drawing.Size(886, 611); - this.splitContainer2.SplitterDistance = 645; - this.splitContainer2.TabIndex = 0; - // - // splitContainer3 - // - this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer3.Location = new System.Drawing.Point(0, 0); - this.splitContainer3.Name = "splitContainer3"; - this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal; - this.splitContainer3.Size = new System.Drawing.Size(645, 611); - this.splitContainer3.SplitterDistance = 256; - this.splitContainer3.TabIndex = 0; - // - // btTimeSync - // - this.btTimeSync.Location = new System.Drawing.Point(16, 341); - this.btTimeSync.Name = "btTimeSync"; - this.btTimeSync.Size = new System.Drawing.Size(84, 57); - this.btTimeSync.TabIndex = 22; - this.btTimeSync.Text = "Time Sync"; - this.btTimeSync.UseVisualStyleBackColor = true; - this.btTimeSync.Click += new System.EventHandler(this.btTimeSync_Click); - // - // cbStart - // - this.cbStart.Appearance = System.Windows.Forms.Appearance.Button; - this.cbStart.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.cbStart.Location = new System.Drawing.Point(16, 404); - this.cbStart.Name = "cbStart"; - this.cbStart.Size = new System.Drawing.Size(84, 57); - this.cbStart.TabIndex = 21; - this.cbStart.Text = "Start"; - this.cbStart.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.cbStart.UseVisualStyleBackColor = true; - this.cbStart.CheckedChanged += new System.EventHandler(this.cbStart_CheckedChanged); - // - // btCybosPlus - // - this.btCybosPlus.Location = new System.Drawing.Point(113, 467); - this.btCybosPlus.Name = "btCybosPlus"; - this.btCybosPlus.Size = new System.Drawing.Size(84, 67); - this.btCybosPlus.TabIndex = 20; - this.btCybosPlus.Text = "Cybos Plus"; - this.btCybosPlus.UseVisualStyleBackColor = true; - this.btCybosPlus.Click += new System.EventHandler(this.btCybosPlus_Click); - // - // btCybos5 - // - this.btCybos5.Location = new System.Drawing.Point(16, 467); - this.btCybos5.Name = "btCybos5"; - this.btCybos5.Size = new System.Drawing.Size(84, 67); - this.btCybos5.TabIndex = 20; - this.btCybos5.Text = "Cybos 5"; - this.btCybos5.UseVisualStyleBackColor = true; - this.btCybos5.Click += new System.EventHandler(this.btCybos5_Click); - // - // lbSBCnt - // - this.lbSBCnt.AutoSize = true; - this.lbSBCnt.Location = new System.Drawing.Point(29, 278); - this.lbSBCnt.Name = "lbSBCnt"; - this.lbSBCnt.Size = new System.Drawing.Size(70, 12); - this.lbSBCnt.TabIndex = 19; - this.lbSBCnt.Text = "SB Count : "; - // - // lbRQCnt - // - this.lbRQCnt.AutoSize = true; - this.lbRQCnt.Location = new System.Drawing.Point(29, 254); - this.lbRQCnt.Name = "lbRQCnt"; - this.lbRQCnt.Size = new System.Drawing.Size(71, 12); - this.lbRQCnt.TabIndex = 18; - this.lbRQCnt.Text = "RQ Count : "; - // - // statusBar1 - // - this.statusBar1.Location = new System.Drawing.Point(0, 720); - this.statusBar1.Name = "statusBar1"; - this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] { + this.tbLog.BackColor = System.Drawing.SystemColors.Control; + this.tbLog.HideSelection = false; + this.tbLog.Location = new System.Drawing.Point(12, 3); + this.tbLog.Multiline = true; + this.tbLog.Name = "tbLog"; + this.tbLog.ReadOnly = true; + this.tbLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.tbLog.Size = new System.Drawing.Size(862, 84); + this.tbLog.TabIndex = 2; + // + // tbSearchMax + // + this.tbSearchMax.Location = new System.Drawing.Point(160, 23); + this.tbSearchMax.Name = "tbSearchMax"; + this.tbSearchMax.Size = new System.Drawing.Size(37, 21); + this.tbSearchMax.TabIndex = 6; + this.tbSearchMax.Text = "10.5%"; + this.tbSearchMax.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // tbBidMin + // + this.tbBidMin.Location = new System.Drawing.Point(97, 50); + this.tbBidMin.Name = "tbBidMin"; + this.tbBidMin.Size = new System.Drawing.Size(37, 21); + this.tbBidMin.TabIndex = 8; + this.tbBidMin.Text = "9.0%"; + this.tbBidMin.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // tbBidAmount + // + this.tbBidAmount.Location = new System.Drawing.Point(97, 77); + this.tbBidAmount.Name = "tbBidAmount"; + this.tbBidAmount.Size = new System.Drawing.Size(100, 21); + this.tbBidAmount.TabIndex = 9; + this.tbBidAmount.Text = "100,000"; + this.tbBidAmount.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // tbTimeout + // + this.tbTimeout.Location = new System.Drawing.Point(97, 104); + this.tbTimeout.Name = "tbTimeout"; + this.tbTimeout.Size = new System.Drawing.Size(100, 21); + this.tbTimeout.TabIndex = 10; + this.tbTimeout.Text = "120"; + this.tbTimeout.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(38, 26); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(53, 12); + this.label1.TabIndex = 11; + this.label1.Text = "검색범위"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(38, 53); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(53, 12); + this.label2.TabIndex = 12; + this.label2.Text = "매수범위"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(38, 80); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(41, 12); + this.label3.TabIndex = 13; + this.label3.Text = "매수금"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(38, 107); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(53, 12); + this.label4.TabIndex = 13; + this.label4.Text = "타임아웃"; + // + // tbTrailing + // + this.tbTrailing.Location = new System.Drawing.Point(97, 131); + this.tbTrailing.Name = "tbTrailing"; + this.tbTrailing.Size = new System.Drawing.Size(100, 21); + this.tbTrailing.TabIndex = 10; + this.tbTrailing.Text = "2.0%"; + this.tbTrailing.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(38, 134); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(53, 12); + this.label5.TabIndex = 13; + this.label5.Text = "트레일링"; + // + // tbLossCut + // + this.tbLossCut.Location = new System.Drawing.Point(97, 158); + this.tbLossCut.Name = "tbLossCut"; + this.tbLossCut.Size = new System.Drawing.Size(100, 21); + this.tbLossCut.TabIndex = 10; + this.tbLossCut.Text = "2.0%"; + this.tbLossCut.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(38, 161); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(29, 12); + this.label6.TabIndex = 13; + this.label6.Text = "손절"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(140, 26); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(14, 12); + this.label7.TabIndex = 11; + this.label7.Text = "~"; + // + // tbSearchMin + // + this.tbSearchMin.Location = new System.Drawing.Point(97, 23); + this.tbSearchMin.Name = "tbSearchMin"; + this.tbSearchMin.Size = new System.Drawing.Size(37, 21); + this.tbSearchMin.TabIndex = 14; + this.tbSearchMin.Text = "7.0%"; + this.tbSearchMin.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // btApply + // + this.btApply.Location = new System.Drawing.Point(97, 185); + this.btApply.Name = "btApply"; + this.btApply.Size = new System.Drawing.Size(44, 23); + this.btApply.TabIndex = 15; + this.btApply.Text = "적용"; + this.btApply.UseVisualStyleBackColor = true; + this.btApply.Click += new System.EventHandler(this.btApply_Click); + // + // btCancel + // + this.btCancel.Location = new System.Drawing.Point(153, 185); + this.btCancel.Name = "btCancel"; + this.btCancel.Size = new System.Drawing.Size(44, 23); + this.btCancel.TabIndex = 16; + this.btCancel.Text = "취소"; + this.btCancel.UseVisualStyleBackColor = true; + this.btCancel.Click += new System.EventHandler(this.btCancel_Click); + // + // tbBidMax + // + this.tbBidMax.Location = new System.Drawing.Point(160, 50); + this.tbBidMax.Name = "tbBidMax"; + this.tbBidMax.Size = new System.Drawing.Size(37, 21); + this.tbBidMax.TabIndex = 8; + this.tbBidMax.Text = "10.0%"; + this.tbBidMax.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(140, 53); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(14, 12); + this.label8.TabIndex = 11; + this.label8.Text = "~"; + // + // btBalance + // + this.btBalance.Location = new System.Drawing.Point(122, 214); + this.btBalance.Name = "btBalance"; + this.btBalance.Size = new System.Drawing.Size(75, 23); + this.btBalance.TabIndex = 17; + this.btBalance.Text = "잔고"; + this.btBalance.UseVisualStyleBackColor = true; + // + // splitContainer1 + // + this.splitContainer1.Location = new System.Drawing.Point(0, 0); + this.splitContainer1.Name = "splitContainer1"; + this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.splitContainer2); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.tbLog); + this.splitContainer1.Size = new System.Drawing.Size(886, 714); + this.splitContainer1.SplitterDistance = 611; + this.splitContainer1.TabIndex = 20; + // + // splitContainer2 + // + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer2.Location = new System.Drawing.Point(0, 0); + this.splitContainer2.Name = "splitContainer2"; + // + // splitContainer2.Panel1 + // + this.splitContainer2.Panel1.Controls.Add(this.splitContainer3); + // + // splitContainer2.Panel2 + // + this.splitContainer2.Panel2.Controls.Add(this.btMATest); + this.splitContainer2.Panel2.Controls.Add(this.button1); + this.splitContainer2.Panel2.Controls.Add(this.btTimeSync); + this.splitContainer2.Panel2.Controls.Add(this.cbStart); + this.splitContainer2.Panel2.Controls.Add(this.btCybosPlus); + this.splitContainer2.Panel2.Controls.Add(this.btCybos5); + this.splitContainer2.Panel2.Controls.Add(this.lbSBCnt); + this.splitContainer2.Panel2.Controls.Add(this.lbRQCnt); + this.splitContainer2.Panel2.Controls.Add(this.btBalance); + this.splitContainer2.Panel2.Controls.Add(this.label1); + this.splitContainer2.Panel2.Controls.Add(this.label5); + this.splitContainer2.Panel2.Controls.Add(this.tbTimeout); + this.splitContainer2.Panel2.Controls.Add(this.tbSearchMax); + this.splitContainer2.Panel2.Controls.Add(this.label7); + this.splitContainer2.Panel2.Controls.Add(this.btCancel); + this.splitContainer2.Panel2.Controls.Add(this.label6); + this.splitContainer2.Panel2.Controls.Add(this.label2); + this.splitContainer2.Panel2.Controls.Add(this.label4); + this.splitContainer2.Panel2.Controls.Add(this.tbBidMin); + this.splitContainer2.Panel2.Controls.Add(this.tbBidAmount); + this.splitContainer2.Panel2.Controls.Add(this.tbLossCut); + this.splitContainer2.Panel2.Controls.Add(this.label8); + this.splitContainer2.Panel2.Controls.Add(this.btApply); + this.splitContainer2.Panel2.Controls.Add(this.tbSearchMin); + this.splitContainer2.Panel2.Controls.Add(this.tbTrailing); + this.splitContainer2.Panel2.Controls.Add(this.label3); + this.splitContainer2.Panel2.Controls.Add(this.tbBidMax); + this.splitContainer2.Size = new System.Drawing.Size(886, 611); + this.splitContainer2.SplitterDistance = 645; + this.splitContainer2.TabIndex = 0; + // + // splitContainer3 + // + this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer3.Location = new System.Drawing.Point(0, 0); + this.splitContainer3.Name = "splitContainer3"; + this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal; + this.splitContainer3.Size = new System.Drawing.Size(645, 611); + this.splitContainer3.SplitterDistance = 256; + this.splitContainer3.TabIndex = 0; + // + // btMATest + // + this.btMATest.Location = new System.Drawing.Point(138, 430); + this.btMATest.Name = "btMATest"; + this.btMATest.Size = new System.Drawing.Size(75, 23); + this.btMATest.TabIndex = 24; + this.btMATest.Text = "ma test"; + this.btMATest.UseVisualStyleBackColor = true; + this.btMATest.Click += new System.EventHandler(this.btMATest_Click); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(142, 371); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 23; + this.button1.Text = "button1"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // btTimeSync + // + this.btTimeSync.Location = new System.Drawing.Point(16, 341); + this.btTimeSync.Name = "btTimeSync"; + this.btTimeSync.Size = new System.Drawing.Size(84, 57); + this.btTimeSync.TabIndex = 22; + this.btTimeSync.Text = "Time Sync"; + this.btTimeSync.UseVisualStyleBackColor = true; + this.btTimeSync.Click += new System.EventHandler(this.btTimeSync_Click); + // + // cbStart + // + this.cbStart.Appearance = System.Windows.Forms.Appearance.Button; + this.cbStart.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.cbStart.Location = new System.Drawing.Point(16, 404); + this.cbStart.Name = "cbStart"; + this.cbStart.Size = new System.Drawing.Size(84, 57); + this.cbStart.TabIndex = 21; + this.cbStart.Text = "Start"; + this.cbStart.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.cbStart.UseVisualStyleBackColor = true; + this.cbStart.CheckedChanged += new System.EventHandler(this.cbStart_CheckedChanged); + // + // btCybosPlus + // + this.btCybosPlus.Location = new System.Drawing.Point(113, 467); + this.btCybosPlus.Name = "btCybosPlus"; + this.btCybosPlus.Size = new System.Drawing.Size(84, 67); + this.btCybosPlus.TabIndex = 20; + this.btCybosPlus.Text = "Cybos Plus"; + this.btCybosPlus.UseVisualStyleBackColor = true; + this.btCybosPlus.Click += new System.EventHandler(this.btCybosPlus_Click); + // + // btCybos5 + // + this.btCybos5.Location = new System.Drawing.Point(16, 467); + this.btCybos5.Name = "btCybos5"; + this.btCybos5.Size = new System.Drawing.Size(84, 67); + this.btCybos5.TabIndex = 20; + this.btCybos5.Text = "Cybos 5"; + this.btCybos5.UseVisualStyleBackColor = true; + this.btCybos5.Click += new System.EventHandler(this.btCybos5_Click); + // + // lbSBCnt + // + this.lbSBCnt.AutoSize = true; + this.lbSBCnt.Location = new System.Drawing.Point(29, 278); + this.lbSBCnt.Name = "lbSBCnt"; + this.lbSBCnt.Size = new System.Drawing.Size(70, 12); + this.lbSBCnt.TabIndex = 19; + this.lbSBCnt.Text = "SB Count : "; + // + // lbRQCnt + // + this.lbRQCnt.AutoSize = true; + this.lbRQCnt.Location = new System.Drawing.Point(29, 254); + this.lbRQCnt.Name = "lbRQCnt"; + this.lbRQCnt.Size = new System.Drawing.Size(71, 12); + this.lbRQCnt.TabIndex = 18; + this.lbRQCnt.Text = "RQ Count : "; + // + // statusBar1 + // + this.statusBar1.Location = new System.Drawing.Point(0, 720); + this.statusBar1.Name = "statusBar1"; + this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] { this.statusBarPanel1, this.statusBarPanel2}); - this.statusBar1.ShowPanels = true; - this.statusBar1.Size = new System.Drawing.Size(886, 22); - this.statusBar1.TabIndex = 21; - this.statusBar1.Text = "statusBar1"; - // - // statusBarPanel1 - // - this.statusBarPanel1.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring; - this.statusBarPanel1.Name = "statusBarPanel1"; - this.statusBarPanel1.Width = 749; - // - // statusBarPanel2 - // - this.statusBarPanel2.MinWidth = 120; - this.statusBarPanel2.Name = "statusBarPanel2"; - this.statusBarPanel2.Width = 120; - // - // button1 - // - this.button1.Location = new System.Drawing.Point(142, 371); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(75, 23); - this.button1.TabIndex = 23; - this.button1.Text = "button1"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // btMATest - // - this.btMATest.Location = new System.Drawing.Point(138, 430); - this.btMATest.Name = "btMATest"; - this.btMATest.Size = new System.Drawing.Size(75, 23); - this.btMATest.TabIndex = 24; - this.btMATest.Text = "ma test"; - this.btMATest.UseVisualStyleBackColor = true; - this.btMATest.Click += new System.EventHandler(this.btMATest_Click); - // - // MainForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(886, 742); - this.Controls.Add(this.statusBar1); - this.Controls.Add(this.splitContainer1); - this.Name = "MainForm"; - this.Text = "Upper Limit"; - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel2.ResumeLayout(false); - this.splitContainer1.Panel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); - this.splitContainer1.ResumeLayout(false); - this.splitContainer2.Panel1.ResumeLayout(false); - this.splitContainer2.Panel2.ResumeLayout(false); - this.splitContainer2.Panel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); - this.splitContainer2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit(); - this.splitContainer3.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).EndInit(); - this.ResumeLayout(false); + this.statusBar1.ShowPanels = true; + this.statusBar1.Size = new System.Drawing.Size(886, 22); + this.statusBar1.TabIndex = 21; + this.statusBar1.Text = "statusBar1"; + // + // statusBarPanel1 + // + this.statusBarPanel1.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring; + this.statusBarPanel1.Name = "statusBarPanel1"; + this.statusBarPanel1.Width = 749; + // + // statusBarPanel2 + // + this.statusBarPanel2.MinWidth = 120; + this.statusBarPanel2.Name = "statusBarPanel2"; + this.statusBarPanel2.Width = 120; + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(886, 742); + this.Controls.Add(this.statusBar1); + this.Controls.Add(this.splitContainer1); + this.Name = "MainForm"; + this.Text = "Upper Limit"; + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + this.splitContainer1.Panel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.splitContainer2.Panel1.ResumeLayout(false); + this.splitContainer2.Panel2.ResumeLayout(false); + this.splitContainer2.Panel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); + this.splitContainer2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit(); + this.splitContainer3.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).EndInit(); + this.ResumeLayout(false); } diff --git a/MainForm.cs b/MainForm.cs index b6c7722..74ba47b 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -38,7 +38,7 @@ namespace upper_limit_crawler SetDoubleBuffered(tbLog); - UlUtil.Init(tbLog); + ULUtil.Init(tbLog); btApply_Click(null, null); @@ -56,7 +56,7 @@ namespace upper_limit_crawler m_MainTimer.Tick += Refresh; m_MainTimer.Start(); - UlUtil.Trace("시작"); + ULUtil.Trace("시작"); } public static void SetDoubleBuffered(Control control) @@ -69,7 +69,7 @@ namespace upper_limit_crawler private bool IsOnTime() { - DateTime CurTime = UlUtil.GetCurTime(); + DateTime CurTime = ULUtil.GetCurTime(); if (CurTime.DayOfWeek == DayOfWeek.Sunday || CurTime.DayOfWeek == DayOfWeek.Saturday) return false; @@ -97,7 +97,7 @@ namespace upper_limit_crawler return; } - if(cbStart.Checked == true && UlUtil.IsConnected() == false) + if(cbStart.Checked == true && ULUtil.IsConnected() == false) { cbStart.Checked = false; return; @@ -107,10 +107,10 @@ namespace upper_limit_crawler m_Own.Refresh(iCurTime); - lbRQCnt.Text = "RQ Count : " + UlUtil.GetLimitRemainCountRQ().ToString(); - lbSBCnt.Text = "SB Count : " + UlUtil.GetLimitRemainCountSB().ToString(); + lbRQCnt.Text = "RQ Count : " + ULUtil.GetLimitRemainCountRQ().ToString(); + lbSBCnt.Text = "SB Count : " + ULUtil.GetLimitRemainCountSB().ToString(); - statusBar1.Panels[1].Text = UlUtil.GetCurTimeString() + " "; + statusBar1.Panels[1].Text = ULUtil.GetCurTimeString() + " "; m_iLastTime = iCurTime; } @@ -133,10 +133,10 @@ namespace upper_limit_crawler { if (cbStart.Checked == true) { - if (UlUtil.IsConnected() == false) - UlUtil.Reset(); + if (ULUtil.IsConnected() == false) + ULUtil.Reset(); - if (UlUtil.IsConnected() == false) + if (ULUtil.IsConnected() == false) { cbStart.Checked = false; MessageBox.Show("Cybos Plus를 실행해주세요"); @@ -177,7 +177,7 @@ namespace upper_limit_crawler } catch(Exception ex) { - UlUtil.Trace(ex.ToString()); + ULUtil.Trace(ex.ToString()); } } @@ -207,7 +207,7 @@ namespace upper_limit_crawler private void btTimeSync_Click(object sender, EventArgs e) { - UlUtil.SyncServerTime(); + ULUtil.SyncServerTime(); } DSCBO1Lib.StockCur cur = new DSCBO1Lib.StockCur(); @@ -359,19 +359,21 @@ namespace upper_limit_crawler { if (m_DataMgr.IsInBlackList(iTime, strCode) == true) { - //UlUtil.Trace(string.Format("[{0}] 조건 매수 실패. black list {1}원 ({2})", item.m_strCodeName, item.m_iCurPrice, fCompRate.ToString("0.00%"))); + //Console.WriteLine("[{0}] 조건 매수 실패. black list {1}원 ({2})", item.m_strCodeName, item.m_iCurPrice, fCompRate.ToString("0.00%")); continue; } float f5MASlope = item.GetPrev5MASlope(iTime); if (f5MASlope <= 0) { - //UlUtil.Trace(string.Format("[{0}] 조건 매수 실패. 5ma 상승하지 않음 {1}원 ({2})", item.m_strCodeName, item.m_iCurPrice, fCompRate.ToString("0.00%"))); + //Console.WriteLine("[{0}] 조건 매수 실패. 5ma 상승하지 않음 {1}원 ({2})", item.m_strCodeName, item.m_iCurPrice, fCompRate.ToString("0.00%")); continue; } // bid and add to black list Console.WriteLine(string.Format("[{0}] [{1}] 조건 매수 {2}원 ({3}) (5MA slop:{4:0.00})", iTime, item.m_strCodeName, item.m_iCurPrice, fCompRate.ToString("0.00%"), f5MASlope)); + ULUtil.TraceCSV("조건 매수", item.m_strCodeName, item.m_iCurPrice, fCompRate.ToString("0.00%"), f5MASlope); + OwnItem.m_iUnitBEP = iCurPrice; OwnItem.m_strCodeName = item.m_strCodeName; @@ -386,6 +388,7 @@ namespace upper_limit_crawler if (iCurPrice <= OwnItem.m_iUnitBEP * (1.0f - m_DataMgr.m_Setting.m_fLossCut)) { Console.WriteLine(string.Format("[{0}] [{1}] 손절 {2}원 ({3}:{4})", iTime, OwnItem.m_strCodeName, iCurPrice, iCurPrice - OwnItem.m_iUnitBEP, (iCurPrice / (float)OwnItem.m_iUnitBEP - 1.0f).ToString("0.00%"))); + ULUtil.TraceCSV("손절", OwnItem.m_strCodeName, iCurPrice, (iCurPrice / (float)OwnItem.m_iUnitBEP - 1.0f).ToString("0.00%")); OwnItem.m_iUnitBEP = 0; //m_DataMgr.GetTrader().SellCurPrice(OwnItem.m_strCode, OwnItem.m_iPayBalance); @@ -407,6 +410,8 @@ namespace upper_limit_crawler } Console.WriteLine(string.Format("[{0}] [{1}] 트레일링 매도 {2}원 ({3}:{4}) (5MA slop:{5:0.00})", iTime, OwnItem.m_strCodeName, iCurPrice, iCurPrice- OwnItem.m_iUnitBEP, (iCurPrice / (float)OwnItem.m_iUnitBEP - 1.0f).ToString("0.00%"), f5MASlope)); + ULUtil.TraceCSV("트레일링 매도", OwnItem.m_strCodeName, iCurPrice, iCurPrice - OwnItem.m_iUnitBEP, (iCurPrice / (float)OwnItem.m_iUnitBEP - 1.0f).ToString("0.00%"), f5MASlope); + OwnItem.m_iUnitBEP = 0; //m_DataMgr.GetTrader().SellCurPrice(OwnItem.m_strCode, OwnItem.m_iPayBalance); diff --git a/ULBalanceDlg.Designer.cs b/ULBalanceDlg.Designer.cs index aeacf4a..7b516f9 100644 --- a/ULBalanceDlg.Designer.cs +++ b/ULBalanceDlg.Designer.cs @@ -41,6 +41,7 @@ this.btRefresh = new System.Windows.Forms.Button(); this.btSellAll = new System.Windows.Forms.Button(); this.btSell = new System.Windows.Forms.Button(); + this.chHighestPrice = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.SuspendLayout(); // // lvBalance @@ -57,6 +58,7 @@ this.chEvaluationProfit, this.chBalance, this.chEvaluationPrice, + this.chHighestPrice, this.chProfitRate}); this.lvBalance.FullRowSelect = true; this.lvBalance.GridLines = true; @@ -147,6 +149,10 @@ this.btSell.UseVisualStyleBackColor = true; this.btSell.Click += new System.EventHandler(this.btSell_Click); // + // chHighestPrice + // + this.chHighestPrice.Text = "최고가"; + // // ULBalanceDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); @@ -179,5 +185,6 @@ private System.Windows.Forms.ColumnHeader chEvaluationPrice; private System.Windows.Forms.Button btSellAll; private System.Windows.Forms.Button btSell; + private System.Windows.Forms.ColumnHeader chHighestPrice; } } \ No newline at end of file diff --git a/ULBalanceDlg.cs b/ULBalanceDlg.cs index 7a00866..36cc68e 100644 --- a/ULBalanceDlg.cs +++ b/ULBalanceDlg.cs @@ -131,7 +131,7 @@ namespace upper_limit_crawler ListViewItem listViewItem = new ListViewItem(new string[] { strCode, strCodeName, dConclusionUnitPrice.ToString("###,###,##0"), iUnitBEP.ToString("###,###,##0"), iCurPrice.ToString("###,###,##0"), iEvaluationProfit.ToString("###,###,##0"), iConclusionBalanceCnt.ToString("###,###,##0"), - iEvaluationPrice.ToString("###,###,##0"), dReturn.ToString("#,##0.00")+"%" }); + iEvaluationPrice.ToString("###,###,##0"), iCurPrice.ToString("###,###,##0"), dReturn.ToString("#,##0.00")+"%" }); listViewItem.UseItemStyleForSubItems = false; if(iEvaluationProfit > 0) @@ -189,6 +189,7 @@ namespace upper_limit_crawler lvItem.SubItems[chEvaluationProfit.Index].ForeColor = Color.Blue; lvItem.SubItems[chEvaluationPrice.Index].Text = OwnItem.m_iEvaluationPrice.ToString("###,###,##0"); lvItem.SubItems[chProfitRate.Index].Text = OwnItem.m_dProfitRate.ToString("#,##0.00%"); + lvItem.SubItems[chHighestPrice.Index].Text = WatchItem.m_iHighestPrice.ToString("#,##0.00%"); if (OwnItem.m_dProfitRate > 0) lvItem.SubItems[chProfitRate.Index].ForeColor = Color.Red; else @@ -200,7 +201,8 @@ namespace upper_limit_crawler // loss cut if (iCurPrice <= OwnItem.m_iUnitBEP * (1.0f - m_DataMgr.m_Setting.m_fLossCut)) { - UlUtil.Trace(string.Format("[{0}] 손절 {1}원 ({2})", OwnItem.m_strCodeName, iCurPrice, (iCurPrice/(float)OwnItem.m_iUnitBEP-1.0f).ToString("0.00%"))); + ULUtil.Trace("[{0}] 손절 {1}원 ({2}) {3}", OwnItem.m_strCodeName, iCurPrice, (iCurPrice/(float)OwnItem.m_iUnitBEP-1.0f).ToString("0.00%"), WatchItem.m_iHighestPrice); + ULUtil.TraceCSV("손절", OwnItem.m_strCodeName, iCurPrice, (iCurPrice / (float)OwnItem.m_iUnitBEP - 1.0f).ToString("0.00%"), WatchItem.m_iHighestPrice); m_DataMgr.GetTrader().SellCurPrice(OwnItem.m_strCode, OwnItem.m_iPayBalance); m_OwnList.Remove(OwnItem); m_DataMgr.RemoveWatch(strCode); @@ -212,7 +214,7 @@ namespace upper_limit_crawler // trailing else if (iCurPrice <= OwnItem.m_iMaxPrice - OwnItem.m_iUnitBEP * m_DataMgr.m_Setting.m_fTrailing) { - int iTime = UlUtil.GetCurTimeInt(); + int iTime = ULUtil.GetCurTimeInt(); float f5MASlope = WatchItem.GetPrev5MASlope(iTime); if (f5MASlope > 0) { @@ -220,12 +222,14 @@ namespace upper_limit_crawler continue; } - UlUtil.Trace(string.Format("[{0}] 트레일링 매도 {1}원 ({2}:{3}) (5MA slop:{4:0.00})", + ULUtil.Trace("[{0}] 트레일링 매도 {1}원 ({2}:{3}) (5MA slop:{4:0.00}) {5}", OwnItem.m_strCodeName, iCurPrice, iCurPrice - OwnItem.m_iUnitBEP, (iCurPrice/(float)OwnItem.m_iUnitBEP-1.0f).ToString("0.00%"), - f5MASlope)); + f5MASlope, + WatchItem.m_iHighestPrice); + ULUtil.TraceCSV("트레일링 매도", OwnItem.m_strCodeName, iCurPrice, iCurPrice - OwnItem.m_iUnitBEP, (iCurPrice / (float)OwnItem.m_iUnitBEP - 1.0f).ToString("0.00%"), f5MASlope, WatchItem.m_iHighestPrice); m_DataMgr.GetTrader().SellCurPrice(OwnItem.m_strCode, OwnItem.m_iPayBalance); m_OwnList.Remove(OwnItem); @@ -247,7 +251,7 @@ namespace upper_limit_crawler int iDeltaT = iCurTime-m_iLastTime; m_iBalanceDelay-=iDeltaT; - if(m_iBalanceDelay<=0 && UlUtil.GetLimitRemainCountRQ() > 20) + if(m_iBalanceDelay<=0 && ULUtil.GetLimitRemainCountRQ() > 20) { RefreshBalance(); m_iBalanceDelay=BALANCE_DELAY; @@ -267,7 +271,7 @@ namespace upper_limit_crawler { foreach(ListViewItem item in lvBalance.SelectedItems) { - UlUtil.Trace(string.Format("[{0}] 수동 매도", item.SubItems[chName.Index].Text)); + ULUtil.Trace("[{0}] 수동 매도", item.SubItems[chName.Index].Text); string strCode = item.SubItems[chCode.Index].Text; int iCnt = int.Parse(item.SubItems[chBalance.Index].Text); @@ -279,7 +283,7 @@ namespace upper_limit_crawler { foreach (ListViewItem item in lvBalance.Items) { - UlUtil.Trace(string.Format("[{0}] 모두 청산", item.SubItems[chName.Index].Text)); + ULUtil.Trace("[{0}] 모두 청산", item.SubItems[chName.Index].Text); string strCode = item.SubItems[chCode.Index].Text; int iCnt = int.Parse(item.SubItems[chBalance.Index].Text); diff --git a/ULMonitorDlg.cs b/ULMonitorDlg.cs index e8c0007..8513129 100644 --- a/ULMonitorDlg.cs +++ b/ULMonitorDlg.cs @@ -62,7 +62,7 @@ namespace upper_limit_crawler bool RefreshMonitorItem() { - if (m_bRequesting == true || UlUtil.GetLimitRemainCountRQ() < 30) + if (m_bRequesting == true || ULUtil.GetLimitRemainCountRQ() < 30) return false; m_bRequesting = true; @@ -121,7 +121,7 @@ namespace upper_limit_crawler } bContinue = (m_7043.Continue == 1); - if (bContinue == true && UlUtil.GetLimitRemainCountRQ() >= 30) + if (bContinue == true && ULUtil.GetLimitRemainCountRQ() >= 30) iResult = m_7043.BlockRequest2(1); } @@ -159,29 +159,32 @@ namespace upper_limit_crawler if (fCompRate >= m_DataMgr.m_Setting.m_fBidMin && fCompRate <= m_DataMgr.m_Setting.m_fBidMax) { - int iTime = UlUtil.GetCurTimeInt(); + int iTime = ULUtil.GetCurTimeInt(); if (m_DataMgr.IsInBlackList(iTime, strCode) == true) { - //UlUtil.Trace(string.Format("[{0}] 조건 매수 실패. black list {1}원 ({2})", item.m_strCodeName, item.m_iCurPrice, fCompRate.ToString("0.00%"))); + //ULUtil.Trace("[{0}] 조건 매수 실패. black list {1}원 ({2})", item.m_strCodeName, item.m_iCurPrice, fCompRate.ToString("0.00%")); continue; } float f5MASlope = item.GetPrev5MASlope(iTime); if (f5MASlope <= 0) { - //UlUtil.Trace(string.Format("[{0}] 조건 매수 실패. 5ma 상승하지 않음 {1}원 ({2})", item.m_strCodeName, item.m_iCurPrice, fCompRate.ToString("0.00%"))); + //ULUtil.Trace("[{0}] 조건 매수 실패. 5ma 상승하지 않음 {1}원 ({2})", item.m_strCodeName, item.m_iCurPrice, fCompRate.ToString("0.00%")); continue; } // bid and add to black list - UlUtil.Trace(string.Format("[{0}] 조건 매수 {1}원 ({2}) (5MA slop:{3:0.00})", + m_DataMgr.GetTrader().Buy(strCode, item.m_iCurPrice, (int)m_DataMgr.m_Setting.m_fBidAmount); + m_DataMgr.AddBlackList(iTime, strCode); + + + ULUtil.Trace("[{0}] 조건 매수 {1}원 ({2}) (5MA slop:{3:0.00})", item.m_strCodeName, item.m_iCurPrice, fCompRate.ToString("0.00%"), - f5MASlope)); + f5MASlope); - m_DataMgr.GetTrader().Buy(strCode, item.m_iCurPrice, (int)m_DataMgr.m_Setting.m_fBidAmount); - m_DataMgr.AddBlackList(iTime, strCode); + ULUtil.TraceCSV("조건 매수", item.m_strCodeName, item.m_iCurPrice, fCompRate.ToString("0.00%"), f5MASlope); } } } diff --git a/ULTrader.cs b/ULTrader.cs index f4b4def..cc143e2 100644 --- a/ULTrader.cs +++ b/ULTrader.cs @@ -82,7 +82,7 @@ namespace upper_limit_crawler { strLog += "접수"; } - UlUtil.Trace(strLog); + ULUtil.Trace(strLog); } //0 - (string)주문종류코드 주문구분 @@ -129,7 +129,7 @@ namespace upper_limit_crawler { //lock(lockBuy) { - while (UlUtil.GetLimitRemainCountRQ() <= 0) ; + while (ULUtil.GetLimitRemainCountRQ() <= 0) ; int iCnt = iBidAmount / iUnitPrice; @@ -153,7 +153,7 @@ namespace upper_limit_crawler //long iCnt = (long)Math.Floor(fAskAmount/fCurPrice); //iCnt=1; - while (UlUtil.GetLimitRemainCountRQ() <= 0) ; + while (ULUtil.GetLimitRemainCountRQ() <= 0) ; CPTRADELib.CpTd0311 Td0311Ask = new CPTRADELib.CpTd0311(); @@ -176,7 +176,7 @@ namespace upper_limit_crawler //long iCnt = (long)Math.Floor(fAskAmount/fCurPrice); //iCnt=1; - while (UlUtil.GetLimitRemainCountRQ() <= 0); + while (ULUtil.GetLimitRemainCountRQ() <= 0); CPTRADELib.CpTd0311 Td0311Ask = new CPTRADELib.CpTd0311(); diff --git a/ULWatchItem.cs b/ULWatchItem.cs index bf1481d..926439e 100644 --- a/ULWatchItem.cs +++ b/ULWatchItem.cs @@ -66,7 +66,7 @@ namespace upper_limit_crawler List m_PriceList = new List(); - // key : time(hh:mm:ss) + // key : time(HH:mm:ss) SortedList m_1MinChart = new SortedList(); SortedList m_5MAChart = new SortedList(); @@ -104,7 +104,7 @@ namespace upper_limit_crawler CPSYSDIBLib.StockChart stockChart = new CPSYSDIBLib.StockChart(); stockChart.SetInputValue(0, m_strCode); stockChart.SetInputValue(1, '1'); - string strDate = UlUtil.GetCurTime().ToString("yyyyMMdd"); + string strDate = ULUtil.GetCurTime().ToString("yyyyMMdd"); stockChart.SetInputValue(2, strDate); stockChart.SetInputValue(3, strDate); stockChart.SetInputValue(5, new int[] { 0, 1, 2, 3, 4, 5 }); @@ -299,7 +299,7 @@ namespace upper_limit_crawler if (lastMA.m_fMA > prevMA.m_fMA) { - //UlUtil.Trace(string.Format("[Is5MAGoingUp][{0}] ma up ({1}, {2}", m_strCodeName, lastMA.m_fMA, prevMA.m_fMA)); + //ULUtil.Trace("[Is5MAGoingUp][{0}] ma up ({1}, {2}", m_strCodeName, lastMA.m_fMA, prevMA.m_fMA); return true; } else if(lastMA.m_fMA == 0) @@ -311,7 +311,7 @@ namespace upper_limit_crawler if (lastTick.m_iEnd > prevTick.m_iEnd) { - //UlUtil.Trace(string.Format("[Is5MAGoingUp][{0}] cur up ({1}, {2}", m_strCodeName, lastTick.m_iEnd, prevTick.m_iEnd)); + //ULUtil.Trace("[Is5MAGoingUp][{0}] cur up ({1}, {2}", m_strCodeName, lastTick.m_iEnd, prevTick.m_iEnd); return true; } } diff --git a/UlUtil.cs b/UlUtil.cs index 69d6aba..f4e3a08 100644 --- a/UlUtil.cs +++ b/UlUtil.cs @@ -10,13 +10,14 @@ using System.Windows.Forms; namespace upper_limit_crawler { - public static class UlUtil + public static class ULUtil { //static string m_strLogServer = "http://mjjo53.us.to:8000"; static CPUTILLib.CpCybos m_CPUtil = new CPUTILLib.CpCybos(); static TextBox m_tbLog = null; static string m_strLogFileName; + static string m_strCSVFileName; static TimeSpan m_TimeDiff = TimeSpan.Zero; public static void Init(TextBox tbLog) @@ -24,11 +25,18 @@ namespace upper_limit_crawler m_tbLog = tbLog; if (Debugger.IsAttached == true) - m_strLogFileName = Directory.GetParent(Environment.CurrentDirectory).Parent.FullName+"\\"; + { + m_strLogFileName = Directory.GetParent(Environment.CurrentDirectory).Parent.FullName + "\\"; + m_strCSVFileName = Directory.GetParent(Environment.CurrentDirectory).Parent.FullName + "\\"; + } + m_strLogFileName += "log\\"; if (Directory.Exists(m_strLogFileName) == false) Directory.CreateDirectory(m_strLogFileName); m_strLogFileName += "log-" + GetCurTime().ToString("yyyy-MM-dd") + ".txt"; + + m_strCSVFileName += "log\\"; + m_strCSVFileName += "log-" + GetCurTime().ToString("yyyy-MM-dd") + ".csv"; } public static void SyncServerTime() @@ -64,7 +72,7 @@ namespace upper_limit_crawler if (ex.Status == WebExceptionStatus.ProtocolError && ex.Response != null) { var resp = (HttpWebResponse)ex.Response; - Trace(string.Format("인터넷 시간 동기화 실패 ({0})", resp.StatusCode)); + Trace("인터넷 시간 동기화 실패 ({0})", resp.StatusCode); } } } @@ -88,7 +96,7 @@ namespace upper_limit_crawler { try { - UlUtil.Trace("TimeSync trying [server:{0}]", server); + ULUtil.Trace("TimeSync trying [server:{0}]", server); // Connect to the server (at port 13) and get the response string serverResponse = string.Empty; @@ -143,12 +151,12 @@ namespace upper_limit_crawler public static string GetCurTimeString() { - return GetCurTime().ToString("yyyy-MM-dd hh:mm:ss"); + return GetCurTime().ToString("yyyy-MM-dd HH:mm:ss"); } public static int GetCurTimeInt() { - return int.Parse(GetCurTime().ToString("hhmmss")); + return int.Parse(GetCurTime().ToString("HHmmss")); } public static void WebLog(string strURL, string strMsg) @@ -206,9 +214,18 @@ namespace upper_limit_crawler //WebLog(m_strLogServer, strLog); } - public static void Trace(string strMsg, params object[] args) + public static void Trace(string strFormat, params object[] args) { - Trace(string.Format(strMsg, args)); + Trace(string.Format(strFormat, args)); + } + + public static void TraceCSV(params object[] args) + { + string strLog = GetCurTimeString(); + foreach (object arg in args) + strLog += ", " + arg; + + System.IO.File.AppendAllText(m_strCSVFileName, strLog + Environment.NewLine, Encoding.UTF8); } public static int GetLimitRemainCountTrace() diff --git a/upper-limit-crawler.csproj b/upper-limit-crawler.csproj index b52523c..3f20b19 100644 --- a/upper-limit-crawler.csproj +++ b/upper-limit-crawler.csproj @@ -82,7 +82,7 @@ - + ULBalanceDlg.cs