플로우 약간 수정
This commit is contained in:
@@ -12,7 +12,14 @@ namespace upper_limit_crawler
|
||||
{
|
||||
public partial class ULBalanceDlg : Form
|
||||
{
|
||||
const int BALANCE_DELAY = 15000;
|
||||
|
||||
Timer m_MainTimer = new Timer();
|
||||
int m_iLastTime = 0;
|
||||
int m_iBalanceDelay = BALANCE_DELAY;
|
||||
|
||||
ULDataMgr m_DataMgr = null;
|
||||
|
||||
CPTRADELib.CpTd6033 m_Td6033 = new CPTRADELib.CpTd6033();
|
||||
|
||||
public ULBalanceDlg(ULDataMgr DataMgr)
|
||||
@@ -23,10 +30,14 @@ namespace upper_limit_crawler
|
||||
MainForm.SetDoubleBuffered(lvBalance);
|
||||
btSell.Enabled = false;
|
||||
|
||||
RefreshData();
|
||||
RefreshBalance();
|
||||
|
||||
m_MainTimer.Interval=15;
|
||||
m_MainTimer.Tick+=RefreshData;
|
||||
m_MainTimer.Start();
|
||||
}
|
||||
|
||||
private void RefreshData()
|
||||
private void RefreshBalance()
|
||||
{
|
||||
m_Td6033.SetInputValue(0, m_DataMgr.GetAccount());
|
||||
m_Td6033.SetInputValue(2, 50);
|
||||
@@ -36,7 +47,7 @@ namespace upper_limit_crawler
|
||||
lvBalance.Items.Clear();
|
||||
|
||||
int iCnt = m_Td6033.GetHeaderValue(7);
|
||||
for (int i = 0; i < iCnt; i++)
|
||||
for(int i = 0; i<iCnt; i++)
|
||||
{
|
||||
string strCodeName = m_Td6033.GetDataValue(0, i);
|
||||
int iPayBalance = m_Td6033.GetDataValue(3, i); // 결제 잔고수량
|
||||
@@ -50,7 +61,7 @@ namespace upper_limit_crawler
|
||||
double dConclusionUnitPrice = m_Td6033.GetDataValue(17, i); // 체결 장부단가
|
||||
long iUnitBEP = m_Td6033.GetDataValue(18, i); // 손익단가 : 수수료 포함 순익 분기점 Break-Even Point
|
||||
|
||||
int iCurPrice = (int)(iEvaluationPrice / iConclusionBalanceCnt);
|
||||
int iCurPrice = (int)(iEvaluationPrice/iConclusionBalanceCnt);
|
||||
|
||||
string[] row = { strCode, strCodeName, dConclusionUnitPrice.ToString("###,###,##0"), iCurPrice.ToString("###,###,##0"), iConclusionBalanceCnt.ToString("###,###,##0"),
|
||||
iUnitBEP.ToString("###,###,##0"), iEvaluationProfit.ToString("###,###,##0"), iEvaluationPrice.ToString("###,###,##0"), dReturn.ToString("#,##0.##")+"%" };
|
||||
@@ -63,8 +74,32 @@ namespace upper_limit_crawler
|
||||
dReturn, strCode, iAskableCnt, dConclusionUnitPrice, iUnitBEP));
|
||||
}
|
||||
|
||||
foreach (ColumnHeader col in lvBalance.Columns)
|
||||
col.Width = -2;
|
||||
foreach(ColumnHeader col in lvBalance.Columns)
|
||||
col.Width=-2;
|
||||
}
|
||||
|
||||
private void RefreshData()
|
||||
{
|
||||
int iCurTime = Environment.TickCount;
|
||||
if(m_iLastTime==0)
|
||||
{
|
||||
m_iLastTime=iCurTime;
|
||||
return;
|
||||
}
|
||||
|
||||
int iDeltaT = iCurTime-m_iLastTime;
|
||||
m_iBalanceDelay-=iDeltaT;
|
||||
if(m_iBalanceDelay<=0)
|
||||
{
|
||||
RefreshBalance();
|
||||
m_iBalanceDelay=BALANCE_DELAY;
|
||||
}
|
||||
|
||||
{
|
||||
int iCurPrice = 0;
|
||||
}
|
||||
|
||||
m_iLastTime=iCurTime;
|
||||
}
|
||||
|
||||
private void btRefresh_Click(object sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user