조건단순비교 추가

This commit is contained in:
kyh
2023-05-09 13:22:20 +09:00
parent 00e19d9c61
commit 22fbf2e5b5
8 changed files with 351 additions and 6 deletions

View File

@@ -122,7 +122,7 @@ namespace Million
돌파비교 = 1,
최초돌파 = 2,
크로스 = 3,
조건간단순비교 = 4
조건단순비교 = 4
}
// 시가/고가/종가/저가
@@ -160,7 +160,8 @@ namespace Million
이동평균선 = 3,
ParabolicSAR = 4,
거래량비율 = 5,
가격비율 = 6
가격비율 = 6,
조건단순비교 =7
}
// 이동평균선 종류
@@ -373,7 +374,9 @@ namespace Million
public enum CompareType
{
Origin_Up_Compare_Down = 0,
Origin_Down_Compare_Up = 1
Origin_UpOrSame_Compare_Down = 1,
Origin_Down_Compare_Up = 2,
Origin_DownOrSame_Compare_Up = 3
}
#endregion
}

View File

@@ -367,7 +367,8 @@ namespace Million.Manager
for (var i = 0; i < 3; i++)
CrossCondition(setUp, parentCandleDataList, childrenCandleDataList, subIndicator, i);
}
else if(setUp.SubIndicatorSetupType == SubIndicatorSetupType.조건간단순비교)
//조건 단순비교
else if(setUp.SubIndicatorSetupType == SubIndicatorSetupType.조건단순비교)
{
}

View File

@@ -126,13 +126,13 @@ namespace Million.Manager
{
// 최초와 cross의 조건먼저 계산이 필요함(선처리)
var parentIndicator = totalIndicator.Where(t => t.SubIndicatorSetupType == CommonProperty.SubIndicatorSetupType.최초돌파 ||
t.SubIndicatorSetupType == CommonProperty.SubIndicatorSetupType.크로스 || t.SubIndicatorSetupType == SubIndicatorSetupType.조건간단순비교).ToList();
t.SubIndicatorSetupType == CommonProperty.SubIndicatorSetupType.크로스 || t.SubIndicatorSetupType == SubIndicatorSetupType.조건단순비교).ToList();
var subIndStringiList = new List<string>();
foreach (var item in parentIndicator)
{
var subRegExpression = "";
if (item.SubIndicatorSetupType == CommonProperty.SubIndicatorSetupType.조건간단순비교)
if (item.SubIndicatorSetupType == CommonProperty.SubIndicatorSetupType.조건단순비교)
{
subRegExpression = ((CompareConditionSetup)item).Origin + "," + ((CompareConditionSetup)item).Compare;
}

View File

@@ -262,6 +262,12 @@
<Compile Include="SubForm\IndicatorSetupForm\MovingAverageSetupUserForm.Designer.cs">
<DependentUpon>MovingAverageSetupUserForm.cs</DependentUpon>
</Compile>
<Compile Include="SubForm\IndicatorSetupForm\CompareSetupUserForm.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="SubForm\IndicatorSetupForm\CompareSetupUserForm.Designer.cs">
<DependentUpon>CompareSetupUserForm.cs</DependentUpon>
</Compile>
<Compile Include="SubForm\IndicatorSetupForm\ParabolicSarSetupUserForm.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -320,6 +326,9 @@
<EmbeddedResource Include="SubForm\IndicatorSetupForm\MovingAverageSetupUserForm.resx">
<DependentUpon>MovingAverageSetupUserForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SubForm\IndicatorSetupForm\CompareSetupUserForm.resx">
<DependentUpon>CompareSetupUserForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SubForm\IndicatorSetupForm\ParabolicSarSetupUserForm.resx">
<DependentUpon>ParabolicSarSetupUserForm.cs</DependentUpon>
</EmbeddedResource>

View File

@@ -96,6 +96,9 @@ namespace Million.HunterSubForm.IndicatorSetupForm
case CommonProperty.IndicatorType.ParabolicSAR:
_indicatorSetupData = new ParabolicSarIndicatorConditionSetup();
break;
case CommonProperty.IndicatorType.조건단순비교:
_indicatorSetupData = new CompareConditionSetup();
break;
}
// Over Status (중복선택 가능, Over, OverCancle 설정)
@@ -198,6 +201,13 @@ namespace Million.HunterSubForm.IndicatorSetupForm
_curruentIndicatorSpecSetupform = new ParabolicSarSetupUserForm(_indicatorSetupData, _isCreate)
{ Dock = DockStyle.Fill };
break;
case CommonProperty.IndicatorType.조건단순비교:
_curruentIndicatorSpecSetupform = new CompareSetupUserForm(_indicatorSetupData, _isCreate)
{ Dock = DockStyle.Fill };
comboBoxEdit_CandleDateTime.Enabled = false;
xtraTabControl_SubIndicatorSetup.Enabled = false;
break;
}
// 그룹박스에 Sepc Indicator Setup 폼 추가
@@ -308,6 +318,11 @@ namespace Million.HunterSubForm.IndicatorSetupForm
_indicatorSetupData.Description +=
$",크로스[{_indicatorSetupData.CrossType},정규식({_indicatorSetupData.CrossSubRegExpression})]";
break;
case CommonProperty.SubIndicatorSetupType.조건단순비교:
_indicatorSetupData.Description +=
$",조건단순비교";
break;
}
}
@@ -329,6 +344,9 @@ namespace Million.HunterSubForm.IndicatorSetupForm
case CommonProperty.IndicatorType.ParabolicSAR:
((ParabolicSarSetupUserForm)_curruentIndicatorSpecSetupform).SaveIndicatorSetup(_indicatorSetupData);
return ((ParabolicSarIndicatorConditionSetup)_indicatorSetupData).Clone();
case CommonProperty.IndicatorType.조건단순비교:
((CompareSetupUserForm)_curruentIndicatorSpecSetupform).SaveIndicatorSetup(_indicatorSetupData);
return ((CompareConditionSetup)_indicatorSetupData).Clone();
}
return _indicatorSetupData;
}

View File

@@ -0,0 +1,133 @@
namespace Million.HunterSubForm.IndicatorSetupForm
{
partial class CompareSetupUserForm
{
/// <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 Component 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.te_Origin = new DevExpress.XtraEditors.TextEdit();
this.labelControl_IndicatorName = new DevExpress.XtraEditors.LabelControl();
this.labelControl3 = new DevExpress.XtraEditors.LabelControl();
this.te_Compare = new DevExpress.XtraEditors.TextEdit();
this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
this.cb_Type = new DevExpress.XtraEditors.ComboBoxEdit();
this.labelControl2 = new DevExpress.XtraEditors.LabelControl();
((System.ComponentModel.ISupportInitialize)(this.te_Origin.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.te_Compare.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cb_Type.Properties)).BeginInit();
this.SuspendLayout();
//
// te_Origin
//
this.te_Origin.Location = new System.Drawing.Point(83, 20);
this.te_Origin.Name = "te_Origin";
this.te_Origin.Properties.Mask.EditMask = "d";
this.te_Origin.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
this.te_Origin.Size = new System.Drawing.Size(91, 20);
this.te_Origin.TabIndex = 3;
//
// labelControl_IndicatorName
//
this.labelControl_IndicatorName.Location = new System.Drawing.Point(3, 3);
this.labelControl_IndicatorName.Name = "labelControl_IndicatorName";
this.labelControl_IndicatorName.Size = new System.Drawing.Size(20, 14);
this.labelControl_IndicatorName.TabIndex = 9;
this.labelControl_IndicatorName.Text = "지표";
//
// labelControl3
//
this.labelControl3.Location = new System.Drawing.Point(28, 23);
this.labelControl3.Name = "labelControl3";
this.labelControl3.Size = new System.Drawing.Size(49, 14);
this.labelControl3.TabIndex = 2;
this.labelControl3.Text = "Origin(A)";
//
// te_Compare
//
this.te_Compare.Location = new System.Drawing.Point(83, 46);
this.te_Compare.Name = "te_Compare";
this.te_Compare.Properties.Mask.EditMask = "d";
this.te_Compare.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
this.te_Compare.Size = new System.Drawing.Size(91, 20);
this.te_Compare.TabIndex = 11;
//
// labelControl1
//
this.labelControl1.Location = new System.Drawing.Point(12, 49);
this.labelControl1.Name = "labelControl1";
this.labelControl1.Size = new System.Drawing.Size(65, 14);
this.labelControl1.TabIndex = 10;
this.labelControl1.Text = "Compare(B)";
//
// cb_Type
//
this.cb_Type.Location = new System.Drawing.Point(83, 72);
this.cb_Type.Name = "cb_Type";
this.cb_Type.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
this.cb_Type.Size = new System.Drawing.Size(91, 20);
this.cb_Type.TabIndex = 19;
//
// labelControl2
//
this.labelControl2.Location = new System.Drawing.Point(49, 75);
this.labelControl2.Name = "labelControl2";
this.labelControl2.Size = new System.Drawing.Size(28, 14);
this.labelControl2.TabIndex = 20;
this.labelControl2.Text = "Type";
//
// CompareSetupUserForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.labelControl2);
this.Controls.Add(this.cb_Type);
this.Controls.Add(this.te_Compare);
this.Controls.Add(this.labelControl1);
this.Controls.Add(this.labelControl_IndicatorName);
this.Controls.Add(this.te_Origin);
this.Controls.Add(this.labelControl3);
this.Name = "CompareSetupUserForm";
this.Size = new System.Drawing.Size(196, 111);
((System.ComponentModel.ISupportInitialize)(this.te_Origin.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.te_Compare.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cb_Type.Properties)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private DevExpress.XtraEditors.TextEdit te_Origin;
private DevExpress.XtraEditors.LabelControl labelControl_IndicatorName;
private DevExpress.XtraEditors.LabelControl labelControl3;
private DevExpress.XtraEditors.TextEdit te_Compare;
private DevExpress.XtraEditors.LabelControl labelControl1;
private DevExpress.XtraEditors.ComboBoxEdit cb_Type;
private DevExpress.XtraEditors.LabelControl labelControl2;
}
}

View File

@@ -0,0 +1,61 @@
using DevExpress.XtraEditors;
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;
using Million;
using Million.IndicatorConditionSetup;
namespace Million.HunterSubForm.IndicatorSetupForm
{
public partial class CompareSetupUserForm : DevExpress.XtraEditors.XtraUserControl
{
private CompareConditionSetup _compareConditionSetup;
private bool _isCreate = false;
public CompareSetupUserForm(object compareConditionSetup, bool IsCreate)
{
InitializeComponent();
_compareConditionSetup = (CompareConditionSetup)compareConditionSetup;
_isCreate = IsCreate;
InitForm();
}
private void InitForm()
{
labelControl_IndicatorName.Text = @"조건단순비교";
cb_Type.Properties.Items.AddRange(Enum.GetNames(enumType: typeof(CommonProperty.CompareType)));
}
// Indicator 정보 저장
public void SaveIndicatorSetup(object indicatorSetupData)
{
// 예외처리 필요
var compareConditionSetup = (CompareConditionSetup) indicatorSetupData;
//지표 설정
compareConditionSetup.IndicatorType = CommonProperty.IndicatorType.조건단순비교;
compareConditionSetup.Origin = te_Origin.Text;
compareConditionSetup.Compare = te_Compare.Text;
Enum.TryParse(cb_Type.SelectedItem.ToString(),
out CommonProperty.CompareType type);
compareConditionSetup.CompareType = type;
var description =
$"[{compareConditionSetup.Origin}," +
$"{compareConditionSetup.Compare}," +
$"{compareConditionSetup.CompareType}]";
compareConditionSetup.Description = description + compareConditionSetup.Description;
}
}
}

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>