1분 candle chart, 5MA 추가
This commit is contained in:
56
ULDataMgr.cs
56
ULDataMgr.cs
@@ -20,45 +20,24 @@ namespace upper_limit_crawler
|
||||
public float m_fLossCut;
|
||||
}
|
||||
|
||||
public class WATCH_ITEM
|
||||
{
|
||||
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;
|
||||
public int m_iStartPrice;
|
||||
public int m_iHighestPrice;
|
||||
|
||||
public int m_iVolume;
|
||||
public int m_iBidPrice;
|
||||
public int m_iBidCnt;
|
||||
}
|
||||
|
||||
public class ULDataMgr
|
||||
{
|
||||
public SETTING m_Setting = new SETTING();
|
||||
|
||||
ULTrader m_Trader = new ULTrader();
|
||||
|
||||
Dictionary<string, WATCH_ITEM> m_WatchList = new Dictionary<string, WATCH_ITEM>();
|
||||
Dictionary<string, ULWatchItem> m_WatchList = new Dictionary<string, ULWatchItem>();
|
||||
List<string> m_BlackList = new List<string>();
|
||||
|
||||
public ULDataMgr()
|
||||
{
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
m_Trader.Init();
|
||||
}
|
||||
|
||||
public string GetAccount()
|
||||
{
|
||||
return m_Trader.GetAccount();
|
||||
@@ -74,7 +53,7 @@ namespace upper_limit_crawler
|
||||
if (m_WatchList.ContainsKey(strCode))
|
||||
return;
|
||||
|
||||
WATCH_ITEM item = new WATCH_ITEM();
|
||||
ULWatchItem item = new ULWatchItem();
|
||||
item.m_strCode = strCode;
|
||||
item.m_strCodeName = strCodeName;
|
||||
item.m_iCurPrice = iCurPrice;
|
||||
@@ -97,6 +76,25 @@ namespace upper_limit_crawler
|
||||
m_WatchList.Remove(strCode);
|
||||
}
|
||||
|
||||
public void StartAll()
|
||||
{
|
||||
foreach (KeyValuePair<string, ULWatchItem> item in m_WatchList)
|
||||
{
|
||||
item.Value.m_StockCur = new DSCBO1Lib.StockCur();
|
||||
item.Value.m_StockCur.SetInputValue(0, item.Value.m_strCode);
|
||||
item.Value.m_StockCur.Received += item.Value.Received;
|
||||
item.Value.m_StockCur.SubscribeLatest();
|
||||
}
|
||||
}
|
||||
|
||||
public void StopAll()
|
||||
{
|
||||
foreach (KeyValuePair<string, ULWatchItem> item in m_WatchList)
|
||||
{
|
||||
item.Value.m_StockCur.Unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
public void AddBlackList(string strCode)
|
||||
{
|
||||
m_BlackList.Add(strCode);
|
||||
@@ -107,7 +105,7 @@ namespace upper_limit_crawler
|
||||
return m_BlackList.Contains(strCode);
|
||||
}
|
||||
|
||||
public Dictionary<string, WATCH_ITEM> GetWatchList()
|
||||
public Dictionary<string, ULWatchItem> GetWatchList()
|
||||
{
|
||||
return m_WatchList;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user