From 1f80bdc7186ea5194d47b2d18c4183aa035fd38e Mon Sep 17 00:00:00 2001 From: kyh <1329522@naver.com> Date: Fri, 13 Dec 2024 15:46:18 +0900 Subject: [PATCH] =?UTF-8?q?=EC=88=98=EC=A0=95=20=EC=98=AC=EB=A6=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndicatorProcess.cs | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/BitgetApi/IndicatorConditionSetup/IndicatorProcess.cs b/BitgetApi/IndicatorConditionSetup/IndicatorProcess.cs index 248e20c..0ad2b32 100644 --- a/BitgetApi/IndicatorConditionSetup/IndicatorProcess.cs +++ b/BitgetApi/IndicatorConditionSetup/IndicatorProcess.cs @@ -240,6 +240,8 @@ namespace BitgetAPI.IndicatorConditionSetup dic.Add("beforeLowVal", 0); dic.Add("twoBeforeHighVal", 0); dic.Add("twoBeforeLowVal", 0); + dic.Add("tempBeforeLowVal", 0); + dic.Add("tempBeforeHighVal", 0); 전저고점.Add(market + strInterval, dic); } @@ -457,17 +459,31 @@ namespace BitgetAPI.IndicatorConditionSetup var 저고점 = 전저고점[market + strInterval]; - if (전봉4 > (전전봉4 * 1.0001) && 전전봉4 < 전전전봉4) + if (현재봉4 > (전봉4 * 1.0001) && 전봉4 < 전전봉4) { + 저고점["tempBeforeLowVal"] = 저고점["twoBeforeLowVal"]; 저고점["twoBeforeLowVal"] = 저고점["beforeLowVal"]; 저고점["beforeLowVal"] = 전봉4; } - - if (전봉4 < (전전봉4 * 1.0001) && 전전봉4 > 전전전봉4) + else if(현재봉4 < (전봉4 * 1.0001) && 저고점["tempBeforeLowVal"] == 저고점["twoBeforeLowVal"]) { + 저고점["beforeLowVal"] = 저고점["twoBeforeLowVal"]; + 저고점["twoBeforeLowVal"] = 저고점["tempBeforeLowVal"]; + 저고점["tempBeforeLowVal"] = 0; + } + + if (현재봉4 < (전봉4 * 1.0001) && 전봉4 > 전전봉4) + { + 저고점["tempBeforeHighVal"] = 저고점["twoBeforeHighVal"]; 저고점["twoBeforeHighVal"] = 저고점["beforeHighVal"]; 저고점["beforeHighVal"] = 전봉4; } + else if(현재봉4 > (전봉4 * 1.0001)) + { + 저고점["beforeHighVal"] = 저고점["tempBeforeHighVal"]; + 저고점["twoBeforeHighVal"] = 저고점["tempBeforeHighVal"]; + 저고점["tempBeforeHighVal"] = 0; + } if (저고점["twoBeforeLowVal"] == 0 || 저고점["twoBeforeHighVal"] == 0) continue; @@ -486,16 +502,14 @@ namespace BitgetAPI.IndicatorConditionSetup //전 저점 계산 try - { - - + { //사는 시점 if (!UpBuyList.ContainsKey(market + interval)) { var buyFlag = false; if ((전봉12 > 전전봉12 || 전봉24 > 전전봉24) && - 현재봉4 > 저고점["beforeHighVal"] && 전봉24 < 전봉4 && + candleData.Close > 저고점["beforeHighVal"] && 전봉24 < 전봉4 && 저고점["twoBeforeLowVal"] < 저고점["beforeLowVal"] && 저고점["twoBeforeHighVal"] < 저고점["beforeHighVal"]) { @@ -685,7 +699,7 @@ namespace BitgetAPI.IndicatorConditionSetup { var buyFlag = false; if ((전봉12 < 전전봉12 || 전봉24 < 전전봉24) && - 현재봉4 < 저고점["beforeLowVal"] && 전봉24 > 전봉4 && + candleData.Close < 저고점["beforeLowVal"] && 전봉24 > 전봉4 && 저고점["twoBeforeHighVal"] > 저고점["beforeHighVal"] && 저고점["twoBeforeLowVal"] > 저고점["beforeLowVal"]) {