현재가를 객체별 함수로 나눔
This commit is contained in:
27
ULDataMgr.cs
27
ULDataMgr.cs
@@ -25,6 +25,16 @@ namespace upper_limit_crawler
|
||||
public string m_strCode;
|
||||
public string m_strCodeName;
|
||||
public DSCBO1Lib.StockCur m_StockCur = null;
|
||||
public void Received()
|
||||
{
|
||||
m_iCurPrice = m_StockCur.GetHeaderValue(13);
|
||||
m_iPrevClosing = m_iCurPrice - m_StockCur.GetHeaderValue(2);
|
||||
m_iStartPrice = m_StockCur.GetHeaderValue(4);
|
||||
m_iHighestPrice = m_StockCur.GetHeaderValue(5);
|
||||
m_iVolume = m_StockCur.GetHeaderValue(9);
|
||||
m_iBidPrice = m_StockCur.GetHeaderValue(8);
|
||||
m_iBidCnt = 0;
|
||||
}
|
||||
|
||||
public int m_iCurPrice;
|
||||
public int m_iPrevClosing;
|
||||
@@ -47,7 +57,6 @@ namespace upper_limit_crawler
|
||||
|
||||
public ULDataMgr()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public string GetAccount()
|
||||
@@ -73,26 +82,12 @@ namespace upper_limit_crawler
|
||||
|
||||
item.m_StockCur = new DSCBO1Lib.StockCur();
|
||||
item.m_StockCur.SetInputValue(0, strCode);
|
||||
item.m_StockCur.Received += StockCur_Received;
|
||||
item.m_StockCur.Received += item.Received;
|
||||
item.m_StockCur.SubscribeLatest();
|
||||
|
||||
m_WatchList.Add(strCode, item);
|
||||
}
|
||||
|
||||
private void StockCur_Received()
|
||||
{
|
||||
foreach(KeyValuePair<string, WATCH_ITEM> item in m_WatchList)
|
||||
{
|
||||
item.Value.m_iCurPrice = item.Value.m_StockCur.GetHeaderValue(13);
|
||||
item.Value.m_iPrevClosing = item.Value.m_StockCur.GetHeaderValue(2);
|
||||
item.Value.m_iStartPrice = item.Value.m_StockCur.GetHeaderValue(4);
|
||||
item.Value.m_iHighestPrice = item.Value.m_StockCur.GetHeaderValue(5);
|
||||
item.Value.m_iVolume = item.Value.m_StockCur.GetHeaderValue(9);
|
||||
item.Value.m_iBidPrice = item.Value.m_StockCur.GetHeaderValue(8);
|
||||
item.Value.m_iBidCnt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddBlackList(string strCode)
|
||||
{
|
||||
m_BlackList.Add(strCode);
|
||||
|
||||
Reference in New Issue
Block a user