- ULWatchItem.Is5MAGoingUp() 함수 추가

- ULWatchItem.FillPrice() 함수 추가
This commit is contained in:
2016-07-25 03:52:01 +09:00
parent 604795159e
commit f5af5eaef3
7 changed files with 482 additions and 430 deletions

View File

@@ -36,29 +36,29 @@ namespace upper_limit_crawler
m_Timer.Tick += Refresh;
}
public void Start()
{
m_7043 = new CPSYSDIBLib.CpSvrNew7043();
m_7043.SetInputValue(0, '0');
m_7043.SetInputValue(1, '2');
m_7043.SetInputValue(2, '1');
m_7043.SetInputValue(3, 21);
m_7043.SetInputValue(4, '1');
m_7043.SetInputValue(5, '0');
m_7043.SetInputValue(6, '0');
m_7043.SetInputValue(7, (short)(m_DataMgr.m_Setting.m_fSearchMin * 100));
m_7043.SetInputValue(8, (short)((m_DataMgr.m_Setting.m_fSearchMax + 0.009) * 100));
public void Start()
{
m_7043 = new CPSYSDIBLib.CpSvrNew7043();
m_7043.SetInputValue(0, '0');
m_7043.SetInputValue(1, '2');
m_7043.SetInputValue(2, '1');
m_7043.SetInputValue(3, 21);
m_7043.SetInputValue(4, '1');
m_7043.SetInputValue(5, '0');
m_7043.SetInputValue(6, '0');
m_7043.SetInputValue(7, (short)(m_DataMgr.m_Setting.m_fSearchMin * 100));
m_7043.SetInputValue(8, (short)((m_DataMgr.m_Setting.m_fSearchMax + 0.009) * 100));
RefreshMonitorItem();
RefreshMonitorItem();
m_Timer.Start();
}
m_Timer.Start();
}
public void Stop()
{
m_Timer.Stop();
}
public void Stop()
{
m_Timer.Stop();
}
bool RefreshMonitorItem()
{
@@ -135,31 +135,31 @@ namespace upper_limit_crawler
{
Dictionary<string, ULWatchItem> WatchList = m_DataMgr.GetWatchList();
foreach (ListViewItem lvItem in lvWatch.Items)
{
string strCode = lvItem.SubItems[chCode.Index].Text;
if (WatchList.ContainsKey(strCode) == true)
{
{
string strCode = lvItem.SubItems[chCode.Index].Text;
if (WatchList.ContainsKey(strCode) == true)
{
ULWatchItem item = WatchList[strCode];
int iDisplayCurPrice = 0;
if (lvItem.SubItems[chCurPrice.Index].Text.Length > 0)
iDisplayCurPrice = int.Parse(Regex.Replace(lvItem.SubItems[chCurPrice.Index].Text, @"\D", ""));
int iDisplayCurPrice = 0;
if (lvItem.SubItems[chCurPrice.Index].Text.Length > 0)
iDisplayCurPrice = int.Parse(Regex.Replace(lvItem.SubItems[chCurPrice.Index].Text, @"\D", ""));
if (item.m_iCurPrice != iDisplayCurPrice && item.m_iCurPrice != 0)
{
if (item.m_iCurPrice != iDisplayCurPrice && item.m_iCurPrice != 0)
{
int iComp = item.m_iCurPrice - item.m_iPrevClosing;
float fCompRate = item.m_iCurPrice / (float)item.m_iPrevClosing - 1.0f;
lvItem.SubItems[chCurPrice.Index].Text = item.m_iCurPrice.ToString("###,###,###,###");
lvItem.SubItems[chComp.Index].Text = iComp.ToString("###,###,###,###");
lvItem.SubItems[chCompRate.Index].Text = fCompRate.ToString("#,##0.00%") + "%";
lvItem.SubItems[chVolume.Index].Text = item.m_iVolume.ToString("###,###,###,###");
lvItem.SubItems[chBidPrice.Index].Text = item.m_iBidPrice.ToString("###,###,###,###");
lvItem.SubItems[chComp.Index].Text = iComp.ToString("###,###,###,###");
lvItem.SubItems[chCompRate.Index].Text = fCompRate.ToString("#,##0.00%") + "%";
lvItem.SubItems[chVolume.Index].Text = item.m_iVolume.ToString("###,###,###,###");
lvItem.SubItems[chBidPrice.Index].Text = item.m_iBidPrice.ToString("###,###,###,###");
if (fCompRate >= m_DataMgr.m_Setting.m_fBidMin &&
fCompRate <= m_DataMgr.m_Setting.m_fBidMax &&
item.IsUpSlope() == true &&
m_DataMgr.IsInBlackList(strCode) == false)
item.Is5MAGoingUp() == true &&
m_DataMgr.IsInBlackList(strCode) == false)
{
// bid and add to black list
UlUtil.Trace(string.Format("[{0}] 조건 매수 {1}원 ({2})", item.m_strCodeName, item.m_iCurPrice, fCompRate.ToString("0.00%")));
@@ -167,10 +167,10 @@ namespace upper_limit_crawler
m_DataMgr.GetTrader().Buy(strCode, item.m_iCurPrice, (int)m_DataMgr.m_Setting.m_fBidAmount);
m_DataMgr.AddBlackList(strCode);
}
}
}
}
}
}
}
}
}
private void Refresh(object sender, EventArgs e)
{