1분 candle chart, 5MA 추가
This commit is contained in:
150
MainForm.cs
150
MainForm.cs
@@ -2,6 +2,7 @@
|
||||
using System.Windows.Forms;
|
||||
using System.Collections;
|
||||
using System.Reflection;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace upper_limit_crawler
|
||||
{
|
||||
@@ -37,7 +38,6 @@ namespace upper_limit_crawler
|
||||
SetDoubleBuffered(tbLog);
|
||||
|
||||
UlUtil.Init(tbLog);
|
||||
//UlUtil.GetServerTime();
|
||||
|
||||
btApply_Click(null, null);
|
||||
|
||||
@@ -96,6 +96,12 @@ namespace upper_limit_crawler
|
||||
return;
|
||||
}
|
||||
|
||||
if(cbStart.Checked == true && UlUtil.IsConnected() == false)
|
||||
{
|
||||
cbStart.Checked = false;
|
||||
return;
|
||||
}
|
||||
|
||||
int iDeltaT = iCurTime - m_iLastTime;
|
||||
|
||||
m_Own.Refresh(iCurTime);
|
||||
@@ -103,10 +109,49 @@ namespace upper_limit_crawler
|
||||
lbRQCnt.Text = "RQ Count : " + UlUtil.GetLimitRemainCountRQ().ToString();
|
||||
lbSBCnt.Text = "SB Count : " + UlUtil.GetLimitRemainCountSB().ToString();
|
||||
|
||||
statusBar1.Panels[1].Text = UlUtil.GetCurTimeString() + " ";
|
||||
|
||||
m_iLastTime = iCurTime;
|
||||
}
|
||||
|
||||
private void AddTrace(string strCode)
|
||||
void StartAll()
|
||||
{
|
||||
m_MonitorDlg.Start();
|
||||
m_BalanceDlg.Start();
|
||||
m_DataMgr.StartAll();
|
||||
}
|
||||
|
||||
void StopAll()
|
||||
{
|
||||
m_MonitorDlg.Stop();
|
||||
m_BalanceDlg.Stop();
|
||||
m_DataMgr.StopAll();
|
||||
}
|
||||
|
||||
private void cbStart_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (cbStart.Checked == true)
|
||||
{
|
||||
if (UlUtil.IsConnected() == false)
|
||||
UlUtil.Reset();
|
||||
|
||||
if (UlUtil.IsConnected() == false)
|
||||
{
|
||||
cbStart.Checked = false;
|
||||
MessageBox.Show("Cybos Plus를 실행해주세요");
|
||||
return;
|
||||
}
|
||||
|
||||
m_DataMgr.Init();
|
||||
StartAll();
|
||||
}
|
||||
else
|
||||
{
|
||||
StopAll();
|
||||
}
|
||||
}
|
||||
|
||||
private void AddTrace(string strCode)
|
||||
{
|
||||
if (m_TraceList.Contains(strCode) == true)
|
||||
return;
|
||||
@@ -146,5 +191,104 @@ namespace upper_limit_crawler
|
||||
tbTrailing.Text = (m_DataMgr.m_Setting.m_fTrailing*100).ToString("0.0") + "%";
|
||||
tbLossCut.Text = (m_DataMgr.m_Setting.m_fLossCut*100).ToString("0.0") + "%";
|
||||
}
|
||||
}
|
||||
|
||||
private void btCybos5_Click(object sender, EventArgs e)
|
||||
{
|
||||
string strappname = @"C:\DAISHIN\STARTER\ncStarter.exe";
|
||||
Process.Start(strappname);
|
||||
}
|
||||
|
||||
private void btCybosPlus_Click(object sender, EventArgs e)
|
||||
{
|
||||
string strappname = @"C:\DAISHIN\STARTER\ncStarter.exe";
|
||||
Process.Start(strappname, @"/prj:cp");
|
||||
}
|
||||
|
||||
private void btTimeSync_Click(object sender, EventArgs e)
|
||||
{
|
||||
UlUtil.SyncServerTime();
|
||||
}
|
||||
|
||||
DSCBO1Lib.StockCur cur = new DSCBO1Lib.StockCur();
|
||||
DSCBO1Lib.StockOutCur outCur = new DSCBO1Lib.StockOutCur();
|
||||
string strCheckCode = "A004565";
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
{
|
||||
DSCBO1Lib.StockMst mst = new DSCBO1Lib.StockMst();
|
||||
mst.SetInputValue(0, strCheckCode);
|
||||
mst.BlockRequest();
|
||||
short time = mst.GetHeaderValue(4);
|
||||
Console.WriteLine("StockMst : {0}", time);
|
||||
}
|
||||
|
||||
{
|
||||
DSCBO1Lib.StockMst2 mst2 = new DSCBO1Lib.StockMst2();
|
||||
mst2.SetInputValue(0, strCheckCode);
|
||||
mst2.BlockRequest();
|
||||
long time = mst2.GetDataValue(2, 0);
|
||||
Console.WriteLine("StockMst2 : {0}", time);
|
||||
}
|
||||
|
||||
{
|
||||
cur.SetInputValue(0, strCheckCode);
|
||||
cur.Received += Cur_Received;
|
||||
cur.SubscribeLatest();
|
||||
}
|
||||
|
||||
{
|
||||
outCur.SetInputValue(0, strCheckCode);
|
||||
outCur.Received += OutCur_Received;
|
||||
outCur.SubscribeLatest();
|
||||
}
|
||||
}
|
||||
|
||||
private void OutCur_Received()
|
||||
{
|
||||
long time = outCur.GetHeaderValue(1);
|
||||
Console.WriteLine("StockOutCur : {0}", time);
|
||||
}
|
||||
|
||||
private void Cur_Received()
|
||||
{
|
||||
long time = cur.GetHeaderValue(3);
|
||||
long time2 = cur.GetHeaderValue(18);
|
||||
Console.WriteLine("StockCur : {0} / {1}", time, time2);
|
||||
}
|
||||
|
||||
private void btMATest_Click(object sender, EventArgs e)
|
||||
{
|
||||
CPSYSDIBLib.StockChart stockChart = new CPSYSDIBLib.StockChart();
|
||||
stockChart.SetInputValue(0, "A043580");
|
||||
stockChart.SetInputValue(1, '1');
|
||||
stockChart.SetInputValue(2, "20160722");
|
||||
stockChart.SetInputValue(3, "20160722");
|
||||
stockChart.SetInputValue(5, new int[] { 0, 1, 2, 3, 4, 5, 6, 10 });
|
||||
stockChart.SetInputValue(6, 'm');
|
||||
stockChart.BlockRequest2(1);
|
||||
|
||||
int iCnt = (int)stockChart.GetHeaderValue(3);
|
||||
int iFieldCnt = stockChart.GetHeaderValue(1);
|
||||
string[] astrFieldName = stockChart.GetHeaderValue(2);
|
||||
|
||||
ULWatchItem item = new ULWatchItem();
|
||||
|
||||
for (int i=iCnt-1; i>=0; i--)
|
||||
{
|
||||
int iTime = (int)stockChart.GetDataValue(1, i);
|
||||
int iPrice = (int)stockChart.GetDataValue(5, i);
|
||||
int iVolume = (int)stockChart.GetDataValue(5, i);
|
||||
|
||||
iTime *= 100;
|
||||
|
||||
item.m_iCurPrice = iPrice;
|
||||
item.InsertPriceNode(iTime, iPrice);
|
||||
}
|
||||
|
||||
//item.MakeChart();
|
||||
//item.MakeMAChart();
|
||||
item.PrintChart();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user