sell 함수 추가

This commit is contained in:
mjjo
2016-07-06 18:43:22 +09:00
parent 313e0fb163
commit 8006843ff0

View File

@@ -10,7 +10,8 @@ namespace upper_limit_crawler
{
CPFORETRADELib.CpForeTdUtil m_Util = new CPFORETRADELib.CpForeTdUtil();
DSCBO1Lib.CpConclusion m_Conclusion = new DSCBO1Lib.CpConclusion();
CPTRADELib.CpTd0311 m_Td0311 = new CPTRADELib.CpTd0311();
CPTRADELib.CpTd0311 m_Td0311Bid = new CPTRADELib.CpTd0311();
CPTRADELib.CpTd0311 m_Td0311Ask = new CPTRADELib.CpTd0311();
string[] m_astrAccounts = null;
@@ -63,8 +64,6 @@ namespace upper_limit_crawler
UlUtil.Trace(strLog);
}
public void Buy(string strCode, float fCurPrice, float fBidAmount)
{
//0 - (string)주문종류코드 주문구분
// 1 매도
// 2 매수
@@ -105,20 +104,36 @@ namespace upper_limit_crawler
// 80 시간외바스켓
// 79 시간외대량자기
// 최
long iCnt = (long)Math.Floor(fBidAmount / fCurPrice);
public void Buy(string strCode, long iBidPrice, long iBidAmount)
{
long iCnt = iBidAmount/iBidPrice;
iCnt = 1;
m_Td0311.SetInputValue(0, "2");
m_Td0311.SetInputValue(1, m_astrAccounts[0]);
m_Td0311.SetInputValue(3, strCode);
m_Td0311.SetInputValue(4, iCnt); // 수량
m_Td0311.SetInputValue(5, (long)fCurPrice); // 단가
m_Td0311.SetInputValue(7, "0");
m_Td0311.SetInputValue(8, "03");
m_Td0311Bid.SetInputValue(0, "2");
m_Td0311Bid.SetInputValue(1, m_astrAccounts[0]);
m_Td0311Bid.SetInputValue(3, strCode);
m_Td0311Bid.SetInputValue(4, iCnt); // 수량
m_Td0311Bid.SetInputValue(5, iBidPrice); // 단가
m_Td0311Bid.SetInputValue(7, "0");
m_Td0311Bid.SetInputValue(8, "03");
m_Td0311.BlockRequest();
m_Td0311Bid.BlockRequest();
}
public void Sell(string strCode, long iAskPrice, long iCnt)
{
//long iCnt = (long)Math.Floor(fAskAmount/fCurPrice);
//iCnt=1;
m_Td0311Ask.SetInputValue(0, "1");
m_Td0311Ask.SetInputValue(1, m_astrAccounts[0]);
m_Td0311Ask.SetInputValue(3, strCode);
m_Td0311Ask.SetInputValue(4, iCnt); // 수량
m_Td0311Ask.SetInputValue(5, iAskPrice); // 단가
m_Td0311Ask.SetInputValue(7, "0");
m_Td0311Ask.SetInputValue(8, "03");
m_Td0311Ask.BlockRequest();
}
}
}