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"]) {