잔고 평가 dlg 추가

This commit is contained in:
2016-07-07 01:57:38 +09:00
parent 8006843ff0
commit c0a93e082a
9 changed files with 481 additions and 14 deletions

16
MainForm.Designer.cs generated
View File

@@ -56,11 +56,12 @@
this.btCancel = new System.Windows.Forms.Button(); this.btCancel = new System.Windows.Forms.Button();
this.tbBidMax = new System.Windows.Forms.TextBox(); this.tbBidMax = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label();
this.btBalance = new System.Windows.Forms.Button();
this.SuspendLayout(); this.SuspendLayout();
// //
// textBox1 // textBox1
// //
this.textBox1.Location = new System.Drawing.Point(835, 413); this.textBox1.Location = new System.Drawing.Point(836, 414);
this.textBox1.Multiline = true; this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1"; this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(392, 217); this.textBox1.Size = new System.Drawing.Size(392, 217);
@@ -112,6 +113,7 @@
this.chBuy, this.chBuy,
this.chBuyCnt}); this.chBuyCnt});
this.lvWatch.FullRowSelect = true; this.lvWatch.FullRowSelect = true;
this.lvWatch.GridLines = true;
this.lvWatch.Location = new System.Drawing.Point(12, 12); this.lvWatch.Location = new System.Drawing.Point(12, 12);
this.lvWatch.Name = "lvWatch"; this.lvWatch.Name = "lvWatch";
this.lvWatch.Size = new System.Drawing.Size(807, 618); this.lvWatch.Size = new System.Drawing.Size(807, 618);
@@ -283,11 +285,22 @@
this.label8.TabIndex = 11; this.label8.TabIndex = 11;
this.label8.Text = "~"; this.label8.Text = "~";
// //
// btBalance
//
this.btBalance.Location = new System.Drawing.Point(883, 298);
this.btBalance.Name = "btBalance";
this.btBalance.Size = new System.Drawing.Size(75, 23);
this.btBalance.TabIndex = 17;
this.btBalance.Text = "잔고";
this.btBalance.UseVisualStyleBackColor = true;
this.btBalance.Click += new System.EventHandler(this.btBalance_Click);
//
// MainForm // MainForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1239, 642); this.ClientSize = new System.Drawing.Size(1239, 642);
this.Controls.Add(this.btBalance);
this.Controls.Add(this.btCancel); this.Controls.Add(this.btCancel);
this.Controls.Add(this.btApply); this.Controls.Add(this.btApply);
this.Controls.Add(this.tbSearchMin); this.Controls.Add(this.tbSearchMin);
@@ -344,6 +357,7 @@
private System.Windows.Forms.Button btCancel; private System.Windows.Forms.Button btCancel;
private System.Windows.Forms.TextBox tbBidMax; private System.Windows.Forms.TextBox tbBidMax;
private System.Windows.Forms.Label label8; private System.Windows.Forms.Label label8;
private System.Windows.Forms.Button btBalance;
} }
} }

View File

@@ -38,6 +38,8 @@ namespace upper_limit_crawler
ULDealing m_Dealing = new ULDealing(m_DataMgr); ULDealing m_Dealing = new ULDealing(m_DataMgr);
ULOwn m_Own = new ULOwn(m_DataMgr); ULOwn m_Own = new ULOwn(m_DataMgr);
ULBalanceDlg m_BalanceDlg = null;
public MainForm() public MainForm()
{ {
InitializeComponent(); InitializeComponent();
@@ -141,5 +143,13 @@ namespace upper_limit_crawler
tbTrailing.Text = m_DataMgr.m_Setting.m_fTrailing.ToString("0.0"); tbTrailing.Text = m_DataMgr.m_Setting.m_fTrailing.ToString("0.0");
tbLossCut.Text = m_DataMgr.m_Setting.m_fLossCut.ToString("0.0"); tbLossCut.Text = m_DataMgr.m_Setting.m_fLossCut.ToString("0.0");
} }
private void btBalance_Click(object sender, EventArgs e)
{
if (m_BalanceDlg == null)
m_BalanceDlg = new ULBalanceDlg(m_DataMgr);
m_BalanceDlg.Show();
}
} }
} }

181
ULBalanceDlg.Designer.cs generated Normal file
View File

@@ -0,0 +1,181 @@
namespace upper_limit_crawler
{
partial class ULBalanceDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lvBalance = new System.Windows.Forms.ListView();
this.chCode = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chUnitBuyPrice = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chCurPrice = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chBalance = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chUnitBEP = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chUnitProfit = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chProfit = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chProfitRate = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.btRefresh = new System.Windows.Forms.Button();
this.btSellAll = new System.Windows.Forms.Button();
this.btSell = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// lvBalance
//
this.lvBalance.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lvBalance.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.chCode,
this.chName,
this.chUnitBuyPrice,
this.chCurPrice,
this.chBalance,
this.chUnitBEP,
this.chUnitProfit,
this.chProfit,
this.chProfitRate});
this.lvBalance.FullRowSelect = true;
this.lvBalance.GridLines = true;
this.lvBalance.Location = new System.Drawing.Point(12, 12);
this.lvBalance.MultiSelect = false;
this.lvBalance.Name = "lvBalance";
this.lvBalance.Size = new System.Drawing.Size(637, 362);
this.lvBalance.TabIndex = 0;
this.lvBalance.UseCompatibleStateImageBehavior = false;
this.lvBalance.View = System.Windows.Forms.View.Details;
this.lvBalance.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.lvBalance_ItemSelectionChanged);
//
// chCode
//
this.chCode.Text = "종목코드";
//
// chName
//
this.chName.Text = "종목명";
this.chName.Width = 100;
//
// chUnitBuyPrice
//
this.chUnitBuyPrice.Text = "장부가";
this.chUnitBuyPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// chCurPrice
//
this.chCurPrice.Text = "현재가";
this.chCurPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// chBalance
//
this.chBalance.Text = "잔고수량";
this.chBalance.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// chUnitBEP
//
this.chUnitBEP.Text = "손익단가";
this.chUnitBEP.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// chUnitProfit
//
this.chUnitProfit.Text = "평가손익";
this.chUnitProfit.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// chProfit
//
this.chProfit.Text = "평가금액";
this.chProfit.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// chProfitRate
//
this.chProfitRate.Text = "수익률";
this.chProfitRate.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.chProfitRate.Width = 80;
//
// btRefresh
//
this.btRefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btRefresh.Location = new System.Drawing.Point(12, 380);
this.btRefresh.Name = "btRefresh";
this.btRefresh.Size = new System.Drawing.Size(75, 23);
this.btRefresh.TabIndex = 1;
this.btRefresh.Text = "갱신";
this.btRefresh.UseVisualStyleBackColor = true;
this.btRefresh.Click += new System.EventHandler(this.btRefresh_Click);
//
// btSellAll
//
this.btSellAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btSellAll.Location = new System.Drawing.Point(574, 380);
this.btSellAll.Name = "btSellAll";
this.btSellAll.Size = new System.Drawing.Size(75, 23);
this.btSellAll.TabIndex = 2;
this.btSellAll.Text = "모두 청산";
this.btSellAll.UseVisualStyleBackColor = true;
this.btSellAll.Click += new System.EventHandler(this.btSellAll_Click);
//
// btSell
//
this.btSell.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btSell.Location = new System.Drawing.Point(493, 380);
this.btSell.Name = "btSell";
this.btSell.Size = new System.Drawing.Size(75, 23);
this.btSell.TabIndex = 3;
this.btSell.Text = "매도";
this.btSell.UseVisualStyleBackColor = true;
this.btSell.Click += new System.EventHandler(this.btSell_Click);
//
// ULBalanceDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(661, 415);
this.Controls.Add(this.btSell);
this.Controls.Add(this.btSellAll);
this.Controls.Add(this.btRefresh);
this.Controls.Add(this.lvBalance);
this.Name = "ULBalanceDlg";
this.Text = "잔고 평가";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ListView lvBalance;
private System.Windows.Forms.ColumnHeader chName;
private System.Windows.Forms.ColumnHeader chCurPrice;
private System.Windows.Forms.ColumnHeader chBalance;
private System.Windows.Forms.ColumnHeader chUnitBEP;
private System.Windows.Forms.ColumnHeader chUnitProfit;
private System.Windows.Forms.ColumnHeader chProfitRate;
private System.Windows.Forms.Button btRefresh;
private System.Windows.Forms.ColumnHeader chCode;
private System.Windows.Forms.ColumnHeader chUnitBuyPrice;
private System.Windows.Forms.ColumnHeader chProfit;
private System.Windows.Forms.Button btSellAll;
private System.Windows.Forms.Button btSell;
}
}

104
ULBalanceDlg.cs Normal file
View File

@@ -0,0 +1,104 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace upper_limit_crawler
{
public partial class ULBalanceDlg : Form
{
ULDataMgr m_DataMgr = null;
CPTRADELib.CpTd6033 m_Td6033 = new CPTRADELib.CpTd6033();
public ULBalanceDlg(ULDataMgr DataMgr)
{
m_DataMgr = DataMgr;
InitializeComponent();
MainForm.SetDoubleBuffered(lvBalance);
btSell.Enabled = false;
RefreshData();
}
private void RefreshData()
{
m_Td6033.SetInputValue(0, m_DataMgr.GetAccount());
m_Td6033.SetInputValue(2, 50);
m_Td6033.BlockRequest2(0);
lvBalance.Items.Clear();
int iCnt = m_Td6033.GetHeaderValue(7);
for (int i = 0; i < iCnt; i++)
{
string strCodeName = m_Td6033.GetDataValue(0, i);
int iPayBalance = m_Td6033.GetDataValue(3, i); // 결제 잔고수량
int iPayUnitPrice = m_Td6033.GetDataValue(4, i); // 결제 장부단가
int iConclusionBalanceCnt = m_Td6033.GetDataValue(7, i); // 체결 잔고수량
long iEvaluationPrice = m_Td6033.GetDataValue(9, i); // 평가금액 : 보유수량x현재가
long iEvaluationProfit = m_Td6033.GetDataValue(10, i); // 평가손익
double dReturn = m_Td6033.GetDataValue(11, i); // 수익률
string strCode = m_Td6033.GetDataValue(12, i);
int iAskableCnt = m_Td6033.GetDataValue(15, i); // 매도 가능 수량
double dConclusionUnitPrice = m_Td6033.GetDataValue(17, i); // 체결 장부단가
long iUnitBEP = m_Td6033.GetDataValue(18, i); // 손익단가 : 수수료 포함 순익 분기점 Break-Even Point
int iCurPrice = (int)(iEvaluationPrice / iConclusionBalanceCnt);
string[] row = { strCode, strCodeName, dConclusionUnitPrice.ToString("###,###,##0"), iCurPrice.ToString("###,###,##0"), iConclusionBalanceCnt.ToString("###,###,##0"),
iUnitBEP.ToString("###,###,##0"), iEvaluationProfit.ToString("###,###,##0"), iEvaluationPrice.ToString("###,###,##0"), dReturn.ToString("#,##0.##")+"%" };
var listViewItem = new ListViewItem(row);
lvBalance.Items.Add(listViewItem);
UlUtil.Trace(string.Format("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10}",
strCodeName, iPayBalance, iPayUnitPrice,
iConclusionBalanceCnt, iEvaluationPrice, iEvaluationProfit,
dReturn, strCode, iAskableCnt, dConclusionUnitPrice, iUnitBEP));
}
foreach (ColumnHeader col in lvBalance.Columns)
col.Width = -2;
}
private void btRefresh_Click(object sender, EventArgs e)
{
RefreshData();
}
private void btSell_Click(object sender, EventArgs e)
{
foreach(ListViewItem item in lvBalance.SelectedItems)
{
string strCode = item.SubItems[chCode.Index].Text;
int iCnt = int.Parse(item.SubItems[chBalance.Index].Text);
m_DataMgr.GetTrader().SellCurPrice(strCode, iCnt);
UlUtil.Trace("");
}
}
private void btSellAll_Click(object sender, EventArgs e)
{
foreach (ListViewItem item in lvBalance.Items)
{
string strCode = item.SubItems[chCode.Index].Text;
int iCnt = int.Parse(item.SubItems[chBalance.Index].Text);
m_DataMgr.GetTrader().SellCurPrice(strCode, iCnt);
UlUtil.Trace("");
}
}
private void lvBalance_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
{
btSell.Enabled = (lvBalance.SelectedItems.Count > 0);
}
}
}

120
ULBalanceDlg.resx Normal file
View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace upper_limit_crawler namespace upper_limit_crawler
{ {
struct SETTING public struct SETTING
{ {
public float m_fSearchMin; public float m_fSearchMin;
public float m_fSearchMax; public float m_fSearchMax;
@@ -20,7 +20,7 @@ namespace upper_limit_crawler
public float m_fLossCut; public float m_fLossCut;
} }
struct MONITOR_ITEM public struct MONITOR_ITEM
{ {
public object Code; public object Code;
public object Name; public object Name;
@@ -35,12 +35,12 @@ namespace upper_limit_crawler
public object SerialDay; public object SerialDay;
} }
struct WATCH_ITEM public struct WATCH_ITEM
{ {
public string m_strCode; public string m_strCode;
} }
class ULDataMgr public class ULDataMgr
{ {
//MySqlConnection m_DBCon; //MySqlConnection m_DBCon;
@@ -64,6 +64,11 @@ namespace upper_limit_crawler
//m_DBCon.Open(); //m_DBCon.Open();
} }
public string GetAccount()
{
return m_Trader.GetAccount();
}
public ULTrader GetTrader() public ULTrader GetTrader()
{ {
return m_Trader; return m_Trader;

View File

@@ -100,7 +100,7 @@ namespace upper_limit_crawler
m_DataMgr.IsInBlackList((string)Code) == false) m_DataMgr.IsInBlackList((string)Code) == false)
{ {
// bid and add to black list // bid and add to black list
m_DataMgr.GetTrader().Buy((string)Code, (float)(int)CurPrice, m_DataMgr.m_Setting.m_fBidAmount); m_DataMgr.GetTrader().Buy((string)Code, (int)CurPrice, (int)m_DataMgr.m_Setting.m_fBidAmount);
m_DataMgr.AddBlackList((string)Code); m_DataMgr.AddBlackList((string)Code);
} }
@@ -129,7 +129,10 @@ namespace upper_limit_crawler
} }
foreach (ColumnHeader col in lvWatch.Columns) foreach (ColumnHeader col in lvWatch.Columns)
col.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize); {
col.Width = -2;
//col.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
}
m_bRequesting = false; m_bRequesting = false;
} }

View File

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace upper_limit_crawler namespace upper_limit_crawler
{ {
class ULTrader public class ULTrader
{ {
CPFORETRADELib.CpForeTdUtil m_Util = new CPFORETRADELib.CpForeTdUtil(); CPFORETRADELib.CpForeTdUtil m_Util = new CPFORETRADELib.CpForeTdUtil();
DSCBO1Lib.CpConclusion m_Conclusion = new DSCBO1Lib.CpConclusion(); DSCBO1Lib.CpConclusion m_Conclusion = new DSCBO1Lib.CpConclusion();
@@ -23,6 +23,11 @@ namespace upper_limit_crawler
StartConclusion(); StartConclusion();
} }
public string GetAccount()
{
return m_astrAccounts[0];
}
void StartConclusion() void StartConclusion()
{ {
m_Conclusion.Received += Conclusion_Received; m_Conclusion.Received += Conclusion_Received;
@@ -104,23 +109,23 @@ namespace upper_limit_crawler
// 80 시간외바스켓 // 80 시간외바스켓
// 79 시간외대량자기 // 79 시간외대량자기
public void Buy(string strCode, long iBidPrice, long iBidAmount) public void Buy(string strCode, int iUnitPrice, int iBidAmount)
{ {
long iCnt = iBidAmount/iBidPrice; int iCnt = iBidAmount/ iUnitPrice;
iCnt = 1; iCnt = 1;
m_Td0311Bid.SetInputValue(0, "2"); m_Td0311Bid.SetInputValue(0, "2");
m_Td0311Bid.SetInputValue(1, m_astrAccounts[0]); m_Td0311Bid.SetInputValue(1, m_astrAccounts[0]);
m_Td0311Bid.SetInputValue(3, strCode); m_Td0311Bid.SetInputValue(3, strCode);
m_Td0311Bid.SetInputValue(4, iCnt); // 수량 m_Td0311Bid.SetInputValue(4, iCnt); // 수량
m_Td0311Bid.SetInputValue(5, iBidPrice); // 단가 m_Td0311Bid.SetInputValue(5, iUnitPrice); // 단가
m_Td0311Bid.SetInputValue(7, "0"); m_Td0311Bid.SetInputValue(7, "0");
m_Td0311Bid.SetInputValue(8, "03"); m_Td0311Bid.SetInputValue(8, "03");
m_Td0311Bid.BlockRequest(); m_Td0311Bid.BlockRequest();
} }
public void Sell(string strCode, long iAskPrice, long iCnt) public void Sell(string strCode, int iUnitPrice, int iCnt)
{ {
//long iCnt = (long)Math.Floor(fAskAmount/fCurPrice); //long iCnt = (long)Math.Floor(fAskAmount/fCurPrice);
//iCnt=1; //iCnt=1;
@@ -129,7 +134,23 @@ namespace upper_limit_crawler
m_Td0311Ask.SetInputValue(1, m_astrAccounts[0]); m_Td0311Ask.SetInputValue(1, m_astrAccounts[0]);
m_Td0311Ask.SetInputValue(3, strCode); m_Td0311Ask.SetInputValue(3, strCode);
m_Td0311Ask.SetInputValue(4, iCnt); // 수량 m_Td0311Ask.SetInputValue(4, iCnt); // 수량
m_Td0311Ask.SetInputValue(5, iAskPrice); // 단가 m_Td0311Ask.SetInputValue(5, iUnitPrice); // 단가
m_Td0311Ask.SetInputValue(7, "0");
m_Td0311Ask.SetInputValue(8, "03");
m_Td0311Ask.BlockRequest();
}
public void SellCurPrice(string strCode, int iCnt)
{
//long iCnt = (long)Math.Floor(fAskAmount/fCurPrice);
//iCnt=1;
m_Td0311Ask.SetInputValue(0, "1");
m_Td0311Ask.SetInputValue(1, m_astrAccounts[0]);
m_Td0311Ask.SetInputValue(3, strCode);
m_Td0311Ask.SetInputValue(4, iCnt); // 수량
m_Td0311Ask.SetInputValue(5, 0); // 단가
m_Td0311Ask.SetInputValue(7, "0"); m_Td0311Ask.SetInputValue(7, "0");
m_Td0311Ask.SetInputValue(8, "03"); m_Td0311Ask.SetInputValue(8, "03");

View File

@@ -57,6 +57,12 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="ULBalanceDlg.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ULBalanceDlg.Designer.cs">
<DependentUpon>ULBalanceDlg.cs</DependentUpon>
</Compile>
<Compile Include="MainForm.cs"> <Compile Include="MainForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@@ -85,6 +91,9 @@
<Compile Include="ULWatchForm.Designer.cs"> <Compile Include="ULWatchForm.Designer.cs">
<DependentUpon>ULWatchForm.cs</DependentUpon> <DependentUpon>ULWatchForm.cs</DependentUpon>
</Compile> </Compile>
<EmbeddedResource Include="ULBalanceDlg.resx">
<DependentUpon>ULBalanceDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.resx"> <EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon> <DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>