초기화 로직 추가

This commit is contained in:
kyh
2025-06-17 11:41:09 +09:00
parent 00a5860b29
commit 122a283cd5

View File

@@ -121,8 +121,8 @@ namespace BitgetAPI.IndicatorConditionSetup
public Dictionary<string, double> BuyShortStepStampData = new Dictionary<string, double>(); public Dictionary<string, double> BuyShortStepStampData = new Dictionary<string, double>();
public Dictionary<string, double> BuyLongStepStampData = new Dictionary<string, double>(); public Dictionary<string, double> BuyLongStepStampData = new Dictionary<string, double>();
public Dictionary<string, bool> FirstFlag = new Dictionary<string, bool>();
public int 전가Flag = 1;
// 전봉이 구름떼 돌파후 시가가 구름떼 위에서 시작하는 것 // 전봉이 구름떼 돌파후 시가가 구름떼 위에서 시작하는 것
@@ -239,6 +239,8 @@ namespace BitgetAPI.IndicatorConditionSetup
if (!전저고점.ContainsKey(market + strInterval)) if (!전저고점.ContainsKey(market + strInterval))
{ {
FirstFlag.Add(market + strInterval + "Long", false);
FirstFlag.Add(market + strInterval + "Short", false);
var dic = new Dictionary<string, double> var dic = new Dictionary<string, double>
{ {
{ "전고가", 0 }, { "전고가", 0 },
@@ -371,8 +373,17 @@ namespace BitgetAPI.IndicatorConditionSetup
//사는 시점 //사는 시점
if (!UpBuyList.ContainsKey(market)) if (!UpBuyList.ContainsKey(market))
{ {
if (sMABandConditionSetup.Calculate(candleDatas_5_TempList, SMABandType.LongBuy) && if(!FirstFlag[market + strInterval + "Long"])
!sMABandConditionSetup.Calculate(candleDatas_5_TempList, SMABandType.LongSell)) {
if(sMABandConditionSetup.Calculate(candleDatas_5_TempList, SMABandType.LongSell, true))
{
FirstFlag[market + strInterval + "Long"] = true;
}
}
if (sMABandConditionSetup.Calculate(candleDatas_5_TempList, SMABandType.LongBuy, true) &&
!sMABandConditionSetup.Calculate(candleDatas_5_TempList, SMABandType.LongSell, true) &&
FirstFlag[market + strInterval + "Long"])
{ {
BuyLongStep[market] = 0; BuyLongStep[market] = 0;
// 없으면 생성 // 없으면 생성
@@ -565,8 +576,18 @@ namespace BitgetAPI.IndicatorConditionSetup
//사는 시점 //사는 시점
if (!DownBuyList.ContainsKey(market)) if (!DownBuyList.ContainsKey(market))
{ {
if (sMABandConditionSetup.Calculate(candleDatas_5_TempList, SMABandType.ShortBuy) && if (!FirstFlag[market + strInterval + "Short"])
!sMABandConditionSetup.Calculate(candleDatas_5_TempList, SMABandType.ShortSell)) {
if (sMABandConditionSetup.Calculate(candleDatas_5_TempList, SMABandType.ShortSell, true))
{
FirstFlag[market + strInterval + "Short"] = true;
}
}
if (sMABandConditionSetup.Calculate(candleDatas_5_TempList, SMABandType.ShortBuy, true) &&
!sMABandConditionSetup.Calculate(candleDatas_5_TempList, SMABandType.ShortSell, true) &&
FirstFlag[market + strInterval + "Short"])
{ {
BuyShortStep[market] = 0; BuyShortStep[market] = 0;
// 없으면 생성 // 없으면 생성