From 6d788f795a40ed3fafcb1f06e93540ed3f179a0e Mon Sep 17 00:00:00 2001 From: USER002 Date: Fri, 14 Jun 2024 14:47:51 +0900 Subject: [PATCH] =?UTF-8?q?1.=20=EC=A1=B0=EA=B1=B4=20=EC=9E=AC=EC=8B=9C?= =?UTF-8?q?=EC=9E=91=20=EB=B0=8F=20=ED=94=84=EB=A1=9C=EA=B7=B8=EB=9E=A8=20?= =?UTF-8?q?=EC=A2=85=EB=A3=8C=20Thread=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BitgetApi/.vs/BitgetApi.csproj.dtbcache.json | 2 +- BitgetApi/CommonProperty.cs | 1 + .../IchimokuConditionSetup.cs | 10 +- BitgetApi/MainForm.Designer.cs | 337 +++++++----------- BitgetApi/MainForm.cs | 266 +++++++------- BitgetApi/MainForm.resx | 2 +- BitgetApi/WebService/WebConnection.cs | 36 +- 7 files changed, 294 insertions(+), 360 deletions(-) diff --git a/BitgetApi/.vs/BitgetApi.csproj.dtbcache.json b/BitgetApi/.vs/BitgetApi.csproj.dtbcache.json index d6c20cc..e597654 100644 --- a/BitgetApi/.vs/BitgetApi.csproj.dtbcache.json +++ b/BitgetApi/.vs/BitgetApi.csproj.dtbcache.json @@ -1 +1 @@ -{"RootPath":"D:\\Project\\Bitget API\\BitGet_API\\BitgetApi","ProjectFileName":"BitgetApi.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"CommonProperty.cs"},{"SourceFile":"Data\\CandleData.cs"},{"SourceFile":"Data\\CandleDataList.cs"},{"SourceFile":"Data\\MarketInfo.cs"},{"SourceFile":"Data\\SignalInfoData.cs"},{"SourceFile":"Data\\TradeData.cs"},{"SourceFile":"Data\\WebSocketCandle.cs"},{"SourceFile":"Data\\IndicatorData.cs"},{"SourceFile":"IndicatorConditionSetup\\IchimokuConditionSetup.cs"},{"SourceFile":"IndicatorConditionSetup\\MovingAverageConditionSetup.cs"},{"SourceFile":"IndicatorData\\IchimokData.cs"},{"SourceFile":"IndicatorData\\IndicatorProcess.cs"},{"SourceFile":"IndicatorData\\MovingAverageData.cs"},{"SourceFile":"MainForm.cs"},{"SourceFile":"MainForm.Designer.cs"},{"SourceFile":"Program.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"Utils\\BaseSingleton.cs"},{"SourceFile":"Utils\\Convertor.cs"},{"SourceFile":"WebService\\WebConnection.cs"},{"SourceFile":"Properties\\Resources.Designer.cs"},{"SourceFile":"Properties\\Settings.Designer.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.7.2.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\Project\\Bitget API\\BitGet_API\\packages\\Newtonsoft.Json.13.0.3\\lib\\net45\\Newtonsoft.Json.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\PresentationCore.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.ComponentModel.DataAnnotations.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Deployment.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Drawing.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Runtime.Remoting.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Windows.Forms.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\UIAutomationClient.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\WindowsBase.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"D:\\Project\\Bitget API\\BitGet_API\\BitgetApi\\bin\\Debug\\BitgetApi.exe","OutputItemRelativePath":"BitgetApi.exe"},{"OutputItemFullPath":"D:\\Project\\Bitget API\\BitGet_API\\BitgetApi\\bin\\Debug\\BitgetApi.pdb","OutputItemRelativePath":"BitgetApi.pdb"}],"CopyToOutputEntries":[]} \ No newline at end of file +{"RootPath":"D:\\Project\\bitget_api\\bitget_api\\BitgetApi","ProjectFileName":"BitgetApi.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"CommonProperty.cs"},{"SourceFile":"Data\\CandleData.cs"},{"SourceFile":"Data\\CandleDataList.cs"},{"SourceFile":"Data\\MarketInfo.cs"},{"SourceFile":"Data\\SignalInfoData.cs"},{"SourceFile":"Data\\TradeData.cs"},{"SourceFile":"Data\\WebSocketCandle.cs"},{"SourceFile":"Data\\IndicatorData.cs"},{"SourceFile":"IndicatorConditionSetup\\IchimokuConditionSetup.cs"},{"SourceFile":"IndicatorConditionSetup\\MovingAverageConditionSetup.cs"},{"SourceFile":"IndicatorData\\IchimokData.cs"},{"SourceFile":"IndicatorData\\IndicatorProcess.cs"},{"SourceFile":"IndicatorData\\MovingAverageData.cs"},{"SourceFile":"MainForm.cs"},{"SourceFile":"MainForm.Designer.cs"},{"SourceFile":"Program.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"Utils\\BaseSingleton.cs"},{"SourceFile":"Utils\\Convertor.cs"},{"SourceFile":"WebService\\WebConnection.cs"},{"SourceFile":"Properties\\Resources.Designer.cs"},{"SourceFile":"Properties\\Settings.Designer.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.7.2.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\Program Files\\DevExpress 23.2\\Components\\Bin\\Framework\\DevExpress.Data.Desktop.v23.2.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files\\DevExpress 23.2\\Components\\Bin\\Framework\\DevExpress.Data.v23.2.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files\\DevExpress 23.2\\Components\\Bin\\Framework\\DevExpress.Drawing.v23.2.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files\\DevExpress 23.2\\Components\\Bin\\Framework\\DevExpress.Printing.v23.2.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files\\DevExpress 23.2\\Components\\Bin\\Framework\\DevExpress.Utils.v23.2.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files\\DevExpress 23.2\\Components\\Bin\\Framework\\DevExpress.XtraBars.v23.2.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files\\DevExpress 23.2\\Components\\Bin\\Framework\\DevExpress.XtraEditors.v23.2.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files\\DevExpress 23.2\\Components\\Bin\\Framework\\DevExpress.XtraGrid.v23.2.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files\\DevExpress 23.2\\Components\\Bin\\Framework\\DevExpress.XtraLayout.v23.2.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files\\DevExpress 23.2\\Components\\Bin\\Framework\\DevExpress.XtraPrinting.v23.2.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files\\DevExpress 23.2\\Components\\Bin\\Framework\\DevExpress.XtraTreeList.v23.2.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\Project\\bitget_api\\bitget_api\\packages\\Newtonsoft.Json.13.0.3\\lib\\net45\\Newtonsoft.Json.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\PresentationCore.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.ComponentModel.DataAnnotations.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Deployment.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Drawing.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Runtime.Remoting.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Windows.Forms.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\UIAutomationClient.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\WindowsBase.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"D:\\Project\\bitget_api\\bitget_api\\BitgetApi\\bin\\Debug\\BitgetApi.exe","OutputItemRelativePath":"BitgetApi.exe"},{"OutputItemFullPath":"D:\\Project\\bitget_api\\bitget_api\\BitgetApi\\bin\\Debug\\BitgetApi.pdb","OutputItemRelativePath":"BitgetApi.pdb"}],"CopyToOutputEntries":[]} \ No newline at end of file diff --git a/BitgetApi/CommonProperty.cs b/BitgetApi/CommonProperty.cs index 4d72e13..c25d7d4 100644 --- a/BitgetApi/CommonProperty.cs +++ b/BitgetApi/CommonProperty.cs @@ -5,6 +5,7 @@ using BitgetAPI.Utils; using System.Collections.Generic; using System.ComponentModel; using BitgetApi.Data; +using System.Net.WebSockets; namespace BitgetAPI { diff --git a/BitgetApi/IndicatorConditionSetup/IchimokuConditionSetup.cs b/BitgetApi/IndicatorConditionSetup/IchimokuConditionSetup.cs index e024501..a20fd51 100644 --- a/BitgetApi/IndicatorConditionSetup/IchimokuConditionSetup.cs +++ b/BitgetApi/IndicatorConditionSetup/IchimokuConditionSetup.cs @@ -38,12 +38,14 @@ namespace BitgetAPI.IndicatorConditionSetup public CommonProperty.Indicator_IchmokuOverLine IndicatorIchmokuOverLine { get; set; } // 캔들당 일목균형표 계산하기 - public void calIchimokuData(List candleDatas, CandleData candleData) + public void calIchimokuData(List candleDatas, CandleData candleData) { // 현재 종가 인덱스 var endIndex = candleDatas.Count() - 1; + if (candleData == null) return; + // Ichimok 없으면 생성 if (candleData.IchimokData == null) candleData.IchimokData = new IchimokData(); @@ -55,7 +57,7 @@ namespace BitgetAPI.IndicatorConditionSetup candleDatas.IndexOf(i) > endIndex - ConversionPeriod && candleDatas.IndexOf(i) <= endIndex); - if (datas == null) return; + if (datas == null || datas.Count == 0) return; // 전환선 candleData.IchimokData.전환선 = (datas.Min(i => i.Low) + datas.Max(i => i.High)) / 2; @@ -87,7 +89,7 @@ namespace BitgetAPI.IndicatorConditionSetup candleDatas.IndexOf(i) > endIndex - ConversionPeriod && candleDatas.IndexOf(i) <= endIndex); - if (datas == null) return; + if (datas == null || datas.Count == 0) return; // 전환선 : 26일 전봉 var displacement_전환선 = (datas.Min(i => i.Low) + datas.Max(i => i.High)) / 2; @@ -96,7 +98,7 @@ namespace BitgetAPI.IndicatorConditionSetup candleDatas.IndexOf(i) > endIndex - BaselinePeriod && candleDatas.IndexOf(i) <= endIndex); - if (datas == null) return; + if (datas == null || datas.Count == 0) return; // 기준선 : 26일 전봉 var displacement_기준선 = (datas.Min(i => i.Low) + datas.Max(i => i.High)) / 2; diff --git a/BitgetApi/MainForm.Designer.cs b/BitgetApi/MainForm.Designer.cs index 3ed1870..7265fc4 100644 --- a/BitgetApi/MainForm.Designer.cs +++ b/BitgetApi/MainForm.Designer.cs @@ -75,23 +75,13 @@ this.treeListColumn_SD_IndicatorRate = new DevExpress.XtraTreeList.Columns.TreeListColumn(); this.splitContainerControl_FavoritePurchase = new DevExpress.XtraEditors.SplitContainerControl(); this.groupControl_FP_LongDown = new DevExpress.XtraEditors.GroupControl(); - this.treeList1 = new DevExpress.XtraTreeList.TreeList(); - this.treeListColumn2 = new DevExpress.XtraTreeList.Columns.TreeListColumn(); - this.treeListColumn3 = new DevExpress.XtraTreeList.Columns.TreeListColumn(); - this.treeListColumn4 = new DevExpress.XtraTreeList.Columns.TreeListColumn(); - this.treeListColumn5 = new DevExpress.XtraTreeList.Columns.TreeListColumn(); - this.treeListColumn6 = new DevExpress.XtraTreeList.Columns.TreeListColumn(); - this.treeListColumn7 = new DevExpress.XtraTreeList.Columns.TreeListColumn(); - this.treeListColumn8 = new DevExpress.XtraTreeList.Columns.TreeListColumn(); this.groupControl_FP_ShortUp = new DevExpress.XtraEditors.GroupControl(); this.groupControl_SearcherCondition = new DevExpress.XtraEditors.GroupControl(); + this.simpleButton_SignalStart = new DevExpress.XtraEditors.SimpleButton(); this.simpleButton_MarketOrderRefresh = new DevExpress.XtraEditors.SimpleButton(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.checkEdit_ichmokuUp_DC = new DevExpress.XtraEditors.CheckEdit(); - this.checkEdit_ichmokuDown_DC = new DevExpress.XtraEditors.CheckEdit(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.checkEdit_ichmokuUp_UC = new DevExpress.XtraEditors.CheckEdit(); - this.checkEdit_IchmokuDown_UC = new DevExpress.XtraEditors.CheckEdit(); + this.checkEdit_ichmoku_Long = new DevExpress.XtraEditors.CheckEdit(); + this.checkEdit_Ichmoku_Short = new DevExpress.XtraEditors.CheckEdit(); this.timeSpanEdit_SesstionTime = new DevExpress.XtraEditors.TimeSpanEdit(); this.labelControl8 = new DevExpress.XtraEditors.LabelControl(); this.labelControl7 = new DevExpress.XtraEditors.LabelControl(); @@ -100,7 +90,9 @@ this.checkedComboBoxEdit_TimeInterval = new DevExpress.XtraEditors.CheckedComboBoxEdit(); this.checkedComboBoxEdit_MarketInfoList = new DevExpress.XtraEditors.CheckedComboBoxEdit(); this.treeListColumn1 = new DevExpress.XtraTreeList.Columns.TreeListColumn(); - this.simpleButton_SignalStart = new DevExpress.XtraEditors.SimpleButton(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.checkEdit_yhk_Long = new DevExpress.XtraEditors.CheckEdit(); + this.checkEdit_yhk_Short = new DevExpress.XtraEditors.CheckEdit(); ((System.ComponentModel.ISupportInitialize)(this.groupControl_Setting)).BeginInit(); this.groupControl_Setting.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.progressBarControl_data.Properties)).BeginInit(); @@ -140,20 +132,18 @@ this.splitContainerControl_FavoritePurchase.Panel2.SuspendLayout(); this.splitContainerControl_FavoritePurchase.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.groupControl_FP_LongDown)).BeginInit(); - this.groupControl_FP_LongDown.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.treeList1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.groupControl_FP_ShortUp)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.groupControl_SearcherCondition)).BeginInit(); this.groupControl_SearcherCondition.SuspendLayout(); - this.groupBox2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.checkEdit_ichmokuUp_DC.Properties)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.checkEdit_ichmokuDown_DC.Properties)).BeginInit(); this.groupBox1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.checkEdit_ichmokuUp_UC.Properties)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.checkEdit_IchmokuDown_UC.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.checkEdit_ichmoku_Long.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.checkEdit_Ichmoku_Short.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.timeSpanEdit_SesstionTime.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.checkedComboBoxEdit_TimeInterval.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.checkedComboBoxEdit_MarketInfoList.Properties)).BeginInit(); + this.groupBox2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.checkEdit_yhk_Long.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.checkEdit_yhk_Short.Properties)).BeginInit(); this.SuspendLayout(); // // groupControl_Setting @@ -168,14 +158,14 @@ this.groupControl_Setting.Controls.Add(this.labelControl1); this.groupControl_Setting.Location = new System.Drawing.Point(3, 2); this.groupControl_Setting.Name = "groupControl_Setting"; - this.groupControl_Setting.Size = new System.Drawing.Size(922, 75); + this.groupControl_Setting.Size = new System.Drawing.Size(1012, 75); this.groupControl_Setting.TabIndex = 0; this.groupControl_Setting.Text = "초기 설정"; // // progressBarControl_data // this.progressBarControl_data.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.progressBarControl_data.Location = new System.Drawing.Point(717, 43); + this.progressBarControl_data.Location = new System.Drawing.Point(807, 43); this.progressBarControl_data.Name = "progressBarControl_data"; this.progressBarControl_data.Properties.ShowTitle = true; this.progressBarControl_data.Size = new System.Drawing.Size(200, 18); @@ -206,7 +196,7 @@ // labelControl4 // this.labelControl4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.labelControl4.Location = new System.Drawing.Point(623, 44); + this.labelControl4.Location = new System.Drawing.Point(713, 44); this.labelControl4.Name = "labelControl4"; this.labelControl4.Size = new System.Drawing.Size(88, 14); this.labelControl4.TabIndex = 0; @@ -236,14 +226,14 @@ this.groupControl_MarketInfo.Dock = System.Windows.Forms.DockStyle.Fill; this.groupControl_MarketInfo.Location = new System.Drawing.Point(0, 0); this.groupControl_MarketInfo.Name = "groupControl_MarketInfo"; - this.groupControl_MarketInfo.Size = new System.Drawing.Size(920, 408); + this.groupControl_MarketInfo.Size = new System.Drawing.Size(1010, 408); this.groupControl_MarketInfo.TabIndex = 1; this.groupControl_MarketInfo.Text = "종목 현황"; // // labelControl_MarketCount // this.labelControl_MarketCount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.labelControl_MarketCount.Location = new System.Drawing.Point(866, 36); + this.labelControl_MarketCount.Location = new System.Drawing.Point(956, 36); this.labelControl_MarketCount.Name = "labelControl_MarketCount"; this.labelControl_MarketCount.Size = new System.Drawing.Size(21, 14); this.labelControl_MarketCount.TabIndex = 2; @@ -252,7 +242,7 @@ // labelControl3 // this.labelControl3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.labelControl3.Location = new System.Drawing.Point(814, 36); + this.labelControl3.Location = new System.Drawing.Point(904, 36); this.labelControl3.Name = "labelControl3"; this.labelControl3.Size = new System.Drawing.Size(46, 14); this.labelControl3.TabIndex = 1; @@ -275,7 +265,7 @@ this.treeListColumn_quoteVolume}); this.treeList_MarketInfo.Location = new System.Drawing.Point(2, 56); this.treeList_MarketInfo.Name = "treeList_MarketInfo"; - this.treeList_MarketInfo.Size = new System.Drawing.Size(916, 350); + this.treeList_MarketInfo.Size = new System.Drawing.Size(1006, 350); this.treeList_MarketInfo.TabIndex = 0; // // treeListColumn_ExchangePlace @@ -372,7 +362,7 @@ this.xtraTabControl_Main.Location = new System.Drawing.Point(3, 83); this.xtraTabControl_Main.Name = "xtraTabControl_Main"; this.xtraTabControl_Main.SelectedTabPage = this.xtraTabPage_Status; - this.xtraTabControl_Main.Size = new System.Drawing.Size(922, 434); + this.xtraTabControl_Main.Size = new System.Drawing.Size(1012, 434); this.xtraTabControl_Main.TabIndex = 2; this.xtraTabControl_Main.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { this.xtraTabPage_Status, @@ -382,7 +372,7 @@ // this.xtraTabPage_Status.Controls.Add(this.groupControl_MarketInfo); this.xtraTabPage_Status.Name = "xtraTabPage_Status"; - this.xtraTabPage_Status.Size = new System.Drawing.Size(920, 408); + this.xtraTabPage_Status.Size = new System.Drawing.Size(1010, 408); this.xtraTabPage_Status.Text = "현황판"; // // xtraTabPage_Searcher @@ -390,7 +380,7 @@ this.xtraTabPage_Searcher.Controls.Add(this.groupControl_SignalSeacher); this.xtraTabPage_Searcher.Controls.Add(this.groupControl_SearcherCondition); this.xtraTabPage_Searcher.Name = "xtraTabPage_Searcher"; - this.xtraTabPage_Searcher.Size = new System.Drawing.Size(920, 408); + this.xtraTabPage_Searcher.Size = new System.Drawing.Size(1010, 408); this.xtraTabPage_Searcher.Text = "검색기"; // // groupControl_SignalSeacher @@ -399,7 +389,7 @@ this.groupControl_SignalSeacher.Dock = System.Windows.Forms.DockStyle.Fill; this.groupControl_SignalSeacher.Location = new System.Drawing.Point(0, 119); this.groupControl_SignalSeacher.Name = "groupControl_SignalSeacher"; - this.groupControl_SignalSeacher.Size = new System.Drawing.Size(920, 289); + this.groupControl_SignalSeacher.Size = new System.Drawing.Size(1010, 289); this.groupControl_SignalSeacher.TabIndex = 1; this.groupControl_SignalSeacher.Text = "신호 검색"; // @@ -418,8 +408,8 @@ // this.splitContainerControl_SearchSignal.Panel2.Controls.Add(this.splitContainerControl_FavoritePurchase); this.splitContainerControl_SearchSignal.Panel2.Text = "Panel2"; - this.splitContainerControl_SearchSignal.Size = new System.Drawing.Size(916, 264); - this.splitContainerControl_SearchSignal.SplitterPosition = 476; + this.splitContainerControl_SearchSignal.Size = new System.Drawing.Size(1006, 264); + this.splitContainerControl_SearchSignal.SplitterPosition = 586; this.splitContainerControl_SearchSignal.TabIndex = 1; // // splitContainerControl_UpdateSignal @@ -438,7 +428,7 @@ // this.splitContainerControl_UpdateSignal.Panel2.Controls.Add(this.groupControl_LongDownSignal); this.splitContainerControl_UpdateSignal.Panel2.Text = "Panel2"; - this.splitContainerControl_UpdateSignal.Size = new System.Drawing.Size(476, 264); + this.splitContainerControl_UpdateSignal.Size = new System.Drawing.Size(586, 264); this.splitContainerControl_UpdateSignal.SplitterPosition = 129; this.splitContainerControl_UpdateSignal.TabIndex = 2; // @@ -448,7 +438,7 @@ this.groupControl_LongUpSignal.Dock = System.Windows.Forms.DockStyle.Fill; this.groupControl_LongUpSignal.Location = new System.Drawing.Point(0, 0); this.groupControl_LongUpSignal.Name = "groupControl_LongUpSignal"; - this.groupControl_LongUpSignal.Size = new System.Drawing.Size(476, 129); + this.groupControl_LongUpSignal.Size = new System.Drawing.Size(586, 129); this.groupControl_LongUpSignal.TabIndex = 0; this.groupControl_LongUpSignal.Text = "검색 현황 (Long 상숭)"; // @@ -465,7 +455,7 @@ this.treeList_LongUp.Dock = System.Windows.Forms.DockStyle.Fill; this.treeList_LongUp.Location = new System.Drawing.Point(2, 23); this.treeList_LongUp.Name = "treeList_LongUp"; - this.treeList_LongUp.Size = new System.Drawing.Size(472, 104); + this.treeList_LongUp.Size = new System.Drawing.Size(582, 104); this.treeList_LongUp.TabIndex = 0; // // treeListColumn_SignalStart @@ -477,6 +467,7 @@ this.treeListColumn_SignalStart.Name = "treeListColumn_SignalStart"; this.treeListColumn_SignalStart.Visible = true; this.treeListColumn_SignalStart.VisibleIndex = 2; + this.treeListColumn_SignalStart.Width = 84; // // treeListColumn_LU_MarketName // @@ -485,6 +476,7 @@ this.treeListColumn_LU_MarketName.Name = "treeListColumn_LU_MarketName"; this.treeListColumn_LU_MarketName.Visible = true; this.treeListColumn_LU_MarketName.VisibleIndex = 1; + this.treeListColumn_LU_MarketName.Width = 84; // // treeListColumn_LU_Description // @@ -493,6 +485,7 @@ this.treeListColumn_LU_Description.Name = "treeListColumn_LU_Description"; this.treeListColumn_LU_Description.Visible = true; this.treeListColumn_LU_Description.VisibleIndex = 0; + this.treeListColumn_LU_Description.Width = 59; // // treeListColumn_LU_Price // @@ -503,6 +496,7 @@ this.treeListColumn_LU_Price.Name = "treeListColumn_LU_Price"; this.treeListColumn_LU_Price.Visible = true; this.treeListColumn_LU_Price.VisibleIndex = 3; + this.treeListColumn_LU_Price.Width = 84; // // treeListColumn_Rate // @@ -513,26 +507,29 @@ this.treeListColumn_Rate.Name = "treeListColumn_Rate"; this.treeListColumn_Rate.Visible = true; this.treeListColumn_Rate.VisibleIndex = 4; + this.treeListColumn_Rate.Width = 82; // // treeListColumn_LU_IndicatorPrice // - this.treeListColumn_LU_IndicatorPrice.Caption = "지표(구름떼) 가격"; + this.treeListColumn_LU_IndicatorPrice.Caption = "매수가(예상)"; this.treeListColumn_LU_IndicatorPrice.FieldName = "IndicatorPrice"; this.treeListColumn_LU_IndicatorPrice.Format.FormatString = "0.00000"; this.treeListColumn_LU_IndicatorPrice.Format.FormatType = DevExpress.Utils.FormatType.Custom; this.treeListColumn_LU_IndicatorPrice.Name = "treeListColumn_LU_IndicatorPrice"; this.treeListColumn_LU_IndicatorPrice.Visible = true; this.treeListColumn_LU_IndicatorPrice.VisibleIndex = 5; + this.treeListColumn_LU_IndicatorPrice.Width = 82; // // treeListColumn_LU_IndicatorRate // - this.treeListColumn_LU_IndicatorRate.Caption = "지표가(매수가) 비율"; + this.treeListColumn_LU_IndicatorRate.Caption = "수익률(예상)"; this.treeListColumn_LU_IndicatorRate.FieldName = "IndicatorRate"; this.treeListColumn_LU_IndicatorRate.Format.FormatString = "0.00000"; this.treeListColumn_LU_IndicatorRate.Format.FormatType = DevExpress.Utils.FormatType.Custom; this.treeListColumn_LU_IndicatorRate.Name = "treeListColumn_LU_IndicatorRate"; this.treeListColumn_LU_IndicatorRate.Visible = true; this.treeListColumn_LU_IndicatorRate.VisibleIndex = 6; + this.treeListColumn_LU_IndicatorRate.Width = 82; // // groupControl_LongDownSignal // @@ -540,7 +537,7 @@ this.groupControl_LongDownSignal.Dock = System.Windows.Forms.DockStyle.Fill; this.groupControl_LongDownSignal.Location = new System.Drawing.Point(0, 0); this.groupControl_LongDownSignal.Name = "groupControl_LongDownSignal"; - this.groupControl_LongDownSignal.Size = new System.Drawing.Size(476, 125); + this.groupControl_LongDownSignal.Size = new System.Drawing.Size(586, 125); this.groupControl_LongDownSignal.TabIndex = 0; this.groupControl_LongDownSignal.Text = "검색 현황 (Short 하락)"; // @@ -557,7 +554,7 @@ this.treeList_ShortDown.Dock = System.Windows.Forms.DockStyle.Fill; this.treeList_ShortDown.Location = new System.Drawing.Point(2, 23); this.treeList_ShortDown.Name = "treeList_ShortDown"; - this.treeList_ShortDown.Size = new System.Drawing.Size(472, 100); + this.treeList_ShortDown.Size = new System.Drawing.Size(582, 100); this.treeList_ShortDown.TabIndex = 1; // // treeListColumn_SD_SignalStart @@ -569,6 +566,7 @@ this.treeListColumn_SD_SignalStart.Name = "treeListColumn_SD_SignalStart"; this.treeListColumn_SD_SignalStart.Visible = true; this.treeListColumn_SD_SignalStart.VisibleIndex = 2; + this.treeListColumn_SD_SignalStart.Width = 84; // // treeListColumn_SD_MarketName // @@ -577,6 +575,7 @@ this.treeListColumn_SD_MarketName.Name = "treeListColumn_SD_MarketName"; this.treeListColumn_SD_MarketName.Visible = true; this.treeListColumn_SD_MarketName.VisibleIndex = 1; + this.treeListColumn_SD_MarketName.Width = 84; // // treeListColumn_SD_Description // @@ -585,6 +584,7 @@ this.treeListColumn_SD_Description.Name = "treeListColumn_SD_Description"; this.treeListColumn_SD_Description.Visible = true; this.treeListColumn_SD_Description.VisibleIndex = 0; + this.treeListColumn_SD_Description.Width = 58; // // treeListColumn_SD_Price // @@ -595,6 +595,7 @@ this.treeListColumn_SD_Price.Name = "treeListColumn_SD_Price"; this.treeListColumn_SD_Price.Visible = true; this.treeListColumn_SD_Price.VisibleIndex = 3; + this.treeListColumn_SD_Price.Width = 84; // // treeListColumn_SD_Rate // @@ -605,26 +606,29 @@ this.treeListColumn_SD_Rate.Name = "treeListColumn_SD_Rate"; this.treeListColumn_SD_Rate.Visible = true; this.treeListColumn_SD_Rate.VisibleIndex = 4; + this.treeListColumn_SD_Rate.Width = 83; // // treeListColumn_SD_IndicatorPrice // - this.treeListColumn_SD_IndicatorPrice.Caption = "지표(구름떼) 가격"; + this.treeListColumn_SD_IndicatorPrice.Caption = "매수가(예상)"; this.treeListColumn_SD_IndicatorPrice.FieldName = "IndicatorPrice"; this.treeListColumn_SD_IndicatorPrice.Format.FormatString = "0.00000"; this.treeListColumn_SD_IndicatorPrice.Format.FormatType = DevExpress.Utils.FormatType.Custom; this.treeListColumn_SD_IndicatorPrice.Name = "treeListColumn_SD_IndicatorPrice"; this.treeListColumn_SD_IndicatorPrice.Visible = true; this.treeListColumn_SD_IndicatorPrice.VisibleIndex = 5; + this.treeListColumn_SD_IndicatorPrice.Width = 82; // // treeListColumn_SD_IndicatorRate // - this.treeListColumn_SD_IndicatorRate.Caption = "지표가(매수가) 비율"; + this.treeListColumn_SD_IndicatorRate.Caption = "수익률(예상)"; this.treeListColumn_SD_IndicatorRate.FieldName = "IndicatorRate"; this.treeListColumn_SD_IndicatorRate.Format.FormatString = "0.00000"; this.treeListColumn_SD_IndicatorRate.Format.FormatType = DevExpress.Utils.FormatType.Custom; this.treeListColumn_SD_IndicatorRate.Name = "treeListColumn_SD_IndicatorRate"; this.treeListColumn_SD_IndicatorRate.Visible = true; this.treeListColumn_SD_IndicatorRate.VisibleIndex = 6; + this.treeListColumn_SD_IndicatorRate.Width = 82; // // splitContainerControl_FavoritePurchase // @@ -642,116 +646,33 @@ // this.splitContainerControl_FavoritePurchase.Panel2.Controls.Add(this.groupControl_FP_ShortUp); this.splitContainerControl_FavoritePurchase.Panel2.Text = "Panel2"; - this.splitContainerControl_FavoritePurchase.Size = new System.Drawing.Size(430, 264); + this.splitContainerControl_FavoritePurchase.Size = new System.Drawing.Size(410, 264); this.splitContainerControl_FavoritePurchase.SplitterPosition = 130; this.splitContainerControl_FavoritePurchase.TabIndex = 3; // // groupControl_FP_LongDown // - this.groupControl_FP_LongDown.Controls.Add(this.treeList1); this.groupControl_FP_LongDown.Dock = System.Windows.Forms.DockStyle.Fill; this.groupControl_FP_LongDown.Location = new System.Drawing.Point(0, 0); this.groupControl_FP_LongDown.Name = "groupControl_FP_LongDown"; - this.groupControl_FP_LongDown.Size = new System.Drawing.Size(430, 130); + this.groupControl_FP_LongDown.Size = new System.Drawing.Size(410, 130); this.groupControl_FP_LongDown.TabIndex = 0; this.groupControl_FP_LongDown.Text = "관심 종목 (Long 상승)"; // - // treeList1 - // - this.treeList1.Columns.AddRange(new DevExpress.XtraTreeList.Columns.TreeListColumn[] { - this.treeListColumn2, - this.treeListColumn3, - this.treeListColumn4, - this.treeListColumn5, - this.treeListColumn6, - this.treeListColumn7, - this.treeListColumn8}); - this.treeList1.Dock = System.Windows.Forms.DockStyle.Fill; - this.treeList1.Location = new System.Drawing.Point(2, 23); - this.treeList1.Name = "treeList1"; - this.treeList1.Size = new System.Drawing.Size(426, 105); - this.treeList1.TabIndex = 1; - // - // treeListColumn2 - // - this.treeListColumn2.Caption = "시작 시간"; - this.treeListColumn2.FieldName = "SignalStart"; - this.treeListColumn2.Format.FormatString = "yy/MM/dd hh:mm"; - this.treeListColumn2.Format.FormatType = DevExpress.Utils.FormatType.Custom; - this.treeListColumn2.Name = "treeListColumn2"; - this.treeListColumn2.Visible = true; - this.treeListColumn2.VisibleIndex = 2; - // - // treeListColumn3 - // - this.treeListColumn3.Caption = "종목"; - this.treeListColumn3.FieldName = "MarketName"; - this.treeListColumn3.Name = "treeListColumn3"; - this.treeListColumn3.Visible = true; - this.treeListColumn3.VisibleIndex = 1; - // - // treeListColumn4 - // - this.treeListColumn4.Caption = "설명"; - this.treeListColumn4.FieldName = "Description"; - this.treeListColumn4.Name = "treeListColumn4"; - this.treeListColumn4.Visible = true; - this.treeListColumn4.VisibleIndex = 0; - // - // treeListColumn5 - // - this.treeListColumn5.Caption = "현재가"; - this.treeListColumn5.FieldName = "Price"; - this.treeListColumn5.Format.FormatString = "0.00"; - this.treeListColumn5.Format.FormatType = DevExpress.Utils.FormatType.Custom; - this.treeListColumn5.Name = "treeListColumn5"; - this.treeListColumn5.Visible = true; - this.treeListColumn5.VisibleIndex = 3; - // - // treeListColumn6 - // - this.treeListColumn6.Caption = "수익률"; - this.treeListColumn6.FieldName = "Rate"; - this.treeListColumn6.Format.FormatString = "0.00000"; - this.treeListColumn6.Format.FormatType = DevExpress.Utils.FormatType.Custom; - this.treeListColumn6.Name = "treeListColumn6"; - this.treeListColumn6.Visible = true; - this.treeListColumn6.VisibleIndex = 4; - // - // treeListColumn7 - // - this.treeListColumn7.Caption = "지표(구름떼) 가격"; - this.treeListColumn7.FieldName = "IndicatorPrice"; - this.treeListColumn7.Format.FormatString = "0.00"; - this.treeListColumn7.Format.FormatType = DevExpress.Utils.FormatType.Custom; - this.treeListColumn7.Name = "treeListColumn7"; - this.treeListColumn7.Visible = true; - this.treeListColumn7.VisibleIndex = 5; - // - // treeListColumn8 - // - this.treeListColumn8.Caption = "지표가(매수가) 비율"; - this.treeListColumn8.FieldName = "IndicatorRate"; - this.treeListColumn8.Format.FormatString = "0.00000"; - this.treeListColumn8.Format.FormatType = DevExpress.Utils.FormatType.Custom; - this.treeListColumn8.Name = "treeListColumn8"; - this.treeListColumn8.Visible = true; - this.treeListColumn8.VisibleIndex = 6; - // // groupControl_FP_ShortUp // this.groupControl_FP_ShortUp.Dock = System.Windows.Forms.DockStyle.Fill; this.groupControl_FP_ShortUp.Location = new System.Drawing.Point(0, 0); this.groupControl_FP_ShortUp.Name = "groupControl_FP_ShortUp"; - this.groupControl_FP_ShortUp.Size = new System.Drawing.Size(430, 124); + this.groupControl_FP_ShortUp.Size = new System.Drawing.Size(410, 124); this.groupControl_FP_ShortUp.TabIndex = 0; this.groupControl_FP_ShortUp.Text = "관심 종목 (Long 하락)"; // // groupControl_SearcherCondition // + this.groupControl_SearcherCondition.Controls.Add(this.groupBox2); this.groupControl_SearcherCondition.Controls.Add(this.simpleButton_SignalStart); this.groupControl_SearcherCondition.Controls.Add(this.simpleButton_MarketOrderRefresh); - this.groupControl_SearcherCondition.Controls.Add(this.groupBox2); this.groupControl_SearcherCondition.Controls.Add(this.groupBox1); this.groupControl_SearcherCondition.Controls.Add(this.timeSpanEdit_SesstionTime); this.groupControl_SearcherCondition.Controls.Add(this.labelControl8); @@ -763,10 +684,21 @@ this.groupControl_SearcherCondition.Dock = System.Windows.Forms.DockStyle.Top; this.groupControl_SearcherCondition.Location = new System.Drawing.Point(0, 0); this.groupControl_SearcherCondition.Name = "groupControl_SearcherCondition"; - this.groupControl_SearcherCondition.Size = new System.Drawing.Size(920, 119); + this.groupControl_SearcherCondition.Size = new System.Drawing.Size(1010, 119); this.groupControl_SearcherCondition.TabIndex = 0; this.groupControl_SearcherCondition.Text = "조건 설정"; // + // simpleButton_SignalStart + // + this.simpleButton_SignalStart.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("simpleButton_SignalStart.ImageOptions.SvgImage"))); + this.simpleButton_SignalStart.ImageOptions.SvgImageColorizationMode = DevExpress.Utils.SvgImageColorizationMode.Full; + this.simpleButton_SignalStart.Location = new System.Drawing.Point(575, 37); + this.simpleButton_SignalStart.Name = "simpleButton_SignalStart"; + this.simpleButton_SignalStart.Size = new System.Drawing.Size(35, 30); + this.simpleButton_SignalStart.TabIndex = 8; + this.simpleButton_SignalStart.Text = "R"; + this.simpleButton_SignalStart.Click += new System.EventHandler(this.simpleButton_SignalStart_Click); + // // simpleButton_MarketOrderRefresh // this.simpleButton_MarketOrderRefresh.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("simpleButton_MarketOrderRefresh.ImageOptions.SvgImage"))); @@ -778,69 +710,37 @@ this.simpleButton_MarketOrderRefresh.Text = "R"; this.simpleButton_MarketOrderRefresh.Click += new System.EventHandler(this.simpleButton_MarketOrderRefresh_Click); // - // groupBox2 - // - this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox2.Controls.Add(this.checkEdit_ichmokuUp_DC); - this.groupBox2.Controls.Add(this.checkEdit_ichmokuDown_DC); - this.groupBox2.Location = new System.Drawing.Point(802, 26); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(112, 68); - this.groupBox2.TabIndex = 5; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "아래 구름선 (하락)"; - // - // checkEdit_ichmokuUp_DC - // - this.checkEdit_ichmokuUp_DC.EditValue = true; - this.checkEdit_ichmokuUp_DC.Enabled = false; - this.checkEdit_ichmokuUp_DC.Location = new System.Drawing.Point(6, 21); - this.checkEdit_ichmokuUp_DC.Name = "checkEdit_ichmokuUp_DC"; - this.checkEdit_ichmokuUp_DC.Properties.Caption = "구름떼 돌파"; - this.checkEdit_ichmokuUp_DC.Size = new System.Drawing.Size(87, 20); - this.checkEdit_ichmokuUp_DC.TabIndex = 2; - // - // checkEdit_ichmokuDown_DC - // - this.checkEdit_ichmokuDown_DC.EditValue = true; - this.checkEdit_ichmokuDown_DC.Enabled = false; - this.checkEdit_ichmokuDown_DC.Location = new System.Drawing.Point(6, 40); - this.checkEdit_ichmokuDown_DC.Name = "checkEdit_ichmokuDown_DC"; - this.checkEdit_ichmokuDown_DC.Properties.Caption = "구름떼 하락"; - this.checkEdit_ichmokuDown_DC.Size = new System.Drawing.Size(87, 20); - this.checkEdit_ichmokuDown_DC.TabIndex = 2; - // // groupBox1 // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox1.Controls.Add(this.checkEdit_ichmokuUp_UC); - this.groupBox1.Controls.Add(this.checkEdit_IchmokuDown_UC); - this.groupBox1.Location = new System.Drawing.Point(690, 26); + this.groupBox1.Controls.Add(this.checkEdit_ichmoku_Long); + this.groupBox1.Controls.Add(this.checkEdit_Ichmoku_Short); + this.groupBox1.Location = new System.Drawing.Point(806, 37); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(106, 68); + this.groupBox1.Size = new System.Drawing.Size(96, 68); this.groupBox1.TabIndex = 6; this.groupBox1.TabStop = false; - this.groupBox1.Text = "윗 구름선 (상승)"; + this.groupBox1.Text = "구름떼"; // - // checkEdit_ichmokuUp_UC + // checkEdit_ichmoku_Long // - this.checkEdit_ichmokuUp_UC.EditValue = true; - this.checkEdit_ichmokuUp_UC.Enabled = false; - this.checkEdit_ichmokuUp_UC.Location = new System.Drawing.Point(6, 21); - this.checkEdit_ichmokuUp_UC.Name = "checkEdit_ichmokuUp_UC"; - this.checkEdit_ichmokuUp_UC.Properties.Caption = "구름떼 돌파"; - this.checkEdit_ichmokuUp_UC.Size = new System.Drawing.Size(87, 20); - this.checkEdit_ichmokuUp_UC.TabIndex = 2; + this.checkEdit_ichmoku_Long.EditValue = true; + this.checkEdit_ichmoku_Long.Enabled = false; + this.checkEdit_ichmoku_Long.Location = new System.Drawing.Point(6, 21); + this.checkEdit_ichmoku_Long.Name = "checkEdit_ichmoku_Long"; + this.checkEdit_ichmoku_Long.Properties.Caption = "Long"; + this.checkEdit_ichmoku_Long.Size = new System.Drawing.Size(87, 20); + this.checkEdit_ichmoku_Long.TabIndex = 2; // - // checkEdit_IchmokuDown_UC + // checkEdit_Ichmoku_Short // - this.checkEdit_IchmokuDown_UC.EditValue = true; - this.checkEdit_IchmokuDown_UC.Enabled = false; - this.checkEdit_IchmokuDown_UC.Location = new System.Drawing.Point(6, 40); - this.checkEdit_IchmokuDown_UC.Name = "checkEdit_IchmokuDown_UC"; - this.checkEdit_IchmokuDown_UC.Properties.Caption = "구름떼 하락"; - this.checkEdit_IchmokuDown_UC.Size = new System.Drawing.Size(87, 20); - this.checkEdit_IchmokuDown_UC.TabIndex = 2; + this.checkEdit_Ichmoku_Short.EditValue = true; + this.checkEdit_Ichmoku_Short.Enabled = false; + this.checkEdit_Ichmoku_Short.Location = new System.Drawing.Point(6, 40); + this.checkEdit_Ichmoku_Short.Name = "checkEdit_Ichmoku_Short"; + this.checkEdit_Ichmoku_Short.Properties.Caption = "Short"; + this.checkEdit_Ichmoku_Short.Size = new System.Drawing.Size(87, 20); + this.checkEdit_Ichmoku_Short.TabIndex = 2; // // timeSpanEdit_SesstionTime // @@ -915,22 +815,41 @@ this.treeListColumn1.Visible = true; this.treeListColumn1.VisibleIndex = 0; // - // simpleButton_SignalStart + // groupBox2 // - this.simpleButton_SignalStart.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("simpleButton1.ImageOptions.SvgImage"))); - this.simpleButton_SignalStart.ImageOptions.SvgImageColorizationMode = DevExpress.Utils.SvgImageColorizationMode.Full; - this.simpleButton_SignalStart.Location = new System.Drawing.Point(575, 37); - this.simpleButton_SignalStart.Name = "simpleButton_SignalStart"; - this.simpleButton_SignalStart.Size = new System.Drawing.Size(35, 30); - this.simpleButton_SignalStart.TabIndex = 8; - this.simpleButton_SignalStart.Text = "R"; - this.simpleButton_SignalStart.Click += new System.EventHandler(this.simpleButton_SignalStart_Click); + this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox2.Controls.Add(this.checkEdit_yhk_Long); + this.groupBox2.Controls.Add(this.checkEdit_yhk_Short); + this.groupBox2.Location = new System.Drawing.Point(908, 36); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(83, 68); + this.groupBox2.TabIndex = 9; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "24,72,4"; + // + // checkEdit_yhk_Long + // + this.checkEdit_yhk_Long.Location = new System.Drawing.Point(6, 21); + this.checkEdit_yhk_Long.Name = "checkEdit_yhk_Long"; + this.checkEdit_yhk_Long.Properties.Caption = "Long"; + this.checkEdit_yhk_Long.Size = new System.Drawing.Size(87, 20); + this.checkEdit_yhk_Long.TabIndex = 2; + // + // checkEdit_yhk_Short + // + this.checkEdit_yhk_Short.EditValue = true; + this.checkEdit_yhk_Short.Enabled = false; + this.checkEdit_yhk_Short.Location = new System.Drawing.Point(6, 40); + this.checkEdit_yhk_Short.Name = "checkEdit_yhk_Short"; + this.checkEdit_yhk_Short.Properties.Caption = "Short"; + this.checkEdit_yhk_Short.Size = new System.Drawing.Size(87, 20); + this.checkEdit_yhk_Short.TabIndex = 2; // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(926, 522); + this.ClientSize = new System.Drawing.Size(1016, 522); this.Controls.Add(this.xtraTabControl_Main); this.Controls.Add(this.groupControl_Setting); this.MinimumSize = new System.Drawing.Size(719, 303); @@ -978,21 +897,19 @@ ((System.ComponentModel.ISupportInitialize)(this.splitContainerControl_FavoritePurchase)).EndInit(); this.splitContainerControl_FavoritePurchase.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.groupControl_FP_LongDown)).EndInit(); - this.groupControl_FP_LongDown.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.treeList1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.groupControl_FP_ShortUp)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.groupControl_SearcherCondition)).EndInit(); this.groupControl_SearcherCondition.ResumeLayout(false); this.groupControl_SearcherCondition.PerformLayout(); - this.groupBox2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.checkEdit_ichmokuUp_DC.Properties)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.checkEdit_ichmokuDown_DC.Properties)).EndInit(); this.groupBox1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.checkEdit_ichmokuUp_UC.Properties)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.checkEdit_IchmokuDown_UC.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.checkEdit_ichmoku_Long.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.checkEdit_Ichmoku_Short.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.timeSpanEdit_SesstionTime.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.checkedComboBoxEdit_TimeInterval.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.checkedComboBoxEdit_MarketInfoList.Properties)).EndInit(); + this.groupBox2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.checkEdit_yhk_Long.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.checkEdit_yhk_Short.Properties)).EndInit(); this.ResumeLayout(false); } @@ -1047,12 +964,9 @@ private DevExpress.XtraEditors.LabelControl labelControl8; private DevExpress.XtraEditors.LabelControl labelControl7; private DevExpress.XtraEditors.SimpleButton simpleButton_MarketOrderRefresh; - private System.Windows.Forms.GroupBox groupBox2; - private DevExpress.XtraEditors.CheckEdit checkEdit_ichmokuUp_DC; - private DevExpress.XtraEditors.CheckEdit checkEdit_ichmokuDown_DC; private System.Windows.Forms.GroupBox groupBox1; - private DevExpress.XtraEditors.CheckEdit checkEdit_ichmokuUp_UC; - private DevExpress.XtraEditors.CheckEdit checkEdit_IchmokuDown_UC; + private DevExpress.XtraEditors.CheckEdit checkEdit_ichmoku_Long; + private DevExpress.XtraEditors.CheckEdit checkEdit_Ichmoku_Short; private DevExpress.XtraTreeList.Columns.TreeListColumn treeListColumn_SignalStart; private DevExpress.XtraTreeList.TreeList treeList_ShortDown; private DevExpress.XtraTreeList.Columns.TreeListColumn treeListColumn_SD_SignalStart; @@ -1062,15 +976,10 @@ private DevExpress.XtraTreeList.Columns.TreeListColumn treeListColumn_SD_Rate; private DevExpress.XtraTreeList.Columns.TreeListColumn treeListColumn_SD_IndicatorPrice; private DevExpress.XtraTreeList.Columns.TreeListColumn treeListColumn_SD_IndicatorRate; - private DevExpress.XtraTreeList.TreeList treeList1; - private DevExpress.XtraTreeList.Columns.TreeListColumn treeListColumn2; - private DevExpress.XtraTreeList.Columns.TreeListColumn treeListColumn3; - private DevExpress.XtraTreeList.Columns.TreeListColumn treeListColumn4; - private DevExpress.XtraTreeList.Columns.TreeListColumn treeListColumn5; - private DevExpress.XtraTreeList.Columns.TreeListColumn treeListColumn6; - private DevExpress.XtraTreeList.Columns.TreeListColumn treeListColumn7; - private DevExpress.XtraTreeList.Columns.TreeListColumn treeListColumn8; private DevExpress.XtraEditors.SimpleButton simpleButton_SignalStart; + private System.Windows.Forms.GroupBox groupBox2; + private DevExpress.XtraEditors.CheckEdit checkEdit_yhk_Long; + private DevExpress.XtraEditors.CheckEdit checkEdit_yhk_Short; } } diff --git a/BitgetApi/MainForm.cs b/BitgetApi/MainForm.cs index eba468b..35b988a 100644 --- a/BitgetApi/MainForm.cs +++ b/BitgetApi/MainForm.cs @@ -32,17 +32,20 @@ namespace BitgetAPI #region 폼 내 사용되는 스레드 // 트리 현황판 업데이트 스레드 (단순 폼 업데이트) - Thread treeListMarketInfoListUpdateTimer = null; - // 웹소켓 스레드 (선택된 종목 개수 만큼 가져오기) - List th_MarketStatusList = null; - // WebSocket 내 스레드 관리 - List webSocketThreadList = new List(); - // 종목별 캔들 데이터 스레드 (사용 안함) - Thread th_MarketCandeData = null; - // 신호검색 스레드 함수 + Thread th_treeListMarketInfoListUpdateTimer = null; + // 신호검색 스레드 Thread th_SignalInfo = null; // 현황판 웹서비스 Ticker 스레드 (한번에 전체 종목 종가 받음) - Thread th_MarketInfoList = null; + Thread th_MarketInfoList_WebService = null; + // 웹소켓 스레드 + Thread th_ticker_Websocket = null; + + + // 스레드 종료 플래그 + bool Is_th_SignalInfo = false; + bool Is_th_webSocketThread = false; + bool Is_th_th_MarketInfoList_WebService = false; + bool Is_th_treeListUpdate = false; // 신호검색 리스트 작성 // 신호 Long 상승 (구매) @@ -102,38 +105,32 @@ namespace BitgetAPI // 웹서비스를 통해 현황판 및 마켓 Ticker 업데이트 private void getMarketInfoList_WebService(ExchangeWebReqType exchangeWebReqType) { - while(true) + Is_th_th_MarketInfoList_WebService = true; + + while (true) { Thread.Sleep(500); + + if (!Is_th_th_MarketInfoList_WebService) break; // 마켓 모든 종목 캔들 정보 Web Service로 가져오기 commonProperty.marketInfoList = (List)BitgetAPI.WebService.WebConnection.SendWebServer(exchangeWebReqType); - // 현황판에 최신 정보 업데이트 하기 - Invoke(new MethodInvoker(delegate () + try { - var scrollPoint = treeList_MarketInfo.TopVisibleNodeIndex; - treeList_MarketInfo.DataSource = commonProperty.marketInfoList; - treeList_MarketInfo.RefreshDataSource(); - treeList_MarketInfo.TopVisibleNodeIndex = scrollPoint; - })); + // 현황판에 최신 정보 업데이트 하기 + Invoke(new MethodInvoker(delegate () + { + var scrollPoint = treeList_MarketInfo.TopVisibleNodeIndex; + treeList_MarketInfo.DataSource = commonProperty.marketInfoList; + treeList_MarketInfo.RefreshDataSource(); + treeList_MarketInfo.TopVisibleNodeIndex = scrollPoint; + + })); + }catch (Exception ex) { } + } } - // 웹소켓 생성 관련 함수 스레드 => Thread - private async void ThreadEventAsync(BitgetWebSocketType bitgetWebSocketType, Dictionary dic) - { - // WebSocket 생성 - WebConnection webConnection = new WebConnection(); - - webConnection.BitGetWebSocektStart(bitgetWebSocketType, dic); - - Invoke(new MethodInvoker(delegate () - { - // WebSocket 내 스레드 관리 - webSocketThreadList.Add(webConnection.th_PingTimer); - })); - } - // 마켓 현황판 업데이트 (1) => Thread // 지표 생성 및 신호 검색 (2) private void TreeListMarketInfoListUpdate( ) @@ -141,22 +138,28 @@ namespace BitgetAPI // 마켓 현황판 업데이트 while(true) { + if (!Is_th_treeListUpdate) break; + Thread.Sleep(300); - Invoke(new MethodInvoker(delegate () + try { - var scrollPoint = treeList_MarketInfo.TopVisibleNodeIndex; - var scrollPoint_LU = treeList_LongUp.TopVisibleNodeIndex; - var scrollPoint_SD = treeList_ShortDown.TopVisibleNodeIndex; + Invoke(new MethodInvoker(delegate () + { + var scrollPoint = treeList_MarketInfo.TopVisibleNodeIndex; + var scrollPoint_LU = treeList_LongUp.TopVisibleNodeIndex; + var scrollPoint_SD = treeList_ShortDown.TopVisibleNodeIndex; - treeList_MarketInfo.RefreshDataSource(); - treeList_LongUp.RefreshDataSource(); - treeList_ShortDown.RefreshDataSource(); + treeList_MarketInfo.RefreshDataSource(); + treeList_LongUp.RefreshDataSource(); + treeList_ShortDown.RefreshDataSource(); - treeList_MarketInfo.TopVisibleNodeIndex = scrollPoint; - treeList_LongUp.TopVisibleNodeIndex = scrollPoint_LU; - treeList_ShortDown.TopVisibleNodeIndex = scrollPoint_SD; - })); + treeList_MarketInfo.TopVisibleNodeIndex = scrollPoint; + treeList_LongUp.TopVisibleNodeIndex = scrollPoint_LU; + treeList_ShortDown.TopVisibleNodeIndex = scrollPoint_SD; + + })); + }catch(Exception ex) { } } } @@ -179,10 +182,11 @@ namespace BitgetAPI var checkedMarkets = checkedComboBoxEdit_MarketInfoList.Properties.Items.GetCheckedValues(); var intervalList = checkedComboBoxEdit_TimeInterval.Properties.Items.GetCheckedValues(); + Is_th_SignalInfo = true; + while (true) { - //if (!xtraTabPage_Searcher.PageEnabled) continue; - + if (!Is_th_SignalInfo) break; //Thread.Sleep(200); var nowTime = DateTime.Now; @@ -203,7 +207,6 @@ namespace BitgetAPI { item.Price = lastCandleData.Close; item.Rate = (lastCandleData.Close / lastCandleData.Open) * 100 - 100; - item.IndicatorPrice = lastCandleData.IchimokData.상한선; item.IndicatorRate = (lastCandleData.Close / item.IndicatorPrice) * 100 - 100; } @@ -223,9 +226,7 @@ namespace BitgetAPI if (lastCandleData.IchimokData != null) { item.Price = lastCandleData.Close; - if (lastCandleData.Open == 0) { } item.Rate = (lastCandleData.Close / lastCandleData.Open) * 100 - 100; - item.IndicatorPrice = lastCandleData.IchimokData.하한선; item.IndicatorRate = (lastCandleData.Close / item.IndicatorPrice) * 100 - 100; } } @@ -259,12 +260,13 @@ namespace BitgetAPI var candleData_전봉 = candleDatas.Find(i => i.Argument == candleDatas_정렬.Last().Argument); ichimokuConditionSetup.calIchimokuData(candleDatas_정렬, candleData_전봉); - - if (candleData_전봉.Open < candleData_전봉.IchimokData.상한선 && candleData.Open > candleData.IchimokData.상한선 && candleData.Low > candleData.IchimokData.상한선) + + if (candleData_전봉.Open < candleData_전봉.IchimokData.상한선 && candleData.Open > candleData.IchimokData.상한선 && candleData.Low > candleData.IchimokData.상한선 + && candleData.Close > candleData.IchimokData.상한선) { var price = candleData.Close; var rate = (candleData.Close / candleData.Open) * 100 - 100; - var indicatorPrice = candleData.IchimokData.상한선; + var indicatorPrice = candleData.Open; var indicatorRate = (candleData.Close / indicatorPrice) * 100 - 100; var signalData = signals_LU.Find(i => i.MarketName.Equals(market)); @@ -285,11 +287,12 @@ namespace BitgetAPI signals_LU.Add(signalInfoData); } } - else if (candleData_전봉.Open > candleData_전봉.IchimokData.하한선 && candleData.Open < candleData.IchimokData.하한선 && candleData.High < candleData.IchimokData.하한선) + else if (candleData_전봉.Open > candleData_전봉.IchimokData.하한선 && candleData.Open < candleData.IchimokData.하한선 && candleData.High < candleData.IchimokData.하한선 + && candleData.Close < candleData.IchimokData.하한선) { var price = candleData.Close; var rate = (candleData.Close / candleData.Open) * 100 - 100; - var indicatorPrice = candleData.IchimokData.하한선; + var indicatorPrice = candleData.Open; var indicatorRate = (candleData.Close / indicatorPrice) * 100 - 100; var signalData = signals_SD.Find(i => i.MarketName.Equals(market)); @@ -481,8 +484,8 @@ namespace BitgetAPI } // 마켓정보(WebService Ticker) => 0.5초당 1번으로 업데이트 하기 (현황판) - th_MarketInfoList = new Thread(() => getMarketInfoList_WebService(exchangeWebReqType)); - th_MarketInfoList.Start(); + th_MarketInfoList_WebService = new Thread(() => getMarketInfoList_WebService(exchangeWebReqType)); + th_MarketInfoList_WebService.Start(); #region 캔들 웹소켓 : 종목 50, 캔들 1 개만 해도 뒤지려고 함 !! (일딴 패스) /* @@ -497,53 +500,50 @@ namespace BitgetAPI #endregion } + private void ticker_WebSocket(List marketList, int count) + { + + } + // 폼 닫기 시 처리 이벤트 private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { - if (th_MarketStatusList != null) + if (th_SignalInfo != null) { - for (var cnt = 0; cnt < th_MarketStatusList.Count; cnt++) - { - if (th_MarketStatusList[cnt] != null && th_MarketStatusList[cnt].ThreadState != ThreadState.Running) - { - th_MarketStatusList[cnt].Abort(); - th_MarketStatusList[cnt] = null; - } - } - } - - if (th_MarketInfoList != null) - { - th_MarketInfoList.Abort(); - th_MarketInfoList = null; - } - - if (treeListMarketInfoListUpdateTimer != null) - { - treeListMarketInfoListUpdateTimer.Abort(); - treeListMarketInfoListUpdateTimer = null; - } - - if (th_MarketCandeData != null) - { - th_MarketCandeData.Abort(); - th_MarketCandeData = null; - } - - if(th_SignalInfo != null) - { - th_SignalInfo.Abort(); + Is_th_SignalInfo = false; + th_SignalInfo.Join(); th_SignalInfo = null; } - for(var cnt = 0; cnt < webSocketThreadList.Count; cnt++) + + if (commonProperty.webConnection != null) { - if(webSocketThreadList[cnt] != null && webSocketThreadList[cnt].ThreadState != ThreadState.Running) + commonProperty.webConnection.Is_th_webSocketThread = false; + commonProperty.webConnection.closeWebSocket(); + } + + if (th_MarketInfoList_WebService != null) + { + Is_th_th_MarketInfoList_WebService = false; + + if (th_MarketInfoList_WebService.ThreadState == ThreadState.Running) { - webSocketThreadList[cnt].Abort(); - webSocketThreadList[cnt] = null; + th_MarketInfoList_WebService.Join(); + th_MarketInfoList_WebService = null; } } + + if (th_treeListMarketInfoListUpdateTimer != null) + { + Is_th_treeListUpdate = false; + + if (th_treeListMarketInfoListUpdateTimer.ThreadState == ThreadState.Running) + { + th_treeListMarketInfoListUpdateTimer.Join(); + th_treeListMarketInfoListUpdateTimer = null; + } + + } } @@ -560,47 +560,38 @@ namespace BitgetAPI // 신호 검색 시작 private void simpleButton_SignalStart_Click(object sender, EventArgs e) - { + { + if(th_SignalInfo != null) + { + Is_th_SignalInfo = false; + if (th_SignalInfo.ThreadState == ThreadState.Running) + th_SignalInfo.Join(); + th_SignalInfo = null; + } - foreach(var candleList in commonProperty.candleDataLists) + if (commonProperty.webConnection != null) + { + commonProperty.webConnection.Is_th_webSocketThread = false; + commonProperty.webConnection.closeWebSocket(); + } + + if(th_treeListMarketInfoListUpdateTimer != null) + { + Is_th_treeListUpdate = false; + + if (th_treeListMarketInfoListUpdateTimer.ThreadState == ThreadState.Running) + { + th_treeListMarketInfoListUpdateTimer.Join(); + th_treeListMarketInfoListUpdateTimer = null; + } + + } + + foreach (var candleList in commonProperty.candleDataLists) { foreach (var interval in candleList.candleDataList) interval.Value.Clear(); } - - - if(th_SignalInfo != null) - { - if (th_SignalInfo.ThreadState == ThreadState.Running) - th_SignalInfo.Abort(); - th_SignalInfo = null; - } - - if (th_MarketCandeData != null) - { - if (th_MarketCandeData.ThreadState == ThreadState.Running) - th_MarketCandeData.Abort(); - th_MarketCandeData = null; - } - if(treeListMarketInfoListUpdateTimer != null) - { - if (treeListMarketInfoListUpdateTimer.ThreadState == ThreadState.Running) - treeListMarketInfoListUpdateTimer.Abort(); - treeListMarketInfoListUpdateTimer = null; - } - if (th_MarketStatusList != null) - { - for (var cnt = 0; cnt < th_MarketStatusList.Count; cnt++) - { - if (th_MarketStatusList[cnt] != null && th_MarketStatusList[cnt].ThreadState != ThreadState.Running) - { - th_MarketStatusList[cnt].Abort(); - th_MarketStatusList[cnt] = null; - } - } - } - - Thread.Sleep(1000); var count = 0; @@ -617,7 +608,6 @@ namespace BitgetAPI marketList = checkedComboBoxEdit_MarketInfoList.Properties.Items.GetCheckedValues(); } - th_MarketStatusList = new List(); var dic = new Dictionary(); dic.Add("op", "subscribe"); @@ -640,20 +630,26 @@ namespace BitgetAPI dic.Add("args", argsList); // 웹소켓으로 캔들 쌓기 - var th_MarketStatus = new Thread(() => ThreadEventAsync(BitgetWebSocketType.현황정보_전체종목, dic)); - th_MarketStatus.Start(); - th_MarketStatusList.Add(th_MarketStatus); + // WebSocket 생성 + WebConnection webConnection = new WebConnection(); + commonProperty.webConnection = webConnection; + webConnection.Is_th_webSocketThread = true; + webConnection.BitGetWebSocektStart(BitgetWebSocketType.현황정보_전체종목, dic); + + + //th_webSocketThread = new Thread(() => TheadWebSocketRecieve(BitgetWebSocketType.현황정보_전체종목, dic)); + //th_webSocketThread.Start(); // WebServicee 초기 캔들 데이터 가져오기 : 종목, 개수 // 종목별 캔들 데이터 가져오기 (WebService) // 선택된 타입에 따라서 종목 정보 가져오기 var exchangeWebReqType = ExchangeWebReqType.BitgetMarket_Future; - th_MarketCandeData = new Thread(() => getMarketCandleData_WebService(exchangeWebReqType, marketList)); - th_MarketCandeData.Start(); + th_MarketInfoList_WebService = new Thread(() => getMarketCandleData_WebService(exchangeWebReqType, marketList)); + th_MarketInfoList_WebService.Start(); // 트리 현황판 업데이트 - treeListMarketInfoListUpdateTimer = new Thread(new ThreadStart(TreeListMarketInfoListUpdate)); - treeListMarketInfoListUpdateTimer.Start(); + th_treeListMarketInfoListUpdateTimer = new Thread(new ThreadStart(TreeListMarketInfoListUpdate)); + th_treeListMarketInfoListUpdateTimer.Start(); } } } diff --git a/BitgetApi/MainForm.resx b/BitgetApi/MainForm.resx index 329ebd9..50552c3 100644 --- a/BitgetApi/MainForm.resx +++ b/BitgetApi/MainForm.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIzLjIsIFZlcnNpb249MjMuMi40 LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl diff --git a/BitgetApi/WebService/WebConnection.cs b/BitgetApi/WebService/WebConnection.cs index e9cea48..83826c4 100644 --- a/BitgetApi/WebService/WebConnection.cs +++ b/BitgetApi/WebService/WebConnection.cs @@ -23,6 +23,8 @@ namespace BitgetAPI.WebService public class WebConnection { public Thread th_PingTimer {get; set;} = null; + public bool Is_th_webSocketThread { get; set; } = false; + public ClientWebSocket webSocket { get; set; } = null; public static object SendWebServer(CommonProperty.ExchangeWebReqType exchangeWebReqType, string url = "", MarketCandleDataList marketCandleDataList = null, CommonProperty.MCandleTimeType interval = MCandleTimeType.M1, @@ -279,7 +281,7 @@ namespace BitgetAPI.WebService CommonProperty commonProperty = CommonProperty.Instance; - ClientWebSocket webSocket = new ClientWebSocket(); + webSocket = new ClientWebSocket(); string WebSocketUrl = "wss://ws.bitget.com/v2/ws/public"; string message = ""; @@ -304,6 +306,7 @@ namespace BitgetAPI.WebService // 데이터 수신을 위한 반복문 시작 while (webSocket.State == WebSocketState.Open) { + //Thread.Sleep(100); byte[] buffer = new byte[1024]; @@ -371,6 +374,7 @@ namespace BitgetAPI.WebService // 마지막 시간 데이터 가져오기 var lastCandleData = lastCandleData_Edit.Find(j=>j.Argument == lastCandleData_Edit.Max(i => i.Argument)); + if (lastCandleData == null) return; // 업데이트 or 추가 bool updateFlag = true; @@ -573,15 +577,37 @@ namespace BitgetAPI.WebService } finally { - //if (webSocket.State == WebSocketState.Open) - //await webSocket.CloseAsync(WebSocketCloseStatus.NormalClosure, "WebSocket 연결 종료", CancellationToken.None); - webSocket.Dispose(); + closeWebSocket(); // 웹소켓 재귀 - BitGetWebSocektStart(bitgetWebSocketType, dic); + if (Is_th_webSocketThread) + { + BitGetWebSocektStart(bitgetWebSocketType, dic); + } } } + // 웹소켓 종료 + public async void closeWebSocket() + { + if (webSocket != null) + { + if (webSocket.State == WebSocketState.Open) + { + if (th_PingTimer != null) + { + th_PingTimer.Abort(); + th_PingTimer = null; + } + + await webSocket.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "WebSocket 연결 종료", CancellationToken.None); + } + + webSocket.Dispose(); + } + + } + // Ping 테스트 (25초), 30초에 한번 응답 확인 필요 public static async void ContinuePing(ClientWebSocket webSocket) {