병합 수정 중
This commit is contained in:
@@ -103,23 +103,31 @@ namespace Million_Hunter.HunterSubForm
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "데이터 채우기";
|
||||
//
|
||||
// simpleButton_Reset
|
||||
// simpleButton_찬
|
||||
//
|
||||
this.simpleButton_Reset.Appearance.ForeColor = System.Drawing.Color.SteelBlue;
|
||||
this.simpleButton_Reset.Appearance.Options.UseForeColor = true;
|
||||
this.simpleButton_Reset.Location = new System.Drawing.Point(6, 21);
|
||||
this.simpleButton_Reset.Name = "simpleButton_Reset";
|
||||
this.simpleButton_Reset.Size = new System.Drawing.Size(121, 32);
|
||||
this.simpleButton_Reset.TabIndex = 1;
|
||||
this.simpleButton_Reset.Text = "필터 초기화";
|
||||
this.simpleButton_Reset.Click += new System.EventHandler(this.simpleButton_Reset_Click);
|
||||
this.simpleButton_찬.Location = new System.Drawing.Point(18, 225);
|
||||
this.simpleButton_찬.Name = "simpleButton_찬";
|
||||
this.simpleButton_찬.Size = new System.Drawing.Size(104, 32);
|
||||
this.simpleButton_찬.TabIndex = 4;
|
||||
this.simpleButton_찬.Text = "찬테스트";
|
||||
this.simpleButton_찬.Click += new System.EventHandler(this.simpleButton_찬_Click);
|
||||
//
|
||||
// progressBar1
|
||||
//
|
||||
this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.progressBar1.Location = new System.Drawing.Point(0, 275);
|
||||
this.progressBar1.Name = "progressBar1";
|
||||
this.progressBar1.Size = new System.Drawing.Size(852, 23);
|
||||
this.progressBar1.TabIndex = 5;
|
||||
//
|
||||
// TestBoardForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(853, 297);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.progressBar1);
|
||||
this.Controls.Add(this.simpleButton_찬);
|
||||
this.Controls.Add(this.simpleButton_Calc);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Name = "TestBoardForm";
|
||||
@@ -138,6 +146,10 @@ namespace Million_Hunter.HunterSubForm
|
||||
private DevExpress.XtraEditors.SimpleButton simpleButton_FullInsertCandle;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.CheckedListBox checkedListBox_Indicator;
|
||||
private DevExpress.XtraEditors.SimpleButton simpleButton_Calc;
|
||||
private DevExpress.XtraEditors.SimpleButton simpleButton_찬;
|
||||
private System.Windows.Forms.ProgressBar progressBar1;
|
||||
private DevExpress.XtraEditors.CheckEdit checkEdit_이전봉40_2볼린저이하;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private DevExpress.XtraEditors.SimpleButton simpleButton_Reset;
|
||||
|
||||
@@ -333,5 +333,9 @@ namespace Million_Hunter.HunterSubForm
|
||||
}
|
||||
}
|
||||
|
||||
private void simpleButton_찬_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -153,7 +153,6 @@
|
||||
<EmbeddedResource Include="HunterSubForm\TestBoardForm.resx">
|
||||
<DependentUpon>TestBoardForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\licenses.licx" />
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace Million
|
||||
단순비교 = 0,
|
||||
돌파비교 = 1,
|
||||
최초돌파 = 2,
|
||||
크로스 = 3
|
||||
크로스 = 3
|
||||
}
|
||||
|
||||
// 시가/고가/종가/저가
|
||||
@@ -159,7 +159,8 @@ namespace Million
|
||||
이동평균선 = 3,
|
||||
ParabolicSAR = 4,
|
||||
거래량비율 = 5,
|
||||
가격비율 = 6
|
||||
가격비율 = 6,
|
||||
조건단순비교 =7
|
||||
}
|
||||
|
||||
// 이동평균선 종류
|
||||
@@ -367,5 +368,15 @@ namespace Million
|
||||
/// </summary>
|
||||
public static Dictionary<string, Dictionary<string, bool>> subIndicatorStateManagement = new Dictionary<string, Dictionary<string, bool>>();
|
||||
#endregion
|
||||
|
||||
#region Compare 조건문 Flag
|
||||
public enum CompareType
|
||||
{
|
||||
Origin_Up_Compare_Down = 0,
|
||||
Origin_UpOrSame_Compare_Down = 1,
|
||||
Origin_Down_Compare_Up = 2,
|
||||
Origin_DownOrSame_Compare_Up = 3
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
68
Million/IndicatorConditionSetup/CompareConditionSetup.cs
Normal file
68
Million/IndicatorConditionSetup/CompareConditionSetup.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static Million.CommonProperty;
|
||||
|
||||
namespace Million.IndicatorConditionSetup
|
||||
{
|
||||
/// <summary>
|
||||
/// Compare 조건식
|
||||
/// </summary>
|
||||
public class CompareConditionSetup : IndicatorCoditionSetup
|
||||
{
|
||||
/// <summary>
|
||||
/// 기본 데이터
|
||||
/// </summary>
|
||||
public string Origin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 조건 데이터
|
||||
/// </summary>
|
||||
public string Compare { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Compare 할 값
|
||||
/// </summary>
|
||||
public CompareType CompareType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Clone
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public object Clone()
|
||||
{
|
||||
var clone = new CompareConditionSetup
|
||||
{
|
||||
CandlePriceTypeFirstOver = CandlePriceTypeFirstOver,
|
||||
OverStatusEnumListFirstOver = OverStatusEnumListFirstOver,
|
||||
FirstOverSubRegExpression = FirstOverSubRegExpression,
|
||||
CrossSubRegExpression = CrossSubRegExpression,
|
||||
CrossCandlePriceType = CrossCandlePriceType,
|
||||
CrossType = CrossType,
|
||||
ByBuySellType = ByBuySellType,
|
||||
IndicatorType = IndicatorType,
|
||||
SubIndicatorSetupType = SubIndicatorSetupType,
|
||||
CandlePriceType = CandlePriceType,
|
||||
IndicatorOver = IndicatorOver,
|
||||
OverStatusEnumList = OverStatusEnumList,
|
||||
MCandleTimeType = MCandleTimeType,
|
||||
Description = Description,
|
||||
IndexString = IndexString,
|
||||
Origin = Origin,
|
||||
Compare = Compare,
|
||||
CompareType = CompareType
|
||||
};
|
||||
return clone;
|
||||
}
|
||||
|
||||
public override string GetKeyName(bool IndexStr = false)
|
||||
{
|
||||
var key = "Compare" + Origin + Compare;
|
||||
if (IndexStr)
|
||||
return IndexString + key;
|
||||
return key;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,9 +72,6 @@ namespace Million.IndicatorConditionSetup
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (obj.GetType() == typeof(BolingerConditionSetup))
|
||||
{
|
||||
var thisBol = (BolingerConditionSetup)this;
|
||||
@@ -103,6 +100,14 @@ namespace Million.IndicatorConditionSetup
|
||||
thisMov.MACandlePriceType == objMov.MACandlePriceType &&
|
||||
thisMov.MovingAverageType == objMov.MovingAverageType;
|
||||
}
|
||||
else if (obj.GetType() == typeof(CompareConditionSetup)) {
|
||||
var objCompare = (CompareConditionSetup)obj;
|
||||
var thisCompare = (CompareConditionSetup)this;
|
||||
return objCompare.Origin == thisCompare.Origin &&
|
||||
objCompare.Compare == thisCompare.Compare &&
|
||||
objCompare.CompareType == thisCompare.CompareType;
|
||||
}
|
||||
|
||||
|
||||
return base.Equals(obj);
|
||||
}
|
||||
|
||||
@@ -345,6 +345,11 @@ namespace Million.Manager
|
||||
RateValue(setUp, parentCandleDataList, childrenCandleDataList, buyData);
|
||||
}
|
||||
}
|
||||
//조건 단순비교
|
||||
else if (setUp.IndicatorType == IndicatorType.조건단순비교)
|
||||
{
|
||||
CompareSimpleComparison(setUp, totalIndicator, parentCandleDataList, childrenCandleDataList);
|
||||
}
|
||||
//돌파
|
||||
else if (setUp.SubIndicatorSetupType == SubIndicatorSetupType.돌파비교)
|
||||
{
|
||||
@@ -367,6 +372,99 @@ namespace Million.Manager
|
||||
for (var i = 0; i < 3; i++)
|
||||
CrossCondition(setUp, parentCandleDataList, childrenCandleDataList, subIndicator, i);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 조건 단순 비교
|
||||
/// </summary>
|
||||
/// <param name="setUp"></param>
|
||||
/// <param name="totalIndicator"></param>
|
||||
/// <param name="parentCandleDataList"></param>
|
||||
/// <param name="childrenCandleDataList"></param>
|
||||
private static void CompareSimpleComparison(IndicatorCoditionSetup setUp, List<IndicatorCoditionSetup> totalIndicator, List<CandleData> parentCandleDataList, List<CandleData> childrenCandleDataList)
|
||||
{
|
||||
//TODO 추후 Value 가 필요할 수 도 있으나 현재는 필요없어서 안씀
|
||||
|
||||
var cSetup = (CompareConditionSetup)setUp;
|
||||
|
||||
var key = GetKeyData(cSetup);
|
||||
|
||||
var originSetup = totalIndicator.FirstOrDefault(t => t.IndexString == cSetup.Origin);
|
||||
var originKey = GetKeyData(originSetup);
|
||||
var originVal = 0.0;
|
||||
|
||||
var compareSetup = totalIndicator.FirstOrDefault(t => t.IndexString == cSetup.Compare);
|
||||
var compareKey = GetKeyData(compareSetup);
|
||||
var compareVal = 0.0;
|
||||
|
||||
foreach (var parent in parentCandleDataList)
|
||||
{
|
||||
if (!(parent.IndicatorDic.ContainsKey(originKey) && parent.IndicatorDic.ContainsKey(compareKey)))
|
||||
continue;
|
||||
|
||||
var originValueList = new List<double>();
|
||||
var compareValueList = new List<double>();
|
||||
|
||||
originValueList.Add(parent.IndicatorDic[originKey].value);
|
||||
compareValueList.Add(parent.IndicatorDic[compareKey].value);
|
||||
|
||||
if (originSetup.CandlePriceType == CandlePriceType.종가)
|
||||
{
|
||||
originValueList.Add(parent.IndicatorDic[originKey].highValue);
|
||||
originValueList.Add(parent.IndicatorDic[originKey].lowValue);
|
||||
}
|
||||
if (compareSetup.CandlePriceType == CandlePriceType.종가)
|
||||
{
|
||||
compareValueList.Add(parent.IndicatorDic[compareKey].highValue);
|
||||
compareValueList.Add(parent.IndicatorDic[compareKey].lowValue);
|
||||
}
|
||||
|
||||
var cnt = originValueList.Count >= compareValueList.Count ? originValueList.Count : compareValueList.Count;
|
||||
|
||||
for (var i = 0; i < cnt; i++)
|
||||
{
|
||||
if (parent.CalculateFlag[cSetup.IndexString]) break;
|
||||
|
||||
if (originValueList.Count < i)
|
||||
{
|
||||
originVal = originValueList[originValueList.Count - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
originVal = originValueList[i];
|
||||
}
|
||||
|
||||
if (compareValueList.Count < i)
|
||||
{
|
||||
compareVal = compareValueList[compareValueList.Count - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
compareVal = compareValueList[i];
|
||||
}
|
||||
|
||||
if ((cSetup.CompareType == CompareType.Origin_Up_Compare_Down && originVal > compareVal) ||
|
||||
(cSetup.CompareType == CompareType.Origin_UpOrSame_Compare_Down && originVal >= compareVal) ||
|
||||
(cSetup.CompareType == CompareType.Origin_Down_Compare_Up && originVal < compareVal) ||
|
||||
(cSetup.CompareType == CompareType.Origin_DownOrSame_Compare_Up && originVal <= compareVal))
|
||||
{
|
||||
parent.CalculateFlag[cSetup.IndexString] = true;
|
||||
|
||||
parent.IndicatorDic[key] = new IndicatorData();
|
||||
parent.IndicatorDic[key].value = parent.EndValue;
|
||||
|
||||
var childList = GetChildrenDatas(parent, cSetup.MCandleTimeType, childrenCandleDataList);
|
||||
|
||||
foreach (var item in childList)
|
||||
{
|
||||
item.CalculateFlag[cSetup.IndexString] = true;
|
||||
item.IndicatorDic[key] = new IndicatorData();
|
||||
item.IndicatorDic[key].value = item.EndValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -491,7 +589,7 @@ namespace Million.Manager
|
||||
if (string.IsNullOrWhiteSpace(setUp.CrossSubRegExpression))
|
||||
{
|
||||
foreach (var item in childrenCandleDataList)
|
||||
item.CalculateFlag[key] = false;
|
||||
item.CalculateFlag[setUp.IndexString] = false;
|
||||
return;
|
||||
}
|
||||
var subSetup = subIndicatorList.FirstOrDefault(t => t.IndexString == setUp.CrossSubRegExpression);
|
||||
|
||||
@@ -126,14 +126,24 @@ namespace Million.Manager
|
||||
{
|
||||
// 최초와 cross의 조건먼저 계산이 필요함(선처리)
|
||||
var parentIndicator = totalIndicator.Where(t => t.SubIndicatorSetupType == CommonProperty.SubIndicatorSetupType.최초돌파 ||
|
||||
t.SubIndicatorSetupType == CommonProperty.SubIndicatorSetupType.크로스).ToList();
|
||||
t.SubIndicatorSetupType == CommonProperty.SubIndicatorSetupType.크로스 || t.IndicatorType == IndicatorType.조건단순비교).ToList();
|
||||
|
||||
var subIndStringiList = new List<string>();
|
||||
foreach (var item in parentIndicator)
|
||||
{
|
||||
var subRegExpression = item.FirstOverSubRegExpression;
|
||||
if (item.SubIndicatorSetupType == CommonProperty.SubIndicatorSetupType.크로스)
|
||||
var subRegExpression = "";
|
||||
if (item.IndicatorType == CommonProperty.IndicatorType.조건단순비교)
|
||||
{
|
||||
subRegExpression = ((CompareConditionSetup)item).Origin + "," + ((CompareConditionSetup)item).Compare;
|
||||
}
|
||||
else if (item.SubIndicatorSetupType == CommonProperty.SubIndicatorSetupType.크로스)
|
||||
{
|
||||
subRegExpression = item.CrossSubRegExpression;
|
||||
}
|
||||
else
|
||||
{
|
||||
subRegExpression = item.FirstOverSubRegExpression;
|
||||
}
|
||||
subIndStringiList.AddRange(subRegExpression.Split(',').ToList());
|
||||
}
|
||||
subIndStringiList = subIndStringiList.Distinct().ToList();
|
||||
|
||||
@@ -35,10 +35,12 @@ namespace Million.Manager
|
||||
else if (setup.GetType() == typeof(PriceRateCondtionSetup))
|
||||
{
|
||||
indicatorList.Add((PriceRateCondtionSetup)setup);
|
||||
}else if(setup.GetType() == typeof(CompareConditionSetup))
|
||||
{
|
||||
indicatorList.Add((CompareConditionSetup)setup);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return indicatorList;
|
||||
}
|
||||
|
||||
|
||||
@@ -179,6 +179,7 @@
|
||||
<Compile Include="FileManagement\FileContoler.cs" />
|
||||
<Compile Include="FileManagement\Ini.cs" />
|
||||
<Compile Include="IndicatorConditionSetup\BolingerConditionSetup.cs" />
|
||||
<Compile Include="IndicatorConditionSetup\CompareConditionSetup.cs" />
|
||||
<Compile Include="IndicatorConditionSetup\IchimokuConditionSetup.cs" />
|
||||
<Compile Include="IndicatorConditionSetup\IndicatorCoditionSetup.cs" />
|
||||
<Compile Include="IndicatorConditionSetup\MovingAverageConditionSetup.cs" />
|
||||
@@ -261,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>
|
||||
@@ -325,6 +332,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>
|
||||
|
||||
@@ -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 폼 추가
|
||||
@@ -307,7 +317,7 @@ namespace Million.HunterSubForm.IndicatorSetupForm
|
||||
case CommonProperty.SubIndicatorSetupType.크로스:
|
||||
_indicatorSetupData.Description +=
|
||||
$",크로스[{_indicatorSetupData.CrossType},정규식({_indicatorSetupData.CrossSubRegExpression})]";
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,7 +339,10 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
133
Million/SubForm/IndicatorSetupForm/CompareSetupUserForm.Designer.cs
generated
Normal file
133
Million/SubForm/IndicatorSetupForm/CompareSetupUserForm.Designer.cs
generated
Normal 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;
|
||||
}
|
||||
}
|
||||
61
Million/SubForm/IndicatorSetupForm/CompareSetupUserForm.cs
Normal file
61
Million/SubForm/IndicatorSetupForm/CompareSetupUserForm.cs
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
120
Million/SubForm/IndicatorSetupForm/CompareSetupUserForm.resx
Normal file
120
Million/SubForm/IndicatorSetupForm/CompareSetupUserForm.resx
Normal 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>
|
||||
Reference in New Issue
Block a user