매수 구분 체크
simulation input 생성
This commit is contained in:
2
AutoSeller.Designer.cs
generated
2
AutoSeller.Designer.cs
generated
@@ -907,7 +907,7 @@
|
||||
this.materialLabel3.Name = "materialLabel3";
|
||||
this.materialLabel3.Size = new System.Drawing.Size(165, 19);
|
||||
this.materialLabel3.TabIndex = 6;
|
||||
this.materialLabel3.Text = "Version : 2017.03.27.11";
|
||||
this.materialLabel3.Text = "Version : 2017.11.18.01";
|
||||
//
|
||||
// materialLabel2
|
||||
//
|
||||
|
||||
@@ -353,21 +353,31 @@ namespace AutoSellerNS
|
||||
string strCodeName = m_CpConclusion.GetHeaderValue(2);
|
||||
int iConclusionCnt = m_CpConclusion.GetHeaderValue(3);
|
||||
int iPrice = m_CpConclusion.GetHeaderValue(4);
|
||||
int iOrderNumber = m_CpConclusion.GetHeaderValue(5);
|
||||
int iOrgOrderNumber = m_CpConclusion.GetHeaderValue(6);
|
||||
string strCancel = m_CpConclusion.GetHeaderValue(16);
|
||||
string strOrderCondition = m_CpConclusion.GetHeaderValue(19);
|
||||
int iBookValue = m_CpConclusion.GetHeaderValue(21);
|
||||
int iRemainCnt = m_CpConclusion.GetHeaderValue(23);
|
||||
string strBidOrAsk = bBid ? "매수" : "매도";
|
||||
|
||||
if (strOrderCondition == "0")
|
||||
strOrderCondition = "없음";
|
||||
else if (strOrderCondition == "1")
|
||||
strOrderCondition = "IOC";
|
||||
else if (strOrderCondition == "2")
|
||||
strOrderCondition = "FOK";
|
||||
|
||||
switch (iType)
|
||||
{
|
||||
case 1: // 체결
|
||||
m_Listener.UpdateItem(strCode, strCodeName, bBid, iConclusionCnt, iRemainCnt, iBookValue);
|
||||
m_Listener.UpdateNCItem();
|
||||
Util.Log(bBid?Util.LOG_TYPE.BUY:Util.LOG_TYPE.SELL, string.Format("{0}:{1} {2} 체결 ({3:n0}원 {4}주)", strCodeName, strCode, strBidOrAsk, iPrice, iConclusionCnt));
|
||||
Util.Log(bBid?Util.LOG_TYPE.BUY:Util.LOG_TYPE.SELL, string.Format("{0}:{1} {2} 체결 ({3:n0}원 {4}주) - {5}", strCodeName, strCode, strBidOrAsk, iPrice, iConclusionCnt, strOrderCondition));
|
||||
break;
|
||||
|
||||
case 2: // 확인
|
||||
Util.Log(Util.LOG_TYPE.VERVOSE, string.Format("{0}:{1} {2} 확인", strCodeName, strCode, strBidOrAsk));
|
||||
Util.Log(Util.LOG_TYPE.VERVOSE, string.Format("{0}:{1} {2} 확인 - {3} ({4}:{5})", strCodeName, strCode, strBidOrAsk, strOrderCondition, iOrderNumber, iOrgOrderNumber));
|
||||
break;
|
||||
|
||||
case 3: // 거부
|
||||
@@ -376,7 +386,9 @@ namespace AutoSellerNS
|
||||
|
||||
case 4: // 접수
|
||||
m_Listener.UpdateNCItem();
|
||||
Util.Log(bBid ? Util.LOG_TYPE.BUY : Util.LOG_TYPE.SELL, string.Format("{0}:{1} {2} 접수 ({3:n0}원 {4}주)", strCodeName, strCode, strBidOrAsk, iPrice, iConclusionCnt));
|
||||
Util.Log(bBid ? Util.LOG_TYPE.BUY : Util.LOG_TYPE.SELL, string.Format("{0}:{1} {2} 접수 ({3:n0}원 {4}주) - {5}", strCodeName, strCode, strBidOrAsk, iPrice, iConclusionCnt, strOrderCondition));
|
||||
if (bBid == true)
|
||||
SimulationHelper.InsertSimulationLog(strCode, strCodeName, iPrice);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ namespace AutoSellerNS
|
||||
var tokens = strLine.Split('\t');
|
||||
|
||||
var strDate = tokens[0];
|
||||
var strNewTime = tokens[1];
|
||||
var strNewsTime = tokens[1];
|
||||
var strSimulationTime = tokens[2];
|
||||
var strCodeName = tokens[3];
|
||||
strCodeName = strCodeName.Trim();
|
||||
@@ -1000,6 +1000,19 @@ namespace AutoSellerNS
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
public static void InsertSimulationLog(string strCode, string strCodeName, int iPrice)
|
||||
{
|
||||
DateTime time = DateTime.Now;
|
||||
string strPath = Util.GetSimulationPath() + "/0-input-" + time.Date.ToString("yyyy-MM-dd") + ".txt";
|
||||
File.AppendAllText(strPath, string.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}",
|
||||
time.ToString("yyyy-MM-dd"),
|
||||
time.ToString("hh:mm:ss"),
|
||||
time.ToString("hh:mm:ss"),
|
||||
strCodeName,
|
||||
strCode,
|
||||
iPrice), new UTF8Encoding(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user