개발중

This commit is contained in:
2016-08-09 14:42:50 +09:00
parent d41130fcdd
commit 5714cb3388
7 changed files with 336 additions and 194 deletions

View File

@@ -143,69 +143,50 @@ namespace upper_limit_crawler
public void Buy(string strCode, int iUnitPrice, int iBidAmount)
{
//lock(lockBuy)
{
while (ULUtil.GetLimitRemainCountRQ() <= 0) ;
int iCnt = iBidAmount / iUnitPrice;
int iCnt = iBidAmount / iUnitPrice;
CPTRADELib.CpTd0311 Td0311Bid = new CPTRADELib.CpTd0311();
Td0311Bid.SetInputValue(0, "2");
Td0311Bid.SetInputValue(1, m_astrAccounts[0]);
Td0311Bid.SetInputValue(3, strCode);
Td0311Bid.SetInputValue(4, iCnt); // 수량
Td0311Bid.SetInputValue(5, 0); // 단가
Td0311Bid.SetInputValue(7, "0");
Td0311Bid.SetInputValue(8, "03");
CPTRADELib.CpTd0311 Td0311Bid = new CPTRADELib.CpTd0311();
Td0311Bid.SetInputValue(0, "2");
Td0311Bid.SetInputValue(1, m_astrAccounts[0]);
Td0311Bid.SetInputValue(3, strCode);
Td0311Bid.SetInputValue(4, iCnt); // 수량
Td0311Bid.SetInputValue(5, 0); // 단가
Td0311Bid.SetInputValue(7, "0");
Td0311Bid.SetInputValue(8, "03");
Td0311Bid.BlockRequest2(1);
}
ULUtil.BlockRequest(Td0311Bid);
}
public void Sell(string strCode, int iUnitPrice, int iCnt)
{
//lock (lockSell)
{
//long iCnt = (long)Math.Floor(fAskAmount/fCurPrice);
//iCnt=1;
while (ULUtil.GetLimitRemainCountRQ() <= 0) ;
while (ULUtil.GetLimitRemainCountRQ() <= 0) ;
CPTRADELib.CpTd0311 Td0311Ask = new CPTRADELib.CpTd0311();
CPTRADELib.CpTd0311 Td0311Ask = new CPTRADELib.CpTd0311();
Td0311Ask.SetInputValue(0, "1");
Td0311Ask.SetInputValue(1, m_astrAccounts[0]);
Td0311Ask.SetInputValue(3, strCode);
Td0311Ask.SetInputValue(4, iCnt); // 수량
Td0311Ask.SetInputValue(5, iUnitPrice); // 단가
Td0311Ask.SetInputValue(7, "0");
Td0311Ask.SetInputValue(8, "03");
Td0311Ask.SetInputValue(0, "1");
Td0311Ask.SetInputValue(1, m_astrAccounts[0]);
Td0311Ask.SetInputValue(3, strCode);
Td0311Ask.SetInputValue(4, iCnt); // 수량
Td0311Ask.SetInputValue(5, iUnitPrice); // 단가
Td0311Ask.SetInputValue(7, "0");
Td0311Ask.SetInputValue(8, "03");
Td0311Ask.BlockRequest2(1);
}
ULUtil.BlockRequest(Td0311Ask);
}
public void SellCurPrice(string strCode, int iCnt)
{
//lock (lockSell)
{
//long iCnt = (long)Math.Floor(fAskAmount/fCurPrice);
//iCnt=1;
CPTRADELib.CpTd0311 Td0311Ask = new CPTRADELib.CpTd0311();
while (ULUtil.GetLimitRemainCountRQ() <= 0);
Td0311Ask.SetInputValue(0, "1");
Td0311Ask.SetInputValue(1, m_astrAccounts[0]);
Td0311Ask.SetInputValue(3, strCode);
Td0311Ask.SetInputValue(4, iCnt); // 수량
Td0311Ask.SetInputValue(5, 0); // 단가
Td0311Ask.SetInputValue(7, "0");
Td0311Ask.SetInputValue(8, "03");
CPTRADELib.CpTd0311 Td0311Ask = new CPTRADELib.CpTd0311();
Td0311Ask.SetInputValue(0, "1");
Td0311Ask.SetInputValue(1, m_astrAccounts[0]);
Td0311Ask.SetInputValue(3, strCode);
Td0311Ask.SetInputValue(4, iCnt); // 수량
Td0311Ask.SetInputValue(5, 0); // 단가
Td0311Ask.SetInputValue(7, "0");
Td0311Ask.SetInputValue(8, "03");
Td0311Ask.BlockRequest2(1);
}
ULUtil.BlockRequest(Td0311Ask);
}
}
}