에러 수정

This commit is contained in:
kyh
2025-05-13 12:53:36 +09:00
parent fcd3389938
commit 57071f80c5
2 changed files with 355 additions and 75 deletions

View File

@@ -22,7 +22,7 @@ namespace BitgetAPI.IndicatorConditionSetup
private List<double> sbList = new List<double>();
private List<double> shList = new List<double>();
public ImpulseMacdConditionSetup(int lengthMA = 26, int lengthSignal = 12)
public ImpulseMacdConditionSetup(int lengthMA = 34, int lengthSignal = 12)
{
this.lengthMA = lengthMA;
this.lengthSignal = lengthSignal;
@@ -40,6 +40,8 @@ namespace BitgetAPI.IndicatorConditionSetup
else
{
srcList[srcList.Count - 1] = src;
highList[highList.Count - 1] = high;
lowList[lowList.Count - 1] = low;
}
double smmaHigh = CalculateSMMA(highList, smmaHighList, lengthMA);
@@ -52,16 +54,31 @@ namespace BitgetAPI.IndicatorConditionSetup
else if (zlema < smmaLow)
md = zlema - smmaLow;
mdList.Add(md);
if (mdList.Count < lengthSignal)
return null;
if (flag)
{
mdList.Add(md);
}
else
{
mdList[mdList.Count - 1] = md;
}
double sb = mdList.Skip(mdList.Count - lengthSignal).Average();
double sh = md - sb;
sbList.Add(sb);
shList.Add(sh);
if (flag)
{
sbList.Add(sb);
shList.Add(sh);
}
else
{
sbList[sbList.Count - 1] = sb;
shList[shList.Count - 1] = sh;
}
if (mdList.Count < lengthSignal)
return null;
if (mdList.Count > 100)
{