From 001df1d434678f2c7dd3d13886c0f744ac6867b3 Mon Sep 17 00:00:00 2001
From: kyh <1329522@naver.com>
Date: Wed, 23 Nov 2022 11:04:00 +0900
Subject: [PATCH] =?UTF-8?q?=EC=97=90=EB=9F=AC=20=EB=B0=8F=20check=20box=20?=
=?UTF-8?q?=EB=A7=A4=EA=B0=9C=EB=B3=80=EC=88=98=20=EB=8D=B0=EC=9D=B4?=
=?UTF-8?q?=ED=84=B0=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Million Buyer/MainForm.Designer.cs | 23 +++++++++++++++++++----
Million Buyer/MainForm.cs | 10 +++++++---
Million Buyer/Million Buyer.csproj | 1 -
Million Buyer/Properties/licenses.licx | 1 -
Million Hunter/Million Hunter.csproj | 1 -
Million Prototype/Form1.cs | 2 +-
Million/CommonProperty.cs | 5 +++++
Million/Manager/CalculateManager.cs | 17 ++++++++---------
Million/Manager/IndicatorSetupManager.cs | 8 ++++----
9 files changed, 44 insertions(+), 24 deletions(-)
delete mode 100644 Million Buyer/Properties/licenses.licx
diff --git a/Million Buyer/MainForm.Designer.cs b/Million Buyer/MainForm.Designer.cs
index 8b32e97..e52bcbe 100644
--- a/Million Buyer/MainForm.Designer.cs
+++ b/Million Buyer/MainForm.Designer.cs
@@ -88,6 +88,7 @@
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.splitContainerControl1 = new DevExpress.XtraEditors.SplitContainerControl();
this.splitContainerControl2 = new DevExpress.XtraEditors.SplitContainerControl();
+ this.cb_DownBeforeValueFlag = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tl_BuyList)).BeginInit();
@@ -102,6 +103,7 @@
//
// groupBox1
//
+ this.groupBox1.Controls.Add(this.cb_DownBeforeValueFlag);
this.groupBox1.Controls.Add(this.cb_UpperMainIndi);
this.groupBox1.Controls.Add(this.cb_IncludeClearIndicator);
this.groupBox1.Controls.Add(this.lb_IndiName);
@@ -115,7 +117,7 @@
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Location = new System.Drawing.Point(12, 123);
this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(362, 185);
+ this.groupBox1.Size = new System.Drawing.Size(362, 206);
this.groupBox1.TabIndex = 5;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "데이터 Setting";
@@ -228,7 +230,7 @@
this.groupBox2.Controls.Add(this.label10);
this.groupBox2.Controls.Add(this.lb_BuyMarketCount);
this.groupBox2.Controls.Add(this.label3);
- this.groupBox2.Location = new System.Drawing.Point(12, 312);
+ this.groupBox2.Location = new System.Drawing.Point(12, 335);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(362, 72);
this.groupBox2.TabIndex = 6;
@@ -474,10 +476,10 @@
this.lb_log.FormattingEnabled = true;
this.lb_log.HorizontalScrollbar = true;
this.lb_log.ItemHeight = 12;
- this.lb_log.Location = new System.Drawing.Point(12, 390);
+ this.lb_log.Location = new System.Drawing.Point(12, 414);
this.lb_log.Name = "lb_log";
this.lb_log.ScrollAlwaysVisible = true;
- this.lb_log.Size = new System.Drawing.Size(362, 352);
+ this.lb_log.Size = new System.Drawing.Size(362, 328);
this.lb_log.TabIndex = 16;
//
// bt_alive
@@ -691,6 +693,18 @@
this.splitContainerControl2.SplitterPosition = 442;
this.splitContainerControl2.TabIndex = 23;
//
+ // cb_DownBeforeValueFlag
+ //
+ this.cb_DownBeforeValueFlag.AutoSize = true;
+ this.cb_DownBeforeValueFlag.Checked = true;
+ this.cb_DownBeforeValueFlag.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.cb_DownBeforeValueFlag.Location = new System.Drawing.Point(10, 177);
+ this.cb_DownBeforeValueFlag.Name = "cb_DownBeforeValueFlag";
+ this.cb_DownBeforeValueFlag.Size = new System.Drawing.Size(312, 16);
+ this.cb_DownBeforeValueFlag.TabIndex = 10;
+ this.cb_DownBeforeValueFlag.Text = "최초돌파 검색 시 메인조건이 사전조건보다 높아야 함";
+ this.cb_DownBeforeValueFlag.UseVisualStyleBackColor = true;
+ //
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
@@ -789,6 +803,7 @@
private System.Windows.Forms.Timer timer1;
private DevExpress.XtraEditors.SplitContainerControl splitContainerControl1;
private DevExpress.XtraEditors.SplitContainerControl splitContainerControl2;
+ private System.Windows.Forms.CheckBox cb_DownBeforeValueFlag;
}
}
diff --git a/Million Buyer/MainForm.cs b/Million Buyer/MainForm.cs
index b392bcd..e034f92 100644
--- a/Million Buyer/MainForm.cs
+++ b/Million Buyer/MainForm.cs
@@ -162,6 +162,9 @@ namespace Million_Buyer
bt_BuyStart_Click(null, null);
+ CommonProperty.UpperMainIndicatorFlag = cb_UpperMainIndi.Checked;
+ CommonProperty.DownBeforeValueFlag = cb_DownBeforeValueFlag.Checked;
+
if (!RealTimeMode)
{
if (cycleCount == 0 || cycleBuyMoney == 0)
@@ -187,7 +190,8 @@ namespace Million_Buyer
ThreadFlag = true;
cb_UserList.Enabled = false;
- cb_AccountList.Enabled = false;
+ cb_AccountList.Enabled = false;
+ cb_DownBeforeValueFlag.Enabled = false;
}
}
}
@@ -212,7 +216,7 @@ namespace Million_Buyer
cb_UserList.Enabled = true;
cb_AccountList.Enabled = true;
-
+ cb_DownBeforeValueFlag.Enabled = true;
/*
* 종료 된 후 데이터 처리 소스는 여기서 처리
* 1. Grid에 Stop 후 데이터 처리
@@ -478,7 +482,7 @@ namespace Million_Buyer
var maxDateTime = dic[MCandleTimeType.M1].Select(t => t.DateTime).Max().AddHours(1);
sw.Restart();
- dic = IndicatorSetupManager.CalculateIndicator(dic, totalIndicatorList, minDateTime, maxDateTime, cb_UpperMainIndi.Checked, item, true);
+ dic = IndicatorSetupManager.CalculateIndicator(dic, totalIndicatorList, minDateTime, maxDateTime, item, true);
sw.Stop();
if (sw.Elapsed.TotalSeconds > 1)
InsertLog("Indicator Calculate 계산 시간 : " + sw.Elapsed.ToString());
diff --git a/Million Buyer/Million Buyer.csproj b/Million Buyer/Million Buyer.csproj
index dfc73b7..475affd 100644
--- a/Million Buyer/Million Buyer.csproj
+++ b/Million Buyer/Million Buyer.csproj
@@ -132,7 +132,6 @@
MainForm.cs
-
ResXFileCodeGenerator
Resources.Designer.cs
diff --git a/Million Buyer/Properties/licenses.licx b/Million Buyer/Properties/licenses.licx
deleted file mode 100644
index 89458f2..0000000
--- a/Million Buyer/Properties/licenses.licx
+++ /dev/null
@@ -1 +0,0 @@
-DevExpress.XtraTreeList.TreeList, DevExpress.XtraTreeList.v18.2, Version=18.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
diff --git a/Million Hunter/Million Hunter.csproj b/Million Hunter/Million Hunter.csproj
index 8ff2e74..125dc9a 100644
--- a/Million Hunter/Million Hunter.csproj
+++ b/Million Hunter/Million Hunter.csproj
@@ -134,7 +134,6 @@
HunterMainForm.cs
-
ResXFileCodeGenerator
Resources.Designer.cs
diff --git a/Million Prototype/Form1.cs b/Million Prototype/Form1.cs
index 0d2489f..9a48977 100644
--- a/Million Prototype/Form1.cs
+++ b/Million Prototype/Form1.cs
@@ -302,7 +302,7 @@ namespace Million_Prototype
var maxDateTime = dic[MCandleTimeType.M1].Select(t => t.DateTime).Max().AddHours(1);
//2차 data calculate 처리
- dic = IndicatorSetupManager.CalculateIndicator(dic, totalIndicatorList, minDateTime, maxDateTime, true, item, true);
+ dic = IndicatorSetupManager.CalculateIndicator(dic, totalIndicatorList, minDateTime, maxDateTime, item, true);
#region 사고 파는 로직
//최신 데이터 가져오기
diff --git a/Million/CommonProperty.cs b/Million/CommonProperty.cs
index e5ed8fe..3dd4773 100644
--- a/Million/CommonProperty.cs
+++ b/Million/CommonProperty.cs
@@ -338,6 +338,11 @@ namespace Million
public static string AnalysisExtendFolder = "_analysis";
#endregion
+ #region Buyer Flag
+
+ public static bool UpperMainIndicatorFlag = true;
+ public static bool DownBeforeValueFlag = true;
+ #endregion
#region Realtime 관련 Sub data 사용하는 부분예외처리
///
diff --git a/Million/Manager/CalculateManager.cs b/Million/Manager/CalculateManager.cs
index e4f6a0e..d9ab332 100644
--- a/Million/Manager/CalculateManager.cs
+++ b/Million/Manager/CalculateManager.cs
@@ -317,7 +317,7 @@ namespace Million.Manager
///
///
public static void SwitchFun(List totalIndicator, IndicatorCoditionSetup setUp, List parentCandleDataList,
- List childrenCandleDataList, List subIndicator, bool upperMainIndicatorFlag, bool recentlyDataFlag, string coinFullName)
+ List childrenCandleDataList, List subIndicator, bool recentlyDataFlag, string coinFullName)
{
parentCandleDataList = parentCandleDataList.OrderBy(t => t.DateTime).ToList();
childrenCandleDataList = childrenCandleDataList.OrderBy(t => t.DateTime).ToList();
@@ -354,7 +354,7 @@ namespace Million.Manager
//최초돌파
else if (setUp.SubIndicatorSetupType == SubIndicatorSetupType.최초돌파)
{
- FirstTranspierce(setUp, parentCandleDataList, childrenCandleDataList, totalIndicator, upperMainIndicatorFlag, recentlyDataFlag, coinFullName);
+ FirstTranspierce(setUp, parentCandleDataList, childrenCandleDataList, totalIndicator, recentlyDataFlag, coinFullName);
}
//크로스
else if (setUp.SubIndicatorSetupType == SubIndicatorSetupType.크로스)
@@ -566,7 +566,7 @@ namespace Million.Manager
///
///
public static void FirstTranspierce(IndicatorCoditionSetup setUp, List parentCandleDataList, List childrenCandleDataList,
- List totalIndicators, bool upperMainIndicatorFlag, bool recentlyDataFlag, string coinFullName)
+ List totalIndicators, bool recentlyDataFlag, string coinFullName)
{
// 정규 식 없을 경우 단순 돌파와 같음
if (string.IsNullOrWhiteSpace(setUp.FirstOverSubRegExpression))
@@ -616,7 +616,7 @@ namespace Million.Manager
{
subFlag = true;
//TODO 조건을 넣어서 처리 할 수 있도록 개선 필요
- if (recentlyDataFlag)
+ if (recentlyDataFlag && CommonProperty.DownBeforeValueFlag)
{
if (subManagement[coinFullName])
{
@@ -625,8 +625,7 @@ namespace Million.Manager
subManagement[coinFullName] = false;
}
}
- }
-
+ }
}
else
{
@@ -671,7 +670,7 @@ namespace Million.Manager
if (recentlyDataFlag)
if (!subManagement[coinFullName]) continue;
- if (upperMainIndicatorFlag)
+ if (CommonProperty.UpperMainIndicatorFlag)
if (overlapData < subVal) continue;
//TODO Tick 차이 관련 조건 식 추가 예정
@@ -1311,7 +1310,7 @@ namespace Million.Manager
///
public static void GetCalculateIndicator(List totalIndicator, List indiList, List lossIndicator,
DateTime startDate, DateTime endDate, List resultCandleDataList, List subIndicator,
- Dictionary> parentList, bool upperMainIndicatorFlag, bool recentlyDataFlag = false, string coinFullName = null)
+ Dictionary> parentList, bool recentlyDataFlag = false, string coinFullName = null)
{
//최신 Child데이터 계산하기 전에 부모 자식 관계 정리부터 처리
var parentKeys = parentList.Keys;
@@ -1361,7 +1360,7 @@ namespace Million.Manager
list = list.Where(t => t.RecentlyDataFlag).ToList();
}
- SwitchFun(totalIndicator, indicator, list, resultCandleDataList, subIndicator, upperMainIndicatorFlag, recentlyDataFlag, coinFullName);
+ SwitchFun(totalIndicator, indicator, list, resultCandleDataList, subIndicator, recentlyDataFlag, coinFullName);
}
}
}
diff --git a/Million/Manager/IndicatorSetupManager.cs b/Million/Manager/IndicatorSetupManager.cs
index 9e6074b..175ce04 100644
--- a/Million/Manager/IndicatorSetupManager.cs
+++ b/Million/Manager/IndicatorSetupManager.cs
@@ -77,7 +77,7 @@ namespace Million.Manager
// 총 데이터
var dic = DataManager.GetStandardData(totalIndicators, startDate, endDate, market, distinctIndicator, true);
- return CalculateIndicator(dic, totalIndicators, startDate, endDate, false);
+ return CalculateIndicator(dic, totalIndicators, startDate, endDate, null, false);
}
///
@@ -89,7 +89,7 @@ namespace Million.Manager
///
///
public static Dictionary> CalculateIndicator(Dictionary> dic,
- List totalIndicators, DateTime startDate, DateTime endDate, bool upperMainIndicatorFlag,string coinFullName = null, bool recentlyDataFlag = false)
+ List totalIndicators, DateTime startDate, DateTime endDate,string coinFullName = null, bool recentlyDataFlag = false)
{
dic[MCandleTimeType.M1] = dic[MCandleTimeType.M1].Where(t => startDate <= t.DateTime && t.DateTime < endDate).ToList();
// Sub Indicator string list 반환
@@ -100,7 +100,7 @@ namespace Million.Manager
// 선처리
CalculateManager.GetCalculateIndicator(totalIndicators, subIndStringList, null, startDate,
- endDate, dic[MCandleTimeType.M1], subIndicator, dic, recentlyDataFlag, upperMainIndicatorFlag, coinFullName);
+ endDate, dic[MCandleTimeType.M1], subIndicator, dic, recentlyDataFlag, coinFullName);
var totalIndi = totalIndicators.Select(t => t.IndexString).ToList();
@@ -110,7 +110,7 @@ namespace Million.Manager
// 후처리
CalculateManager.GetCalculateIndicator(totalIndicators, totalIndi, null, startDate,
- endDate, dic[MCandleTimeType.M1], subIndicator, dic, recentlyDataFlag, upperMainIndicatorFlag, coinFullName);
+ endDate, dic[MCandleTimeType.M1], subIndicator, dic, recentlyDataFlag, coinFullName);
return dic;
}
}