From ec4d9c7a4a50091295a9c42ca2024d25be6c6f18 Mon Sep 17 00:00:00 2001 From: kyh <1329522@naver.com> Date: Tue, 26 Nov 2024 12:46:48 +0900 Subject: [PATCH] =?UTF-8?q?sell=20=EC=A1=B0=EA=B1=B4=20=EC=84=B8=EB=B6=84?= =?UTF-8?q?=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndicatorProcess.cs | 128 +++++++++++++++--- 1 file changed, 110 insertions(+), 18 deletions(-) diff --git a/BitgetApi/IndicatorConditionSetup/IndicatorProcess.cs b/BitgetApi/IndicatorConditionSetup/IndicatorProcess.cs index 8e109da..43e94e7 100644 --- a/BitgetApi/IndicatorConditionSetup/IndicatorProcess.cs +++ b/BitgetApi/IndicatorConditionSetup/IndicatorProcess.cs @@ -435,8 +435,7 @@ namespace BitgetAPI.IndicatorConditionSetup if (!UpBuyList.ContainsKey(market + interval)) { if ( - 낮은값_72_24_전봉 < 전봉2 && 전전봉2 < 낮은값_72_24_전전봉 && - 낮은값_72_24_전봉 > 전봉8 + 낮은값_72_24_전봉 < 전봉2 && 전전봉2 < 낮은값_72_24_전전봉 ) { FirstLongFlag[market + interval] = false; @@ -600,7 +599,7 @@ namespace BitgetAPI.IndicatorConditionSetup double compareVal = 0; int.TryParse(buyItem["Type"].ToString(), out var type); var val = SellLongStep[market + interval]; - + var sellFlag = false; if (type == 24) { if (val == 0) { @@ -611,20 +610,21 @@ namespace BitgetAPI.IndicatorConditionSetup if (origin > compare) { - val = 1; + if (전봉2 > origin) + val = 1; + else + sellFlag = true; } else { - if(origin > 전봉2) - { - compareVal = origin; - } + if (전봉2 > compare) + compareVal = compare; } } if (val == 1) { - compareVal = 높은값_72_24; + compareVal = 높은값_72_24_전봉; if (전봉2 > 전봉12) { @@ -638,18 +638,30 @@ namespace BitgetAPI.IndicatorConditionSetup if(type == 72) { - if(val == 0) + if (val == 0) { - compareVal = 낮은값_72_24_전봉; - if (전봉24 < 전봉2) + var origin = 전봉72; + var compare = 전봉24; + + compareVal = origin; + + if (origin > compare) { - val = 1; + if (전봉2 > origin) + val = 1; + else + sellFlag = true; + } + else + { + if (전봉2 > compare) + compareVal = compare; } } if (val == 1) { - compareVal = 높은값_72_24; + compareVal = 높은값_72_24_전봉; if (전봉2 > 전봉12) { @@ -663,7 +675,7 @@ namespace BitgetAPI.IndicatorConditionSetup SellLongStep[market + interval] = val; - if (전봉2 < compareVal || 전봉2 < 낮은값_72_24) + if (전봉2 < compareVal || 전봉2 < 낮은값_72_24 || sellFlag) { double.TryParse(buyItem["Price"].ToString(), out var buyPrice); var resultRate = ((price - buyPrice) / buyPrice) * 100; @@ -752,8 +764,7 @@ namespace BitgetAPI.IndicatorConditionSetup if (!DownBuyList.ContainsKey(market + interval)) { if ( - 전봉24 > 전봉2 && 전봉24 < 전봉72 && 전전봉2 > 전전봉24 && - 전봉2 < candleData_전봉.IchimokData.하한선 + 높은값_72_24_전봉 > 전봉2 && 전전봉2 > 높은값_72_24_전전봉 ) { FirstShortFlag[market + interval] = false; @@ -778,6 +789,7 @@ namespace BitgetAPI.IndicatorConditionSetup { "BuyDate", nowTime }, { "Price", price }, { "MCandleTimeType", (int)interval }, + { "Type", 전봉24 > 전봉72 ? 24 : 72 }, { "CandleTime", candleData.Argument }, { "MovingRate4_8", 현재봉4 - 현재봉8 }, { "Candle", candleData } @@ -917,7 +929,87 @@ namespace BitgetAPI.IndicatorConditionSetup //{ // sellFlag = true; //} - if (전봉2 > 전봉24) + double compareVal = 0; + int.TryParse(buyItem["Type"].ToString(), out var type); + var val = SellShortStep[market + interval]; + + if (type == 24) + { + if (val == 0) + { + var origin = 전봉24; + var compare = 전봉72; + + compareVal = origin; + + if (origin < compare) + { + if (전봉2 < origin) + val = 1; + else + sellFlag = true; + } + else + { + if (전봉2 < compare) + compareVal = compare; + } + } + + if (val == 1) + { + compareVal = 낮은값_72_24_전봉; + + if (전봉2 < 전봉12) + { + val = 2; + } + } + + if (val == 2) + compareVal = 전봉12; + } + + if (type == 72) + { + if (val == 0) + { + var origin = 전봉72; + var compare = 전봉24; + + compareVal = origin; + + if (origin < compare) + { + if (전봉2 < origin) + val = 1; + else + sellFlag = true; + } + else + { + if (전봉2 < compare) + compareVal = compare; + } + } + + if (val == 1) + { + compareVal = 낮은값_72_24_전봉; + + if (전봉2 < 전봉12) + { + val = 2; + } + } + + if (val == 2) + compareVal = 전봉12; + } + + SellShortStep[market + interval] = val; + + if (전봉2 > compareVal || 전봉2 > 높은값_72_24 || sellFlag) { double.TryParse(buyItem["Price"].ToString(), out var buyPrice); var resultRate = ((price - buyPrice) / buyPrice) * 100;