parent candle data를 child에서 가지고 있을 수 있도록 추가 구현

This commit is contained in:
kyh
2022-11-15 12:35:25 +09:00
parent ba63a1a617
commit ceb0c698ae
2 changed files with 22 additions and 0 deletions

View File

@@ -37,6 +37,8 @@ namespace Million.Data
public Dictionary<string, bool> SellLogicFlag { get; set; } = new Dictionary<string, bool>();
public Dictionary<string, bool> CalculateFlag { get; set; } = new Dictionary<string, bool>();
public Dictionary<MCandleTimeType, CandleData> ParentCandleData = new Dictionary<MCandleTimeType, CandleData>();
public CandleType CandleType { get; set; } = CandleType.None;

View File

@@ -329,6 +329,9 @@ namespace Million.Manager
foreach (var item in parentCandleDataList)
item.CalculateFlag[setUp.IndexString] = false;
//부모의 Indicator 데이터를 Child에 집어 넣음
if (setUp.IndicatorType == IndicatorType.가격비율)
{
var temp = (PriceRateCondtionSetup)setUp;
@@ -1296,6 +1299,23 @@ namespace Million.Manager
DateTime startDate, DateTime endDate, List<CandleData> resultCandleDataList, List<IndicatorCoditionSetup> subIndicator,
Dictionary<MCandleTimeType, List<CandleData>> parentList, bool upperMainIndicatorFlag, bool recentlyDataFlag = false, string coinFullName = null)
{
//최신 Child데이터 계산하기 전에 부모 자식 관계 정리부터 처리
var parentKeys = parentList.Keys;
foreach(var key in parentKeys)
{
var parentItem = parentList[key];
foreach (var item in parentItem)
{
var childList = GetChildrenDatas(item, key, resultCandleDataList);
foreach (var child in childList)
{
child.ParentCandleData[key] = item;
}
}
}
//최신 child 계산
if (recentlyDataFlag)
{