- 시뮬레이션 수정 : 마지막 비교, 평균 비교 방식 추가

This commit is contained in:
2017-02-20 04:38:46 +09:00
parent dd7a1322e4
commit 3611071c18
2 changed files with 439 additions and 393 deletions

View File

@@ -403,7 +403,28 @@ namespace AutoSellerNS
public void StartSimuation2()
{
m_tbLogView.AppendText(string.Format("[시뮬레이션 시작] 조건 : {0}회, 트레일링 : {1}%, {2}회\n", Config.GetBidCount(), Config.GetTrailingRate(), Config.GetTrailingCnt()));
int iListCnt;
double dFastSD;
int iFastCnt;
double dSlowSD;
int iSlowCnt;
int.TryParse(m_AutoSeller.tbSMListSize.Text, out iListCnt);
double.TryParse(m_AutoSeller.tbSMFastSD.Text, out dFastSD);
int.TryParse(m_AutoSeller.tbSMFastCnt.Text, out iFastCnt);
double.TryParse(m_AutoSeller.tbSMSlowSD.Text, out dSlowSD);
int.TryParse(m_AutoSeller.tbSMSlowCnt.Text, out iSlowCnt);
bool bAverageCompare;
if(m_AutoSeller.cbSMMethod.SelectedText == "평균 비교")
bAverageCompare = true;
else
bAverageCompare = false;
m_tbLogView.AppendText(string.Format("[시뮬레이션 시작] 조건 : {0}회, 트레일링 : {1}%, {2}회\n \t\t리스트 크기:{3}, Fast : {4}, {5}, Slow : {6}, {7}, 비교 방식 : {8}\n",
Config.GetBidCount(), Config.GetTrailingRate(), Config.GetTrailingCnt(),
iListCnt, dFastSD, iFastCnt, dSlowSD, iSlowCnt, m_AutoSeller.cbSMMethod.SelectedItem
));
int iTotalProfit = 0;
int iTotalBid = 0;
@@ -453,17 +474,6 @@ namespace AutoSellerNS
int iCheckCount = 50;
List<int> m_PriceList = new List<int>();
int iListCnt;
double dFastSD;
int iFastCnt;
double dSlowSD;
int iSlowCnt;
int.TryParse(m_AutoSeller.tbSMListSize.Text, out iListCnt);
double.TryParse(m_AutoSeller.tbSMFastSD.Text, out dFastSD);
int.TryParse(m_AutoSeller.tbSMFastCnt.Text, out iFastCnt);
double.TryParse(m_AutoSeller.tbSMSlowSD.Text, out dSlowSD);
int.TryParse(m_AutoSeller.tbSMSlowCnt.Text, out iSlowCnt);
int iPrevAskPrice = 0;
@@ -506,21 +516,40 @@ namespace AutoSellerNS
if(sd >= dFastSD)
{
if(iPrice >= m_PriceList[m_PriceList.Count-2])
iCheckCount += iFastCnt;
else if(iCheckCount > 30)
iCheckCount -= iFastCnt;
if(bAverageCompare == true)
{
if(iPrice >= dAverage)
iCheckCount += iFastCnt;
else if(iCheckCount > 30)
iCheckCount -= iFastCnt;
}
else
{
if(iPrice >= m_PriceList[m_PriceList.Count-2])
iCheckCount += iFastCnt;
else if(iCheckCount > 30)
iCheckCount -= iFastCnt;
}
}
else if(sd <= dSlowSD)
{
if(iPrice >= m_PriceList[m_PriceList.Count-2])
iCheckCount += iSlowCnt;
else if(iCheckCount > 30)
iCheckCount -= iSlowCnt;
if(bAverageCompare == true)
{
if(iPrice >= dAverage)
iCheckCount += iSlowCnt;
else if(iCheckCount > 30)
iCheckCount -= iSlowCnt;
}
else
{
if(iPrice >= m_PriceList[m_PriceList.Count-2])
iCheckCount += iSlowCnt;
else if(iCheckCount > 30)
iCheckCount -= iSlowCnt;
}
}
int k = 0;
//// 체결가 비교
//if(iPrice > iPrevPrice)
@@ -648,7 +677,7 @@ namespace AutoSellerNS
if(iTrailingCount >= Config.GetTrailingCnt())
{
int iSellPrice = iPrice - m_CybosHelper.GetUnitValue(iPrice);
m_tbLogView.AppendText(string.Format("[{0}] 트레일링 매도 (매수 : {1:n0}원, {2}, line:{3}) (매도 : {4:n0}원(매도가:{5:n0}원) {6} line:{7}) ({8}, {9:n0} : {10:n2}%) \n",
m_tbLogView.AppendText(string.Format("[{0}] 트레일링 매도 (매수 : {1:n0}원, {2}, line:{3}) (매도 : {4:n0}원(매도가:{5:n0}원) {6} line:{7}) ({8}, {9:n0} : {10:n2}%) {11} \n",
strCodeName,
iStartPrice,
@@ -662,7 +691,9 @@ namespace AutoSellerNS
iSellPrice-iStartPrice,
(iSellPrice-iStartPrice)*iStockCount,
(iSellPrice-iStartPrice)*100/(float)iStartPrice
(iSellPrice-iStartPrice)*100/(float)iStartPrice,
iCheckCount
));