에러 및 check box 매개변수 데이터 수정

This commit is contained in:
kyh
2022-11-23 11:04:00 +09:00
parent 3c5bbe71f7
commit 001df1d434
9 changed files with 44 additions and 24 deletions

View File

@@ -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;
}
}

View File

@@ -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)
@@ -188,6 +191,7 @@ namespace Million_Buyer
ThreadFlag = true;
cb_UserList.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());

View File

@@ -132,7 +132,6 @@
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\licenses.licx" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>

View File

@@ -1 +0,0 @@
DevExpress.XtraTreeList.TreeList, DevExpress.XtraTreeList.v18.2, Version=18.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

View File

@@ -134,7 +134,6 @@
<EmbeddedResource Include="HunterMainForm.resx">
<DependentUpon>HunterMainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\licenses.licx" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>

View File

@@ -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 사고 파는 로직
//최신 데이터 가져오기

View File

@@ -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 사용하는 부분예외처리
/// <summary>

View File

@@ -317,7 +317,7 @@ namespace Million.Manager
/// <param name="childrenCandleDataList"></param>
/// <returns></returns>
public static void SwitchFun(List<IndicatorCoditionSetup> totalIndicator, IndicatorCoditionSetup setUp, List<CandleData> parentCandleDataList,
List<CandleData> childrenCandleDataList, List<IndicatorCoditionSetup> subIndicator, bool upperMainIndicatorFlag, bool recentlyDataFlag, string coinFullName)
List<CandleData> childrenCandleDataList, List<IndicatorCoditionSetup> 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
/// <param name="childrenCandleDataList"></param>
/// <returns></returns>
public static void FirstTranspierce(IndicatorCoditionSetup setUp, List<CandleData> parentCandleDataList, List<CandleData> childrenCandleDataList,
List<IndicatorCoditionSetup> totalIndicators, bool upperMainIndicatorFlag, bool recentlyDataFlag, string coinFullName)
List<IndicatorCoditionSetup> 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])
{
@@ -626,7 +626,6 @@ namespace Million.Manager
}
}
}
}
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
/// <param name="subIndicator"></param>
public static void GetCalculateIndicator(List<IndicatorCoditionSetup> totalIndicator, List<string> indiList, List<IndicatorCoditionSetup> lossIndicator,
DateTime startDate, DateTime endDate, List<CandleData> resultCandleDataList, List<IndicatorCoditionSetup> subIndicator,
Dictionary<MCandleTimeType, List<CandleData>> parentList, bool upperMainIndicatorFlag, bool recentlyDataFlag = false, string coinFullName = null)
Dictionary<MCandleTimeType, List<CandleData>> 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);
}
}
}

View File

@@ -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);
}
/// <summary>
@@ -89,7 +89,7 @@ namespace Million.Manager
/// <param name="endDate"></param>
/// <returns></returns>
public static Dictionary<MCandleTimeType, List<CandleData>> CalculateIndicator(Dictionary<MCandleTimeType, List<CandleData>> dic,
List<IndicatorCoditionSetup> totalIndicators, DateTime startDate, DateTime endDate, bool upperMainIndicatorFlag,string coinFullName = null, bool recentlyDataFlag = false)
List<IndicatorCoditionSetup> 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;
}
}