From ceb0c698aed293d2968332e97b06f7184d721c4a Mon Sep 17 00:00:00 2001 From: kyh <1329522@naver.com> Date: Tue, 15 Nov 2022 12:35:25 +0900 Subject: [PATCH] =?UTF-8?q?parent=20candle=20data=EB=A5=BC=20child?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EA=B0=80=EC=A7=80=EA=B3=A0=20=EC=9E=88?= =?UTF-8?q?=EC=9D=84=20=EC=88=98=20=EC=9E=88=EB=8F=84=EB=A1=9D=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Million/Data/CandleData.cs | 2 ++ Million/Manager/CalculateManager.cs | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/Million/Data/CandleData.cs b/Million/Data/CandleData.cs index 26e3a56..ac542a4 100644 --- a/Million/Data/CandleData.cs +++ b/Million/Data/CandleData.cs @@ -37,6 +37,8 @@ namespace Million.Data public Dictionary SellLogicFlag { get; set; } = new Dictionary(); public Dictionary CalculateFlag { get; set; } = new Dictionary(); + public Dictionary ParentCandleData = new Dictionary(); + public CandleType CandleType { get; set; } = CandleType.None; diff --git a/Million/Manager/CalculateManager.cs b/Million/Manager/CalculateManager.cs index d28a06c..1316ab4 100644 --- a/Million/Manager/CalculateManager.cs +++ b/Million/Manager/CalculateManager.cs @@ -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 resultCandleDataList, List subIndicator, Dictionary> 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) {