1분 candle chart, 5MA 추가
This commit is contained in:
@@ -16,14 +16,12 @@ namespace upper_limit_crawler
|
||||
const int MONITOR_DELAY = 15000;
|
||||
|
||||
ULDataMgr m_DataMgr;
|
||||
CPSYSDIBLib.CpSvrNew7043 m_7043 = new CPSYSDIBLib.CpSvrNew7043();
|
||||
CPSYSDIBLib.CpSvrNew7043 m_7043 = null;
|
||||
Timer m_Timer = new Timer();
|
||||
int m_iMonitorDelay = 0;
|
||||
int m_iLastTime = 0;
|
||||
bool m_bRequesting = false;
|
||||
|
||||
DSCBO1Lib.StockCur m_StockCur = new DSCBO1Lib.StockCur();
|
||||
|
||||
public ULMonitorDlg(ULDataMgr DataMgr)
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -33,30 +31,36 @@ namespace upper_limit_crawler
|
||||
this.TopLevel = false;
|
||||
|
||||
m_DataMgr = DataMgr;
|
||||
|
||||
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));
|
||||
|
||||
m_StockCur.Received += StockCur_Received;
|
||||
|
||||
|
||||
m_Timer.Interval = 100;
|
||||
m_Timer.Tick += Refresh;
|
||||
m_Timer.Start();
|
||||
}
|
||||
|
||||
private void StockCur_Received()
|
||||
{
|
||||
|
||||
}
|
||||
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));
|
||||
|
||||
bool Check()
|
||||
|
||||
RefreshMonitorItem();
|
||||
|
||||
m_Timer.Start();
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
m_Timer.Stop();
|
||||
}
|
||||
|
||||
bool RefreshMonitorItem()
|
||||
{
|
||||
if (m_bRequesting == true || UlUtil.GetLimitRemainCountRQ() < 30)
|
||||
return false;
|
||||
@@ -129,13 +133,13 @@ namespace upper_limit_crawler
|
||||
|
||||
void RefreshData()
|
||||
{
|
||||
Dictionary<string, WATCH_ITEM> WatchList = m_DataMgr.GetWatchList();
|
||||
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)
|
||||
{
|
||||
WATCH_ITEM item = WatchList[strCode];
|
||||
ULWatchItem item = WatchList[strCode];
|
||||
|
||||
int iDisplayCurPrice = 0;
|
||||
if (lvItem.SubItems[chCurPrice.Index].Text.Length > 0)
|
||||
@@ -154,10 +158,11 @@ namespace upper_limit_crawler
|
||||
|
||||
if (fCompRate >= m_DataMgr.m_Setting.m_fBidMin &&
|
||||
fCompRate <= m_DataMgr.m_Setting.m_fBidMax &&
|
||||
m_DataMgr.IsInBlackList(strCode) == false)
|
||||
item.IsUpSlope() == 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));
|
||||
UlUtil.Trace(string.Format("[{0}] 조건 매수 {1}원 ({2})", item.m_strCodeName, item.m_iCurPrice, fCompRate.ToString("0.00%")));
|
||||
|
||||
m_DataMgr.GetTrader().Buy(strCode, item.m_iCurPrice, (int)m_DataMgr.m_Setting.m_fBidAmount);
|
||||
m_DataMgr.AddBlackList(strCode);
|
||||
@@ -180,7 +185,7 @@ namespace upper_limit_crawler
|
||||
m_iMonitorDelay -= iDeltaT;
|
||||
if (m_iMonitorDelay <= 0)
|
||||
{
|
||||
bool bRequest = Check();
|
||||
bool bRequest = RefreshMonitorItem();
|
||||
m_iMonitorDelay = (bRequest == true) ? MONITOR_DELAY : 1000;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user