사는 케이스에서 전봉의 고가가 현재 살 가격보다 높은 경우 예외처리 코드 추가

This commit is contained in:
kyh
2023-05-12 13:36:47 +09:00
parent 4820f5016e
commit 14712fcf1e
5 changed files with 57 additions and 21 deletions

View File

@@ -83,6 +83,7 @@ namespace Million
this.cb_DownBeforeValueFlag = new System.Windows.Forms.CheckBox();
this.cb_IncludeClearIndicator = new System.Windows.Forms.CheckBox();
this.cb_UpperMainIndi = new System.Windows.Forms.CheckBox();
this.cb_StarValueLowOverlapUp = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.comboBoxEdit_IndicatorSelection.Properties)).BeginInit();
this.groupBox2.SuspendLayout();
@@ -148,9 +149,9 @@ namespace Million
this.groupBox2.Controls.Add(this.simpleButton_TobuyList);
this.groupBox2.Controls.Add(this.panelControl_IndicatorSetup);
this.groupBox2.Controls.Add(this.groupBox1);
this.groupBox2.Location = new System.Drawing.Point(12, 91);
this.groupBox2.Location = new System.Drawing.Point(12, 132);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(913, 393);
this.groupBox2.Size = new System.Drawing.Size(913, 352);
this.groupBox2.TabIndex = 0;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "조건 설정";
@@ -217,7 +218,7 @@ namespace Million
this.simpleButton_ToSellList.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.simpleButton_ToSellList.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
this.simpleButton_ToSellList.Appearance.Options.UseBackColor = true;
this.simpleButton_ToSellList.Location = new System.Drawing.Point(807, 352);
this.simpleButton_ToSellList.Location = new System.Drawing.Point(807, 311);
this.simpleButton_ToSellList.Name = "simpleButton_ToSellList";
this.simpleButton_ToSellList.Size = new System.Drawing.Size(97, 31);
this.simpleButton_ToSellList.TabIndex = 2;
@@ -229,7 +230,7 @@ namespace Million
this.simpleButton_SetupEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.simpleButton_SetupEdit.Appearance.ForeColor = System.Drawing.Color.Blue;
this.simpleButton_SetupEdit.Appearance.Options.UseForeColor = true;
this.simpleButton_SetupEdit.Location = new System.Drawing.Point(469, 352);
this.simpleButton_SetupEdit.Location = new System.Drawing.Point(469, 311);
this.simpleButton_SetupEdit.Name = "simpleButton_SetupEdit";
this.simpleButton_SetupEdit.Size = new System.Drawing.Size(97, 31);
this.simpleButton_SetupEdit.TabIndex = 2;
@@ -241,7 +242,7 @@ namespace Million
this.bt_AllClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.bt_AllClear.Appearance.ForeColor = System.Drawing.Color.Black;
this.bt_AllClear.Appearance.Options.UseForeColor = true;
this.bt_AllClear.Location = new System.Drawing.Point(807, 41);
this.bt_AllClear.Location = new System.Drawing.Point(807, 0);
this.bt_AllClear.Name = "bt_AllClear";
this.bt_AllClear.Size = new System.Drawing.Size(97, 31);
this.bt_AllClear.TabIndex = 2;
@@ -253,7 +254,7 @@ namespace Million
this.simpleButton_SetupRefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.simpleButton_SetupRefresh.Appearance.ForeColor = System.Drawing.Color.Teal;
this.simpleButton_SetupRefresh.Appearance.Options.UseForeColor = true;
this.simpleButton_SetupRefresh.Location = new System.Drawing.Point(704, 41);
this.simpleButton_SetupRefresh.Location = new System.Drawing.Point(704, 0);
this.simpleButton_SetupRefresh.Name = "simpleButton_SetupRefresh";
this.simpleButton_SetupRefresh.Size = new System.Drawing.Size(97, 31);
this.simpleButton_SetupRefresh.TabIndex = 2;
@@ -265,7 +266,7 @@ namespace Million
this.simpleButton_SetupDelete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.simpleButton_SetupDelete.Appearance.ForeColor = System.Drawing.Color.Red;
this.simpleButton_SetupDelete.Appearance.Options.UseForeColor = true;
this.simpleButton_SetupDelete.Location = new System.Drawing.Point(572, 352);
this.simpleButton_SetupDelete.Location = new System.Drawing.Point(572, 311);
this.simpleButton_SetupDelete.Name = "simpleButton_SetupDelete";
this.simpleButton_SetupDelete.Size = new System.Drawing.Size(97, 31);
this.simpleButton_SetupDelete.TabIndex = 2;
@@ -277,7 +278,7 @@ namespace Million
this.simpleButton_TobuyList.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.simpleButton_TobuyList.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
this.simpleButton_TobuyList.Appearance.Options.UseBackColor = true;
this.simpleButton_TobuyList.Location = new System.Drawing.Point(704, 352);
this.simpleButton_TobuyList.Location = new System.Drawing.Point(704, 311);
this.simpleButton_TobuyList.Name = "simpleButton_TobuyList";
this.simpleButton_TobuyList.Size = new System.Drawing.Size(97, 31);
this.simpleButton_TobuyList.TabIndex = 2;
@@ -292,7 +293,7 @@ namespace Million
this.panelControl_IndicatorSetup.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Flat;
this.panelControl_IndicatorSetup.Location = new System.Drawing.Point(19, 83);
this.panelControl_IndicatorSetup.Name = "panelControl_IndicatorSetup";
this.panelControl_IndicatorSetup.Size = new System.Drawing.Size(885, 263);
this.panelControl_IndicatorSetup.Size = new System.Drawing.Size(885, 222);
this.panelControl_IndicatorSetup.TabIndex = 1;
//
// groupBox5
@@ -687,12 +688,13 @@ namespace Million
// groupBox10
//
this.groupBox10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.groupBox10.Controls.Add(this.cb_StarValueLowOverlapUp);
this.groupBox10.Controls.Add(this.cb_DownBeforeValueFlag);
this.groupBox10.Controls.Add(this.cb_IncludeClearIndicator);
this.groupBox10.Controls.Add(this.cb_UpperMainIndi);
this.groupBox10.Location = new System.Drawing.Point(653, 13);
this.groupBox10.Name = "groupBox10";
this.groupBox10.Size = new System.Drawing.Size(269, 84);
this.groupBox10.Size = new System.Drawing.Size(269, 113);
this.groupBox10.TabIndex = 4;
this.groupBox10.TabStop = false;
this.groupBox10.Text = "Data Setting";
@@ -733,6 +735,16 @@ namespace Million
this.cb_UpperMainIndi.Text = "메인조건>사전조건";
this.cb_UpperMainIndi.UseVisualStyleBackColor = true;
//
// cb_StarValueLowOverlapUp
//
this.cb_StarValueLowOverlapUp.AutoSize = true;
this.cb_StarValueLowOverlapUp.Location = new System.Drawing.Point(6, 84);
this.cb_StarValueLowOverlapUp.Name = "cb_StarValueLowOverlapUp";
this.cb_StarValueLowOverlapUp.Size = new System.Drawing.Size(191, 16);
this.cb_StarValueLowOverlapUp.TabIndex = 14;
this.cb_StarValueLowOverlapUp.Text = "최초돌파시 이전 시가<Overlap";
this.cb_StarValueLowOverlapUp.UseVisualStyleBackColor = true;
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
@@ -842,6 +854,7 @@ namespace Million
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox tb_SearchResultDataName;
private System.Windows.Forms.GroupBox groupBox11;
private System.Windows.Forms.CheckBox cb_StarValueLowOverlapUp;
}
}

View File

@@ -273,6 +273,8 @@ namespace Million
// 조건 검색을 반영하여 데이터 계산
private void simpleButton_CalcurateData_Click(object sender, EventArgs e)
{
CommonProperty.StarValueLowOverlapUp = cb_StarValueLowOverlapUp.Checked;
// 계산 결과 데이터 관련 클래스에 값 채우기
DeafultDataSet();
CommonProperty.InsertLogFlag = false;
@@ -582,7 +584,11 @@ namespace Million
mDataList.CandleDataLists_Im.RemoveAt(0);
continue;
}
var recentlyDate = recentlyData.DateTime;
recentlyDate = recentlyDate.AddMinutes(recentlyDate.Minute * -1);
recentlyDate = recentlyDate.AddHours( -1);
//before 데이터 가져오는 함수
var beforeData = standardData[MCandleTimeType.H1].FirstOrDefault(t => t.DateTime == recentlyDate);
if (!buyList.Any(t => t.ConGoodsData.CoinFullName == item))
{
@@ -604,8 +610,21 @@ namespace Million
var buyData = new CandleDataList();
buyData.CandleDataLists_Im.Add(recentlyData);
var valDic = ResultLogicManager.GetIndicateValue(recentlyData.CalculateFlag, totalIndicator, recentlyData);
recentlyData.BuyValue = OrderbookManager.GetAskPrice(CalculateManager.GetConditionValue(buyScript.regularExpressionString, valDic, recentlyData.CalculateFlag));
// 이전 전봉(H1)의 고가가 사려는 가격보다 높을경우 pass
if (StarValueLowOverlapUp)
{
if (recentlyData.BuyValue < beforeData.HighValue)
{
foreach (var indi in totalIndicator)
subIndicatorStateManagement[indi.IndexString][item] = false;
overlapBuyManagementList[item] = true;
continue;
}
}
recentlyData.BuyTime = recentlyData.DateTime;
buyData.ConGoodsData = CommonProperty.selectedMarketOfPlaceList.FirstOrDefault(t => t.CoinFullName == item);
recentlyData.BuyCount = 1;
@@ -1000,7 +1019,8 @@ namespace Million
/// <param name="e"></param>
private void bt_CalculateList_Click(object sender, EventArgs e)
{
if(multiSavedResultDatas.Count > 0)
CommonProperty.StarValueLowOverlapUp = cb_StarValueLowOverlapUp.Checked;
if (multiSavedResultDatas.Count > 0)
{
LogManager.WriteLog("헌터 리스트 계산 시작", "Hunter List 계산");
CommonProperty.InsertLogFlag = true;

View File

@@ -360,13 +360,14 @@ namespace Million
#region Realtime Hunter Flag
public static bool RealtimeHunterMode = false;
public static bool StarValueLowOverlapUp = false;
#endregion
#region Realtime 관련 Sub data 사용하는 부분예외처리
/// <summary>
/// Sub 조건 Flag
/// </summary>
public static Dictionary<string, Dictionary<string, bool>> subIndicatorStateManagement = new Dictionary<string, Dictionary<string, bool>>();
public static Dictionary<string, Dictionary<string, bool>> subIndicatorStateManagement = new Dictionary<string, Dictionary<string, bool>>();
#endregion
#region 장화형 요청 사항(조건단순 비교할때 첫번째는 포함되지 않도록 예외처리

View File

@@ -470,10 +470,10 @@ namespace Million.Manager
item.IndicatorDic[key].value = item.EndValue;
}
}
}
if(flag)
if (flag)
CommonProperty.compareIndicatorState[setUp.IndexString][coinFullName] = false;
}
}
@@ -768,7 +768,7 @@ namespace Million.Manager
subScript.regularExpressionString = setUp.FirstOverSubRegExpression;
var subFlag = false;
var firstFlag = false;
// realtime(recentlydata가 true일경우)에만 사용하는 데이터 -> 최초 시점 잡기위함
@@ -778,6 +778,7 @@ namespace Million.Manager
foreach (var parent in parentCandleDataList)
{
var dic = parent.CalculateFlag;
var subValue = GetValueData(subIndi, parent, subKey);
@@ -854,7 +855,7 @@ namespace Million.Manager
subManagement[coinFullName] = false;
continue;
}
//최초 시점이 아닐 경우
if ((subManagement != null && subManagement[coinFullName]) || !firstFlag)
{

View File

@@ -157,6 +157,7 @@ namespace Million.Manager
{
var dic = new Dictionary<string, bool>();
var compareDic = new Dictionary<string, bool>();
foreach (var codeFullname in coinFullNameList)
{
if (checkData)
@@ -165,10 +166,10 @@ namespace Million.Manager
dic[codeFullname] = true;
compareDic[codeFullname] = false;
}
CommonProperty.subIndicatorStateManagement[item.IndexString] = dic;
CommonProperty.compareIndicatorState[item.IndexString] = compareDic;
CommonProperty.compareIndicatorState[item.IndexString] = compareDic;
}
}