Buyer에 손절조건처리 추가

This commit is contained in:
kyh
2022-11-28 12:25:46 +09:00
parent 6a192b4121
commit 77aa5d21f6
3 changed files with 20 additions and 8 deletions

View File

@@ -585,11 +585,12 @@ namespace Million_Buyer
{
//default sell
var flag = sellScript.DicExcuteScript(recentlyData.CalculateFlag);
var scriptStr = sellScript.regularExpressionString;
if (!flag)
{
//예외처리 로직 추가
flag = sellExceptionScript.DicExcuteScript(recentlyData.CalculateFlag);
if(flag) scriptStr = sellExceptionScript.regularExpressionString;
}
if (flag)
@@ -600,7 +601,7 @@ namespace Million_Buyer
var sellItem = recentlyData;
var valDic = ResultLogicManager.GetIndicateValue(sellItem.CalculateFlag, totalIndicatorList, sellItem);
sellItem.SellValue = OrderbookManager.GetAskPrice(CalculateManager.GetConditionValue(sellScript.regularExpressionString, valDic, sellItem.CalculateFlag), false);
sellItem.SellValue = OrderbookManager.GetAskPrice(CalculateManager.GetConditionValue(scriptStr, valDic, sellItem.CalculateFlag), false);
sellItem.SellTime = time;
var buyCandleData = buyItem.CandleDataLists_Im[0];

View File

@@ -461,7 +461,7 @@ namespace Million
_saveResultData.SearchResultList = new List<SearchResult>();
_saveResultData.BuyRegularExpression = textEdit_BuyRegularExpression.Text;
_saveResultData.SellRegularExpression = textEdit_SellRegularExpression.Text;
_saveResultData.SellExceptionRegularExpression = textEdit_SellExceptionRegularExpression.Text;
if (DBConnection.QueryInsertExcuter_SavedResultData(_saveResultData))
MessageBox.Show("데이터 저장 성공");
else
@@ -476,7 +476,14 @@ namespace Million
private void bt_InsertBuyerIndicator_Click(object sender, EventArgs e)
{
var name = tb_BuyerIndicatorName.Text;
_saveResultData.StartDateTime = dateEdit_StartDateTime.DateTime;
_saveResultData.EndDateTime = dateEdit_EndDateTime.DateTime;
_saveResultData.SavedDateTime = DateTime.Now;
if (_saveResultData == null)
_saveResultData.SearchResultList = new List<SearchResult>();
_saveResultData.BuyRegularExpression = textEdit_BuyRegularExpression.Text;
_saveResultData.SellRegularExpression = textEdit_SellRegularExpression.Text;
_saveResultData.SellExceptionRegularExpression = textEdit_SellExceptionRegularExpression.Text;
if (DBConnection.QueryInsertExcuter_RealTimeIndicator(_saveResultData, name))
MessageBox.Show("데이터 저장 성공");
else

View File

@@ -78,7 +78,8 @@ namespace Million.DbManagement
BuySetupList varbinary(MAX) NULL,
SellSetupList varbinary(MAX) NULL,
BuyRegularExpression varchar(100) NOT NULL,
SellRegularExpression varchar(100) NOT NULL
SellRegularExpression varchar(100) NOT NULL,
SellExceptionRegularExpression varchar(100) NOT NULL,
)";
}
@@ -545,18 +546,21 @@ namespace Million.DbManagement
,[SellSetupList]
,[BuyRegularExpression]
,[SellRegularExpression]
,[SellExceptionRegularExpression]
)VALUES(
'{0}',
'{1}',
@BuySetupList,
@SellSetupList,
'{2}',
'{3}'
'{3}',
'{4}'
);",
name,
item.SavedDateTime.ToString("yyyy-MM-dd HH:mm:ss"),
item.BuyRegularExpression,
item.SellRegularExpression
item.SellRegularExpression,
item.SellExceptionRegularExpression
);
return str;
}