From f7491b426a62a64e7de6237401741014afc87fd8 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1A3P75F\\lee" Date: Tue, 9 May 2023 16:13:14 +0900 Subject: [PATCH 1/6] =?UTF-8?q?=EC=9D=B4=EC=B0=AC=EA=B7=A0=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HunterSubForm/TestBoardForm.Designer.cs | 47 ++++++++++++++----- Million Hunter/HunterSubForm/TestBoardForm.cs | 4 ++ Million Hunter/Million Hunter.csproj | 1 - 3 files changed, 39 insertions(+), 13 deletions(-) diff --git a/Million Hunter/HunterSubForm/TestBoardForm.Designer.cs b/Million Hunter/HunterSubForm/TestBoardForm.Designer.cs index 255ce97..fa6ad84 100644 --- a/Million Hunter/HunterSubForm/TestBoardForm.Designer.cs +++ b/Million Hunter/HunterSubForm/TestBoardForm.Designer.cs @@ -32,8 +32,10 @@ namespace Million_Hunter.HunterSubForm this.simpleButton_FullInsertCandle = new DevExpress.XtraEditors.SimpleButton(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.simpleButton_Calc = new DevExpress.XtraEditors.SimpleButton(); this.checkedListBox_Indicator = new System.Windows.Forms.CheckedListBox(); + this.simpleButton_Calc = new DevExpress.XtraEditors.SimpleButton(); + this.simpleButton_찬 = new DevExpress.XtraEditors.SimpleButton(); + this.progressBar1 = new System.Windows.Forms.ProgressBar(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.SuspendLayout(); @@ -69,17 +71,6 @@ namespace Million_Hunter.HunterSubForm this.groupBox2.TabStop = false; this.groupBox2.Text = "지표"; // - // simpleButton_Calc - // - this.simpleButton_Calc.Appearance.ForeColor = System.Drawing.Color.Teal; - this.simpleButton_Calc.Appearance.Options.UseForeColor = true; - this.simpleButton_Calc.Location = new System.Drawing.Point(720, 225); - this.simpleButton_Calc.Name = "simpleButton_Calc"; - this.simpleButton_Calc.Size = new System.Drawing.Size(121, 32); - this.simpleButton_Calc.TabIndex = 1; - this.simpleButton_Calc.Text = "계산하기"; - this.simpleButton_Calc.Click += new System.EventHandler(this.simpleButton_Calc_Click); - // // checkedListBox_Indicator // this.checkedListBox_Indicator.Dock = System.Windows.Forms.DockStyle.Fill; @@ -91,11 +82,41 @@ namespace Million_Hunter.HunterSubForm this.checkedListBox_Indicator.Size = new System.Drawing.Size(823, 108); this.checkedListBox_Indicator.TabIndex = 0; // + // simpleButton_Calc + // + this.simpleButton_Calc.Appearance.ForeColor = System.Drawing.Color.Teal; + this.simpleButton_Calc.Appearance.Options.UseForeColor = true; + this.simpleButton_Calc.Location = new System.Drawing.Point(720, 225); + this.simpleButton_Calc.Name = "simpleButton_Calc"; + this.simpleButton_Calc.Size = new System.Drawing.Size(121, 32); + this.simpleButton_Calc.TabIndex = 1; + this.simpleButton_Calc.Text = "계산하기"; + this.simpleButton_Calc.Click += new System.EventHandler(this.simpleButton_Calc_Click); + // + // simpleButton_찬 + // + this.simpleButton_찬.Location = new System.Drawing.Point(18, 225); + this.simpleButton_찬.Name = "simpleButton_찬"; + this.simpleButton_찬.Size = new System.Drawing.Size(104, 32); + this.simpleButton_찬.TabIndex = 4; + this.simpleButton_찬.Text = "찬테스트"; + this.simpleButton_찬.Click += new System.EventHandler(this.simpleButton_찬_Click); + // + // progressBar1 + // + this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.progressBar1.Location = new System.Drawing.Point(0, 275); + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Size = new System.Drawing.Size(852, 23); + this.progressBar1.TabIndex = 5; + // // TestBoardForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(853, 297); + this.Controls.Add(this.progressBar1); + this.Controls.Add(this.simpleButton_찬); this.Controls.Add(this.simpleButton_Calc); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); @@ -114,5 +135,7 @@ namespace Million_Hunter.HunterSubForm private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.CheckedListBox checkedListBox_Indicator; private DevExpress.XtraEditors.SimpleButton simpleButton_Calc; + private DevExpress.XtraEditors.SimpleButton simpleButton_찬; + private System.Windows.Forms.ProgressBar progressBar1; } } \ No newline at end of file diff --git a/Million Hunter/HunterSubForm/TestBoardForm.cs b/Million Hunter/HunterSubForm/TestBoardForm.cs index e4ce9b8..8505569 100644 --- a/Million Hunter/HunterSubForm/TestBoardForm.cs +++ b/Million Hunter/HunterSubForm/TestBoardForm.cs @@ -168,5 +168,9 @@ namespace Million_Hunter.HunterSubForm } } + private void simpleButton_찬_Click(object sender, EventArgs e) + { + + } } } \ No newline at end of file diff --git a/Million Hunter/Million Hunter.csproj b/Million Hunter/Million Hunter.csproj index ba766f1..b7b5765 100644 --- a/Million Hunter/Million Hunter.csproj +++ b/Million Hunter/Million Hunter.csproj @@ -153,7 +153,6 @@ TestBoardForm.cs - ResXFileCodeGenerator Resources.Designer.cs From 94ddacf08ac9a2cfb92526fb7112ffcc21e1d48c Mon Sep 17 00:00:00 2001 From: jwlee Date: Tue, 9 May 2023 17:33:06 +0900 Subject: [PATCH 2/6] =?UTF-8?q?=EA=B2=B0=EA=B3=BC=20=ED=8F=BC=20=ED=95=84?= =?UTF-8?q?=ED=84=B0=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ResultViewerForm.Designer.cs | 2 +- .../HunterSubForm/ResultViewerForm.cs | 2 +- .../HunterSubForm/TestBoardForm.Designer.cs | 80 +++++--- Million Hunter/HunterSubForm/TestBoardForm.cs | 193 ++++++++++++++++-- 4 files changed, 235 insertions(+), 42 deletions(-) diff --git a/Million Hunter/HunterSubForm/ResultViewerForm.Designer.cs b/Million Hunter/HunterSubForm/ResultViewerForm.Designer.cs index bb71730..d55fc39 100644 --- a/Million Hunter/HunterSubForm/ResultViewerForm.Designer.cs +++ b/Million Hunter/HunterSubForm/ResultViewerForm.Designer.cs @@ -750,7 +750,6 @@ namespace Million.HunterSubForm #endregion private DevExpress.XtraEditors.PanelControl panelControl_IndicatorCondition; - private DevExpress.XtraTreeList.TreeList treeList_ResultData; private System.Windows.Forms.GroupBox groupBox_; private System.Windows.Forms.SplitContainer splitContainer_SetupPanel; private System.Windows.Forms.GroupBox groupBox3; @@ -796,5 +795,6 @@ namespace Million.HunterSubForm private DevExpress.XtraEditors.LabelControl labelControl_WinRateProfitRate; private DevExpress.XtraEditors.SimpleButton simpleButton_WinRateProfitRate; public DevExpress.XtraEditors.SimpleButton simpleButton_TestBoard; + public DevExpress.XtraTreeList.TreeList treeList_ResultData; } } \ No newline at end of file diff --git a/Million Hunter/HunterSubForm/ResultViewerForm.cs b/Million Hunter/HunterSubForm/ResultViewerForm.cs index 536d970..cfb4c76 100644 --- a/Million Hunter/HunterSubForm/ResultViewerForm.cs +++ b/Million Hunter/HunterSubForm/ResultViewerForm.cs @@ -219,7 +219,7 @@ namespace Million.HunterSubForm /// /// 승률 및 수익률 계산 함수 /// - private void CalcurateProfitAndWinRate() + public void CalcurateProfitAndWinRate() { // 승률 수익률 계산하기 // 결과 반영 체크 && Filter 된 노드만 리스트로 모음 diff --git a/Million Hunter/HunterSubForm/TestBoardForm.Designer.cs b/Million Hunter/HunterSubForm/TestBoardForm.Designer.cs index 255ce97..50979c3 100644 --- a/Million Hunter/HunterSubForm/TestBoardForm.Designer.cs +++ b/Million Hunter/HunterSubForm/TestBoardForm.Designer.cs @@ -32,10 +32,15 @@ namespace Million_Hunter.HunterSubForm this.simpleButton_FullInsertCandle = new DevExpress.XtraEditors.SimpleButton(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.simpleButton_Calc = new DevExpress.XtraEditors.SimpleButton(); - this.checkedListBox_Indicator = new System.Windows.Forms.CheckedListBox(); + this.checkEdit_구매이전봉볼린저40_1이하 = new DevExpress.XtraEditors.CheckEdit(); + this.checkEdit_이전봉40_2볼린저이하 = new DevExpress.XtraEditors.CheckEdit(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.simpleButton_Reset = new DevExpress.XtraEditors.SimpleButton(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.checkEdit_구매이전봉볼린저40_1이하.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.checkEdit_이전봉40_2볼린저이하.Properties)).BeginInit(); + this.groupBox3.SuspendLayout(); this.SuspendLayout(); // // simpleButton_FullInsertCandle @@ -54,55 +59,76 @@ namespace Million_Hunter.HunterSubForm this.groupBox1.Controls.Add(this.simpleButton_FullInsertCandle); this.groupBox1.Location = new System.Drawing.Point(12, 12); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(419, 63); + this.groupBox1.Size = new System.Drawing.Size(154, 63); this.groupBox1.TabIndex = 2; this.groupBox1.TabStop = false; this.groupBox1.Text = "데이터 채우기"; // // groupBox2 // - this.groupBox2.Controls.Add(this.checkedListBox_Indicator); + this.groupBox2.Controls.Add(this.checkEdit_구매이전봉볼린저40_1이하); + this.groupBox2.Controls.Add(this.checkEdit_이전봉40_2볼린저이하); this.groupBox2.Location = new System.Drawing.Point(12, 90); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(829, 129); + this.groupBox2.Size = new System.Drawing.Size(829, 123); this.groupBox2.TabIndex = 3; this.groupBox2.TabStop = false; this.groupBox2.Text = "지표"; // - // simpleButton_Calc + // checkEdit_구매이전봉볼린저40_1이하 // - this.simpleButton_Calc.Appearance.ForeColor = System.Drawing.Color.Teal; - this.simpleButton_Calc.Appearance.Options.UseForeColor = true; - this.simpleButton_Calc.Location = new System.Drawing.Point(720, 225); - this.simpleButton_Calc.Name = "simpleButton_Calc"; - this.simpleButton_Calc.Size = new System.Drawing.Size(121, 32); - this.simpleButton_Calc.TabIndex = 1; - this.simpleButton_Calc.Text = "계산하기"; - this.simpleButton_Calc.Click += new System.EventHandler(this.simpleButton_Calc_Click); + this.checkEdit_구매이전봉볼린저40_1이하.Location = new System.Drawing.Point(204, 22); + this.checkEdit_구매이전봉볼린저40_1이하.Name = "checkEdit_구매이전봉볼린저40_1이하"; + this.checkEdit_구매이전봉볼린저40_1이하.Properties.Caption = "구매 이전 봉 볼린저 40_1 이하"; + this.checkEdit_구매이전봉볼린저40_1이하.Size = new System.Drawing.Size(179, 19); + this.checkEdit_구매이전봉볼린저40_1이하.TabIndex = 1; + this.checkEdit_구매이전봉볼린저40_1이하.CheckedChanged += new System.EventHandler(this.checkEdit_common_CheckedChanged); // - // checkedListBox_Indicator + // checkEdit_이전봉40_2볼린저이하 // - this.checkedListBox_Indicator.Dock = System.Windows.Forms.DockStyle.Fill; - this.checkedListBox_Indicator.FormattingEnabled = true; - this.checkedListBox_Indicator.Items.AddRange(new object[] { - "구매 시점 이전 봉 40 1 볼린저 값 이하"}); - this.checkedListBox_Indicator.Location = new System.Drawing.Point(3, 18); - this.checkedListBox_Indicator.Name = "checkedListBox_Indicator"; - this.checkedListBox_Indicator.Size = new System.Drawing.Size(823, 108); - this.checkedListBox_Indicator.TabIndex = 0; + this.checkEdit_이전봉40_2볼린저이하.Location = new System.Drawing.Point(19, 22); + this.checkEdit_이전봉40_2볼린저이하.Name = "checkEdit_이전봉40_2볼린저이하"; + this.checkEdit_이전봉40_2볼린저이하.Properties.Caption = "구매 이전 봉 40_2 볼린저 이하"; + this.checkEdit_이전봉40_2볼린저이하.Size = new System.Drawing.Size(179, 19); + this.checkEdit_이전봉40_2볼린저이하.TabIndex = 0; + this.checkEdit_이전봉40_2볼린저이하.CheckedChanged += new System.EventHandler(this.checkEdit_common_CheckedChanged); + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.simpleButton_Reset); + this.groupBox3.Location = new System.Drawing.Point(187, 12); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(154, 63); + this.groupBox3.TabIndex = 4; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "데이터 채우기"; + // + // simpleButton_Reset + // + this.simpleButton_Reset.Appearance.ForeColor = System.Drawing.Color.SteelBlue; + this.simpleButton_Reset.Appearance.Options.UseForeColor = true; + this.simpleButton_Reset.Location = new System.Drawing.Point(6, 21); + this.simpleButton_Reset.Name = "simpleButton_Reset"; + this.simpleButton_Reset.Size = new System.Drawing.Size(121, 32); + this.simpleButton_Reset.TabIndex = 1; + this.simpleButton_Reset.Text = "필터 초기화"; + this.simpleButton_Reset.Click += new System.EventHandler(this.simpleButton_Reset_Click); // // TestBoardForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(853, 297); - this.Controls.Add(this.simpleButton_Calc); + this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.Name = "TestBoardForm"; this.Text = "TestBoard"; this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.checkEdit_구매이전봉볼린저40_1이하.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.checkEdit_이전봉40_2볼린저이하.Properties)).EndInit(); + this.groupBox3.ResumeLayout(false); this.ResumeLayout(false); } @@ -112,7 +138,9 @@ namespace Million_Hunter.HunterSubForm private DevExpress.XtraEditors.SimpleButton simpleButton_FullInsertCandle; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.CheckedListBox checkedListBox_Indicator; - private DevExpress.XtraEditors.SimpleButton simpleButton_Calc; + private DevExpress.XtraEditors.CheckEdit checkEdit_이전봉40_2볼린저이하; + private System.Windows.Forms.GroupBox groupBox3; + private DevExpress.XtraEditors.SimpleButton simpleButton_Reset; + private DevExpress.XtraEditors.CheckEdit checkEdit_구매이전봉볼린저40_1이하; } } \ No newline at end of file diff --git a/Million Hunter/HunterSubForm/TestBoardForm.cs b/Million Hunter/HunterSubForm/TestBoardForm.cs index e4ce9b8..7bf2401 100644 --- a/Million Hunter/HunterSubForm/TestBoardForm.cs +++ b/Million Hunter/HunterSubForm/TestBoardForm.cs @@ -24,6 +24,8 @@ namespace Million_Hunter.HunterSubForm CommonProperty.MCandleTimeType MCandleTimeType; + bool ignoreChangedfilter = false; + public TestBoardForm(ResultViewerForm resultViewerForm) { InitializeComponent(); @@ -137,34 +139,197 @@ namespace Million_Hunter.HunterSubForm } /// - /// 추가 조건 계산하기 + /// 데이터 초기화 /// /// /// - private void simpleButton_Calc_Click(object sender, EventArgs e) + private void simpleButton_Reset_Click(object sender, EventArgs e) + { + resetFilter(); + + ignoreChangedfilter = true; + + checkEdit_구매이전봉볼린저40_1이하.Checked = false; + checkEdit_이전봉40_2볼린저이하.Checked = false; + + ignoreChangedfilter = false; + + parentForm.treeList_ResultData.RefreshDataSource(); + parentForm.CalcurateProfitAndWinRate(); + } + + public void resetFilter() { // 구매 시점 이전 봉 40 1 볼린저 값 이하 foreach (var analysisData in parentForm._analysisDatas) { - var startDate = analysisData.StartDate; - var endDate = analysisData.EndDate; + analysisData.Inclusion = true; + analysisData.Description = ""; + } - var 구매이전봉 = startDate; - //차트 Date Time 설정하기 - var StartDateInterval = -1; + } - var candleData = analysisData.CandleDatas[MCandleTimeType].Find(item => item.DateTime == 구매이전봉); - var highValue = candleData.HighValue; - var bol402 = candleData.IndicatorDic["Bol402"]?.value ; + public void calcurateFilter() + { - if(bol402 != null) + // 필터 초기화 + resetFilter(); + + // 이전봉40_2볼린저이하 + if (checkEdit_이전봉40_2볼린저이하.Checked) + { + // 구매 시점 이전 봉 40 1 볼린저 값 이하 + foreach (var analysisData in parentForm._analysisDatas) { - if (highValue < bol402) analysisData.Inclusion = true; - else analysisData.Inclusion = false; - } + var startDate = analysisData.StartDate; + var endDate = analysisData.EndDate; + if (checkEdit_이전봉40_2볼린저이하.Checked) + { + var 구매이전봉 = startDate; + + //차트 Date Time 설정하기 + var StartDateInterval = 1; + + switch (MCandleTimeType) + { + case CommonProperty.MCandleTimeType.H1: + 구매이전봉 = Convert.ToDateTime(startDate.ToString("yyyy-MM-dd HH:00")) - new TimeSpan(0, StartDateInterval, 0, 0); + break; + case CommonProperty.MCandleTimeType.H4: + 구매이전봉 = Convert.ToDateTime(startDate.ToString("yyyy-MM-dd HH:00")) - new TimeSpan(0, StartDateInterval * 4, 0, 0); + break; + case CommonProperty.MCandleTimeType.M1: + break; + case CommonProperty.MCandleTimeType.M10: + case CommonProperty.MCandleTimeType.M15: + case CommonProperty.MCandleTimeType.M3: + case CommonProperty.MCandleTimeType.M30: + case CommonProperty.MCandleTimeType.M5: + break; + case CommonProperty.MCandleTimeType.D1: + 구매이전봉 = Convert.ToDateTime(endDate.ToString("yyyy-MM-dd")) - new TimeSpan(StartDateInterval, 0, 0, 0); + break; + } + + var candleData = analysisData.CandleDatas[MCandleTimeType].Find(item => item.DateTime == 구매이전봉); + // 시간대 캔들이 없으면 결과에서 제외 + if (candleData == null) + { + analysisData.Description = "[오류:캔들없음]" + analysisData.Description; + analysisData.Inclusion = false; + continue; + } + + var highValue = candleData.HighValue; + + var bol402 = candleData.IndicatorDic["Bol402"]?.value; + + if (bol402 != null) + { + // 제외된 조건인 아닌 경우 + if (analysisData.Inclusion) + { + if (highValue < bol402) + { + analysisData.Inclusion = true; + analysisData.Description = '[' + checkEdit_이전봉40_2볼린저이하.Text + ']' + analysisData.Description; + } + else + analysisData.Inclusion = false; + } + + } + } + } + } + + // 이전봉40_1볼린저이하 + if (checkEdit_구매이전봉볼린저40_1이하.Checked) + { + // 구매 시점 이전 봉 40 1 볼린저 값 이하 + foreach (var analysisData in parentForm._analysisDatas) + { + var startDate = analysisData.StartDate; + var endDate = analysisData.EndDate; + + if (checkEdit_구매이전봉볼린저40_1이하.Checked) + { + var 구매이전봉 = startDate; + + //차트 Date Time 설정하기 + var StartDateInterval = 1; + + switch (MCandleTimeType) + { + case CommonProperty.MCandleTimeType.H1: + 구매이전봉 = Convert.ToDateTime(startDate.ToString("yyyy-MM-dd HH:00")) - new TimeSpan(0, StartDateInterval, 0, 0); + break; + case CommonProperty.MCandleTimeType.H4: + 구매이전봉 = Convert.ToDateTime(startDate.ToString("yyyy-MM-dd HH:00")) - new TimeSpan(0, StartDateInterval * 4, 0, 0); + break; + case CommonProperty.MCandleTimeType.M1: + break; + case CommonProperty.MCandleTimeType.M10: + case CommonProperty.MCandleTimeType.M15: + case CommonProperty.MCandleTimeType.M3: + case CommonProperty.MCandleTimeType.M30: + case CommonProperty.MCandleTimeType.M5: + break; + case CommonProperty.MCandleTimeType.D1: + 구매이전봉 = Convert.ToDateTime(endDate.ToString("yyyy-MM-dd")) - new TimeSpan(StartDateInterval, 0, 0, 0); + break; + } + + var candleData = analysisData.CandleDatas[MCandleTimeType].Find(item => item.DateTime == 구매이전봉); + // 시간대 캔들이 없으면 결과에서 제외 + if (candleData == null) + { + analysisData.Description = "[오류:캔들없음]" + analysisData.Description; + analysisData.Inclusion = false; + continue; + } + + var highValue = candleData.HighValue; + + var bol401 = candleData.IndicatorDic["Bol401"]?.value; + + if (bol401 != null) + { + // 제외된 조건인 아닌 경우 + if (analysisData.Inclusion) + { + if (highValue < bol401) + { + analysisData.Inclusion = true; + analysisData.Description = '[' + checkEdit_이전봉40_2볼린저이하.Text + ']' + analysisData.Description; + } + else + analysisData.Inclusion = false; + } + + } + } + } + } + + parentForm.treeList_ResultData.RefreshDataSource(); + parentForm.CalcurateProfitAndWinRate(); + + } + + /// + /// 이전봉40_2볼린저이하 + /// + /// + /// + private void checkEdit_common_CheckedChanged(object sender, EventArgs e) + { + if(!ignoreChangedfilter) + { + calcurateFilter(); } } From 37b116177fc63a284f9e23271b837c313087ebfa Mon Sep 17 00:00:00 2001 From: jwlee Date: Tue, 9 May 2023 17:37:29 +0900 Subject: [PATCH 3/6] =?UTF-8?q?=EC=BB=A4=EB=B0=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Million Hunter/Million Hunter.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/Million Hunter/Million Hunter.csproj b/Million Hunter/Million Hunter.csproj index b7b5765..ba766f1 100644 --- a/Million Hunter/Million Hunter.csproj +++ b/Million Hunter/Million Hunter.csproj @@ -153,6 +153,7 @@ TestBoardForm.cs + ResXFileCodeGenerator Resources.Designer.cs From 78cd321aea8f019d05db73f9711d60e3e4f6884e Mon Sep 17 00:00:00 2001 From: "DESKTOP-1A3P75F\\lee" Date: Tue, 9 May 2023 17:41:18 +0900 Subject: [PATCH 4/6] =?UTF-8?q?=EB=B3=91=ED=95=A9=20=EC=9E=84=EC=8B=9C?= =?UTF-8?q?=EC=BB=A4=EB=B0=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Million Hunter/HunterSubForm/TestBoardForm.cs | 71 +++++++++++++++++++ Million/Manager/UIController.cs | 20 ++++++ Million/Million Core.csproj | 1 + 3 files changed, 92 insertions(+) create mode 100644 Million/Manager/UIController.cs diff --git a/Million Hunter/HunterSubForm/TestBoardForm.cs b/Million Hunter/HunterSubForm/TestBoardForm.cs index 8505569..b02b269 100644 --- a/Million Hunter/HunterSubForm/TestBoardForm.cs +++ b/Million Hunter/HunterSubForm/TestBoardForm.cs @@ -1,6 +1,7 @@ using DevExpress.XtraEditors; using Million; using Million.Data; +using Million.DbManagement; using Million.HunterSubForm; using Million.IndicatorConditionSetup; using Million.Manager; @@ -11,6 +12,7 @@ using System.Data; using System.Drawing; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; @@ -29,6 +31,8 @@ namespace Million_Hunter.HunterSubForm InitializeComponent(); parentForm = resultViewerForm; analysisDatas = parentForm._analysisDatas; + + } /// @@ -170,6 +174,73 @@ namespace Million_Hunter.HunterSubForm private void simpleButton_찬_Click(object sender, EventArgs e) { + progressBar1.Minimum = 0; + progressBar1.Step = 1; + progressBar1.Value = 0; + progressBar1.Maximum = parentForm._analysisDatas.Count; + + new Thread(() => test11()).Start(); + } + + private void test11() + { + + var _chartIndicatorCoditionSetups = new List(); + + _chartIndicatorCoditionSetups.Add(new BolingerConditionSetup() + { + IndicatorType = CommonProperty.IndicatorType.볼린저밴드, + Period = 40, + Squared = 1, + Description = "bol40_1", + MCandleTimeType = CommonProperty.MCandleTimeType.M1 + }); ; + + var lowAverArr = new List(); + var lowAverPlusArr = new List(); + + foreach (var analysis in parentForm._analysisDatas) + { + var chartStartDate = analysis.StartDate; + var chartEndDate = analysis.EndDate; + + var data = DbServiceFunctions.GetCandleData(analysis.OriginalSearchResult.MarketData, chartStartDate, chartEndDate, CommonProperty.MCandleTimeType.M1); + + var selData = data.CandleDataLists_Im.Where(x => x.DateTime > chartStartDate && x.DateTime < chartEndDate).ToList(); + + if (selData.Count != 0) + { + + + var lowValue = selData.Min(x => x.LowValue); + if (analysis.BuyValue < analysis.SellValue) + { + lowAverPlusArr.Add((analysis.BuyValue - lowValue) / analysis.BuyValue); + } + else + { + lowAverArr.Add((analysis.BuyValue - lowValue) / analysis.BuyValue); + } + } + + UIController.next(this, progressBar1); + } + + double aver = 0.0; + foreach(var low in lowAverArr) + { + aver += low; + } + aver = aver / lowAverArr.Count; + + double aver2 = 0.0; + foreach (var low in lowAverPlusArr) + { + aver2 += low; + } + aver2 = aver2 / lowAverPlusArr.Count; + + aver.ToString(); } } diff --git a/Million/Manager/UIController.cs b/Million/Manager/UIController.cs new file mode 100644 index 0000000..be0cbf6 --- /dev/null +++ b/Million/Manager/UIController.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Million.Manager +{ + public static class UIController + { + public static void next(Form subForm, ProgressBar progressBar) + { + subForm.Invoke(new MethodInvoker(delegate () + { + progressBar.PerformStep(); + })); + } + } +} diff --git a/Million/Million Core.csproj b/Million/Million Core.csproj index 0003439..80ae6ef 100644 --- a/Million/Million Core.csproj +++ b/Million/Million Core.csproj @@ -203,6 +203,7 @@ + From 679e923ba198553806adce6bdea751d5cd556cd7 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1A3P75F\\lee" Date: Tue, 9 May 2023 17:43:23 +0900 Subject: [PATCH 5/6] =?UTF-8?q?=EB=B3=91=ED=95=A9=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HunterSubForm/TestBoardForm.Designer.cs | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/Million Hunter/HunterSubForm/TestBoardForm.Designer.cs b/Million Hunter/HunterSubForm/TestBoardForm.Designer.cs index 6974f55..fe3b486 100644 --- a/Million Hunter/HunterSubForm/TestBoardForm.Designer.cs +++ b/Million Hunter/HunterSubForm/TestBoardForm.Designer.cs @@ -36,6 +36,8 @@ namespace Million_Hunter.HunterSubForm this.checkEdit_이전봉40_2볼린저이하 = new DevExpress.XtraEditors.CheckEdit(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.simpleButton_Reset = new DevExpress.XtraEditors.SimpleButton(); + this.progressBar1 = new System.Windows.Forms.ProgressBar(); + this.simpleButton_찬 = new DevExpress.XtraEditors.SimpleButton(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.checkEdit_구매이전봉볼린저40_1이하.Properties)).BeginInit(); @@ -103,14 +105,12 @@ namespace Million_Hunter.HunterSubForm this.groupBox3.TabStop = false; this.groupBox3.Text = "데이터 채우기"; // - // simpleButton_찬 + // simpleButton_Reset // - this.simpleButton_찬.Location = new System.Drawing.Point(18, 225); - this.simpleButton_찬.Name = "simpleButton_찬"; - this.simpleButton_찬.Size = new System.Drawing.Size(104, 32); - this.simpleButton_찬.TabIndex = 4; - this.simpleButton_찬.Text = "찬테스트"; - this.simpleButton_찬.Click += new System.EventHandler(this.simpleButton_찬_Click); + this.simpleButton_Reset.Location = new System.Drawing.Point(0, 0); + this.simpleButton_Reset.Name = "simpleButton_Reset"; + this.simpleButton_Reset.Size = new System.Drawing.Size(75, 23); + this.simpleButton_Reset.TabIndex = 0; // // progressBar1 // @@ -120,6 +120,15 @@ namespace Million_Hunter.HunterSubForm this.progressBar1.Size = new System.Drawing.Size(852, 23); this.progressBar1.TabIndex = 5; // + // simpleButton_찬 + // + this.simpleButton_찬.Location = new System.Drawing.Point(737, 33); + this.simpleButton_찬.Name = "simpleButton_찬"; + this.simpleButton_찬.Size = new System.Drawing.Size(104, 32); + this.simpleButton_찬.TabIndex = 4; + this.simpleButton_찬.Text = "찬테스트"; + this.simpleButton_찬.Click += new System.EventHandler(this.simpleButton_찬_Click); + // // TestBoardForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); @@ -127,7 +136,6 @@ namespace Million_Hunter.HunterSubForm this.ClientSize = new System.Drawing.Size(853, 297); this.Controls.Add(this.progressBar1); this.Controls.Add(this.simpleButton_찬); - this.Controls.Add(this.simpleButton_Calc); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.Name = "TestBoardForm"; @@ -147,7 +155,6 @@ namespace Million_Hunter.HunterSubForm private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.CheckedListBox checkedListBox_Indicator; - private DevExpress.XtraEditors.SimpleButton simpleButton_Calc; private DevExpress.XtraEditors.SimpleButton simpleButton_찬; private System.Windows.Forms.ProgressBar progressBar1; private DevExpress.XtraEditors.CheckEdit checkEdit_이전봉40_2볼린저이하; From eb99c5a8ad33f43e1e9fad7fd059dfa631a97532 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1A3P75F\\lee" Date: Wed, 10 May 2023 12:14:42 +0900 Subject: [PATCH 6/6] =?UTF-8?q?openxml=20=EC=97=91=EC=85=80=20=EC=B6=9C?= =?UTF-8?q?=EB=A0=A5=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80,=20?= =?UTF-8?q?=EC=8A=B9=ED=8C=A8=EC=8B=9C=20=EC=88=98=EC=9D=B5=EB=A5=A0=20?= =?UTF-8?q?=EA=B3=84=EC=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Million Hunter/HunterSubForm/TestBoardForm.cs | 88 +++++++++++-------- Million/Manager/ExcelExport.cs | 54 ++++++++++++ Million/Million Core.csproj | 1 + 3 files changed, 106 insertions(+), 37 deletions(-) create mode 100644 Million/Manager/ExcelExport.cs diff --git a/Million Hunter/HunterSubForm/TestBoardForm.cs b/Million Hunter/HunterSubForm/TestBoardForm.cs index 329e132..33a1547 100644 --- a/Million Hunter/HunterSubForm/TestBoardForm.cs +++ b/Million Hunter/HunterSubForm/TestBoardForm.cs @@ -363,50 +363,64 @@ namespace Million_Hunter.HunterSubForm var lowAverArr = new List(); var lowAverPlusArr = new List(); - foreach (var analysis in parentForm._analysisDatas) { - var chartStartDate = analysis.StartDate; - var chartEndDate = analysis.EndDate; - - var data = DbServiceFunctions.GetCandleData(analysis.OriginalSearchResult.MarketData, chartStartDate, chartEndDate, CommonProperty.MCandleTimeType.M1); - - var selData = data.CandleDataLists_Im.Where(x => x.DateTime > chartStartDate && x.DateTime < chartEndDate).ToList(); - - if (selData.Count != 0) + if(analysis.BuyValue >= analysis.SellValue) { - - - var lowValue = selData.Min(x => x.LowValue); - if (analysis.BuyValue < analysis.SellValue) - { - lowAverPlusArr.Add((analysis.BuyValue - lowValue) / analysis.BuyValue); - } - else - { - lowAverArr.Add((analysis.BuyValue - lowValue) / analysis.BuyValue); - } + lowAverPlusArr.Add((analysis.SellValue - analysis.BuyValue) / analysis.BuyValue); + } + else + { + lowAverArr.Add((analysis.SellValue - analysis.BuyValue) / analysis.BuyValue); } - UIController.next(this, progressBar1); } - double aver = 0.0; - foreach(var low in lowAverArr) - { - aver += low; + + /* + foreach (var analysis in parentForm._analysisDatas) + { + var chartStartDate = analysis.StartDate; + var chartEndDate = analysis.EndDate; + + var data = DbServiceFunctions.GetCandleData(analysis.OriginalSearchResult.MarketData, chartStartDate, chartEndDate, CommonProperty.MCandleTimeType.M1); + + var selData = data.CandleDataLists_Im.Where(x => x.DateTime > chartStartDate && x.DateTime < chartEndDate).ToList(); + + if (selData.Count != 0) + { + + + var lowValue = selData.Min(x => x.LowValue); + if (analysis.BuyValue < analysis.SellValue) + { + lowAverPlusArr.Add((analysis.BuyValue - lowValue) / analysis.BuyValue); + } + else + { + lowAverArr.Add((analysis.BuyValue - lowValue) / analysis.BuyValue); + } + } + + UIController.next(this, progressBar1); + } + */ + double aver = 0.0; + foreach(var low in lowAverArr) + { + aver += low; + } + aver = aver / lowAverArr.Count; + + double aver2 = 0.0; + foreach (var low in lowAverPlusArr) + { + aver2 += low; + } + aver2 = aver2 / lowAverPlusArr.Count; + + aver.ToString(); + } - aver = aver / lowAverArr.Count; - - double aver2 = 0.0; - foreach (var low in lowAverPlusArr) - { - aver2 += low; - } - aver2 = aver2 / lowAverPlusArr.Count; - - aver.ToString(); - - } } } \ No newline at end of file diff --git a/Million/Manager/ExcelExport.cs b/Million/Manager/ExcelExport.cs new file mode 100644 index 0000000..c17647e --- /dev/null +++ b/Million/Manager/ExcelExport.cs @@ -0,0 +1,54 @@ + +using DocumentFormat.OpenXml; +using DocumentFormat.OpenXml.Packaging; +using DocumentFormat.OpenXml.Spreadsheet; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Million.Manager +{ + public static class ExcelExport + { + + public static void export(String path ,List> data) + { + using (SpreadsheetDocument spreadsheetDocument = SpreadsheetDocument.Create(path, SpreadsheetDocumentType.Workbook)) + { + // WorkbookPart 객체를 만듭니다. + WorkbookPart workbookPart = spreadsheetDocument.AddWorkbookPart(); + workbookPart.Workbook = new Workbook(); + + // WorksheetPart 객체를 만듭니다. + WorksheetPart worksheetPart = workbookPart.AddNewPart(); + worksheetPart.Worksheet = new Worksheet(new SheetData()); + + // Sheet 객체를 만듭니다. + Sheets sheets = spreadsheetDocument.WorkbookPart.Workbook.AppendChild(new Sheets()); + Sheet sheet = new Sheet() { Id = spreadsheetDocument.WorkbookPart.GetIdOfPart(worksheetPart), SheetId = 1, Name = "Sheet1" }; + sheets.Append(sheet); + + // 데이터를 출력합니다. + SheetData sheetData = worksheetPart.Worksheet.GetFirstChild(); + Row headerRow = new Row(); + foreach (string key in data.First().Keys) + { + headerRow.AppendChild(new Cell() { CellValue = new CellValue(key), DataType = CellValues.String }); + } + sheetData.AppendChild(headerRow); + + foreach (var row in data) + { + Row dataRow = new Row(); + foreach (var key in row.Keys) + { + dataRow.AppendChild(new Cell() { CellValue = new CellValue(row[key].ToString()), DataType = CellValues.String }); + } + sheetData.AppendChild(dataRow); + } + } + } + } +} diff --git a/Million/Million Core.csproj b/Million/Million Core.csproj index 80ae6ef..2a88309 100644 --- a/Million/Million Core.csproj +++ b/Million/Million Core.csproj @@ -194,6 +194,7 @@ +