- 임시 커밋
This commit is contained in:
@@ -29,6 +29,7 @@ namespace AutoSellerNS
|
||||
|
||||
public void OnRecievedPrice()
|
||||
{
|
||||
bool bReal = (m_StockCur.GetHeaderValue(19) == '2');
|
||||
m_iCurPrice = m_StockCur.GetHeaderValue(13);
|
||||
if(m_iCurPrice > m_iMaxPrice)
|
||||
m_iTrailingCount = 0;
|
||||
@@ -37,26 +38,29 @@ namespace AutoSellerNS
|
||||
|
||||
int iAskPrice = m_StockCur.GetHeaderValue(7);
|
||||
int iBidPrice = m_StockCur.GetHeaderValue(8);
|
||||
if (m_iCurPrice <= iBidPrice)
|
||||
m_iCheckCount++;
|
||||
else
|
||||
m_iCheckCount = 0;
|
||||
if(bReal == true)
|
||||
{
|
||||
if(m_iCurPrice <= iBidPrice)
|
||||
m_iCheckCount++;
|
||||
else
|
||||
m_iCheckCount = 0;
|
||||
}
|
||||
|
||||
if(m_iCheckCount >= Config.GetBidCount() && m_Listener.IsSelling() == true)
|
||||
{
|
||||
m_CybosHelper.SellItem(m_strCode, m_iCurPrice, m_Listener.GetSellableCount(m_strCode));
|
||||
Util.Log(Util.LOG_TYPE.SELL, string.Format("[조건 완료 매도] {0} ({1}회)", m_strCodeName, Config.GetBidCount()));
|
||||
Util.Log(Util.LOG_TYPE.SELL, string.Format("[조건 완료 매도] {0} ({1}회) (현재가 {2:n0}원, 최고가 {3:n0}원)", m_strCodeName, Config.GetBidCount(), m_iCurPrice, m_iMaxPrice));
|
||||
}
|
||||
|
||||
if(m_iCurPrice < (m_iMaxPrice*(100.0f-Config.GetTrailingRate())/100.0f))
|
||||
if(bReal == true && m_iCurPrice < (m_iMaxPrice*(100.0f-Config.GetTrailingRate())/100.0f))
|
||||
m_iTrailingCount++;
|
||||
if(m_iTrailingCount >= Config.GetTrailingCnt() && m_Listener.IsSelling() == true)
|
||||
{
|
||||
m_CybosHelper.SellItem(m_strCode, m_iCurPrice, m_Listener.GetSellableCount(m_strCode));
|
||||
Util.Log(Util.LOG_TYPE.SELL, string.Format("[트레일링 매도] {0} ({1}% {2}회)", m_strCodeName, Config.GetTrailingRate(), Config.GetTrailingCnt()));
|
||||
Util.Log(Util.LOG_TYPE.SELL, string.Format("[트레일링 매도] {0} ({1}% {2}회) (현재가 {2:n0}원, 최고가 {3:n0}원)", m_strCodeName, Config.GetTrailingRate(), Config.GetTrailingCnt(), m_iCurPrice, m_iMaxPrice));
|
||||
}
|
||||
|
||||
m_Listener.OnReceivedCurPrice(m_strCode, m_iCurPrice, m_iMaxPrice, m_iCheckCount);
|
||||
m_Listener.OnReceivedCurPrice(m_strCode, m_iCurPrice, m_iMaxPrice, m_iCheckCount, bReal);
|
||||
}
|
||||
|
||||
public void OnReceivedCall()
|
||||
@@ -139,30 +143,38 @@ namespace AutoSellerNS
|
||||
|
||||
string strCodeList = "";
|
||||
|
||||
int iCount = m_6033.GetHeaderValue(7);
|
||||
for (int i = 0; i < iCount; i++)
|
||||
bool bContinue = true;
|
||||
while(bContinue == true)
|
||||
{
|
||||
AutoSeller.ITEM Item = new AutoSeller.ITEM();
|
||||
|
||||
Item.m_strCodeName = m_6033.GetDataValue(0, i);
|
||||
if(Item.m_strCodeName != "")
|
||||
int iCount = m_6033.GetHeaderValue(7);
|
||||
for(int i = 0; i < iCount; i++)
|
||||
{
|
||||
Item.m_strCode = m_6033.GetDataValue(12, i);
|
||||
Item.m_iItemCnt = m_6033.GetDataValue(7, i);
|
||||
Item.m_iAssessedValue = m_6033.GetDataValue(9, i);
|
||||
Item.m_iValuationGains = m_6033.GetDataValue(10, i);
|
||||
Item.m_dYield = m_6033.GetDataValue(11, i);
|
||||
Item.m_iAvailableQuantity = m_6033.GetDataValue(15, i);
|
||||
Item.m_dBookUnitPrice = m_6033.GetDataValue(17, i);
|
||||
Item.m_iProfitUnitPrice = m_6033.GetDataValue(18, i);
|
||||
Item.m_iSellableCnt = m_6033.GetDataValue(15, i);
|
||||
AutoSeller.ITEM Item = new AutoSeller.ITEM();
|
||||
|
||||
if(strCodeList.Length > 0)
|
||||
strCodeList += ",";
|
||||
strCodeList += Item.m_strCode;
|
||||
Item.m_strCodeName = m_6033.GetDataValue(0, i);
|
||||
if(Item.m_strCodeName != "")
|
||||
{
|
||||
Item.m_strCode = m_6033.GetDataValue(12, i);
|
||||
Item.m_iItemCnt = m_6033.GetDataValue(7, i);
|
||||
Item.m_iAssessedValue = m_6033.GetDataValue(9, i);
|
||||
Item.m_iValuationGains = m_6033.GetDataValue(10, i);
|
||||
Item.m_dYield = m_6033.GetDataValue(11, i);
|
||||
Item.m_iAvailableQuantity = m_6033.GetDataValue(15, i);
|
||||
Item.m_dBookUnitPrice = m_6033.GetDataValue(17, i);
|
||||
Item.m_iProfitUnitPrice = m_6033.GetDataValue(18, i);
|
||||
Item.m_iSellableCnt = m_6033.GetDataValue(15, i);
|
||||
|
||||
aItems.Add(Item);
|
||||
if(strCodeList.Length > 0)
|
||||
strCodeList += ",";
|
||||
strCodeList += Item.m_strCode;
|
||||
|
||||
aItems.Add(Item);
|
||||
}
|
||||
}
|
||||
|
||||
bContinue = (m_6033.Continue != 0);
|
||||
if(bContinue == true)
|
||||
m_6033.BlockRequest2(1);
|
||||
}
|
||||
|
||||
if (strCodeList.Length > 0)
|
||||
|
||||
Reference in New Issue
Block a user