CalCulate Class 구현 중
This commit is contained in:
@@ -300,6 +300,7 @@ namespace Million_Hunter
|
||||
totalIndicator.AddRange(sellIndicatorList);
|
||||
|
||||
var candleTypeList = totalIndicator.Select(t => t.MCandleTimeType).ToList();
|
||||
candleTypeList.Add(CommonProperty.MCandleTimeType.M1);
|
||||
candleTypeList = candleTypeList.Distinct().ToList();
|
||||
|
||||
var tableList = CommonProperty.selectedMarketOfPlaceList;
|
||||
@@ -309,20 +310,26 @@ namespace Million_Hunter
|
||||
//data setting
|
||||
var distinctIndicator = IndicatorSetupManager.Distinct(totalIndicator);
|
||||
|
||||
var dic = new Dictionary<CommonProperty.MCandleTimeType, CandleDataList>();
|
||||
var dic = new Dictionary<CommonProperty.MCandleTimeType, List<List<CandleData>>>();
|
||||
|
||||
foreach(var item in candleTypeList)
|
||||
{
|
||||
dic[item] = DbServiceFunctions.GetCandleData(selectTable, _saveResultData.StartDateTime, _saveResultData.EndDateTime, item);
|
||||
|
||||
var candleDataListClass = DbServiceFunctions.GetCandleData(selectTable, _saveResultData.StartDateTime, _saveResultData.EndDateTime, item);
|
||||
var indicatorSetUpList = distinctIndicator.Where(t => t.MCandleTimeType == item).ToList();
|
||||
foreach(var setup in indicatorSetUpList)
|
||||
foreach (var setup in indicatorSetUpList)
|
||||
{
|
||||
setup.excute(dic[item].CandleDataLists_Im);
|
||||
setup.excute(candleDataListClass.CandleDataLists_Im);
|
||||
}
|
||||
|
||||
dic[item] = ValidationCheckManager.SplitValidationCandleDataList(candleDataListClass.CandleDataLists_Im, item);
|
||||
}
|
||||
|
||||
// 1. 계산하기
|
||||
|
||||
// buy, sell 계산
|
||||
foreach (var indicator in totalIndicator)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
20
Million/Data/CalculateCandleData.cs
Normal file
20
Million/Data/CalculateCandleData.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Million.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// 조건 계산을 위한 Class
|
||||
/// </summary>
|
||||
public class CalculateCandleData
|
||||
{
|
||||
CandleData ParentCandleDatas { get; set; }
|
||||
|
||||
CommonProperty.MCandleTimeType ParentCandleTimeType { get; set; }
|
||||
|
||||
List<CandleData> ChildrenCandleDatas { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,9 @@ namespace Million.Data
|
||||
|
||||
public Dictionary<string, IndicatorData> IndicatorDic = new Dictionary<string, IndicatorData>();
|
||||
|
||||
public Dictionary<string, bool> SellLogicFlag = new Dictionary<string, bool>();
|
||||
public Dictionary<string, bool> SellLogicFlag { get; set; } = new Dictionary<string, bool>();
|
||||
|
||||
public Dictionary<string, bool> CalculateFlag { get; set; } = new Dictionary<string, bool>();
|
||||
|
||||
public CandleType CandleType { get; set; } = CandleType.None;
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ namespace Million.Data
|
||||
|
||||
public List<CandleData> TermCandleDataList { get; set; } = new List<CandleData>();
|
||||
|
||||
public MarketData MarketData { get; set; }
|
||||
|
||||
public string CodeFullName { get; set; }
|
||||
|
||||
public DateTime StartDate { get; set; }
|
||||
|
||||
67
Million/Manager/CalculateManager.cs
Normal file
67
Million/Manager/CalculateManager.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using Million.Data;
|
||||
using Million.IndicatorConditionSetup;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Million.Manager
|
||||
{
|
||||
/// <summary>
|
||||
/// Buy, Sell Indicate Setup 기준 데이터 계산 로직
|
||||
/// </summary>
|
||||
public static class CalculateManager
|
||||
{
|
||||
public static List<CandleData> SwitchFun(IndicatorCoditionSetup setUp, List<List<CandleData>> parentCandleDataList,
|
||||
List<List<CandleData>> childrenCandleDataList, double overlapValue)
|
||||
{
|
||||
var parentList = new List<CandleData>();
|
||||
var childList = new List<CandleData>();
|
||||
|
||||
foreach (var item in parentCandleDataList) parentList.AddRange(item);
|
||||
foreach (var item in childrenCandleDataList) childList.AddRange(item);
|
||||
|
||||
parentList = parentList.OrderBy(t => t.DateTime).ToList();
|
||||
childList = childList.OrderBy(t => t.DateTime).ToList();
|
||||
|
||||
foreach (var item in childList) item.CalculateFlag[setUp.IndexString] = false;
|
||||
|
||||
//돌파
|
||||
if (setUp.OverStatusEnumList.Count > 0)
|
||||
{
|
||||
return Transpierce(setUp, parentList, childList);
|
||||
}
|
||||
//단순비교
|
||||
else if(setUp.IndicatorOver != CommonProperty.Indicator_over.없음)
|
||||
{
|
||||
return SimpleComparison(setUp, parentList, childList);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 상향, 하향으로 뚫었을 경우
|
||||
/// </summary>
|
||||
public static List<CandleData> Transpierce(IndicatorCoditionSetup setUp, List<CandleData> parentCandleDataList, List<CandleData> childrenCandleDataList)
|
||||
{
|
||||
|
||||
|
||||
return childrenCandleDataList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 단순 비교
|
||||
/// </summary>
|
||||
/// <param name="setUp"></param>
|
||||
/// <param name="list"></param>
|
||||
/// <returns></returns>
|
||||
public static List<CandleData> SimpleComparison(IndicatorCoditionSetup setUp, List<CandleData> parentCandleDataList, List<CandleData> childrenCandleDataList)
|
||||
{
|
||||
|
||||
|
||||
return childrenCandleDataList;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -105,6 +105,7 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="CommonProperty.cs" />
|
||||
<Compile Include="Data\BollingerData.cs" />
|
||||
<Compile Include="Data\CalculateCandleData.cs" />
|
||||
<Compile Include="Data\CandleData.cs" />
|
||||
<Compile Include="Data\CandleDataList.cs" />
|
||||
<Compile Include="Data\ErrorCandleData.cs" />
|
||||
@@ -143,6 +144,7 @@
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Manager\BuyLogicManager.cs" />
|
||||
<Compile Include="Manager\CalculateManager.cs" />
|
||||
<Compile Include="Manager\DataSettingManager.cs" />
|
||||
<Compile Include="Manager\IndicatorSetupManager.cs" />
|
||||
<Compile Include="Manager\OrderbookManager.cs" />
|
||||
|
||||
Reference in New Issue
Block a user