[CodeFactor] Apply fixes to commit 9697fac

This commit is contained in:
codefactor-io
2026-03-14 05:03:08 +00:00
parent 9697facfb4
commit e35ff7fa3f
164 changed files with 458 additions and 530 deletions
-2
View File
@@ -293,7 +293,6 @@ public sealed class Alligator : ITValuePublisher
return new TSeries(tList, vList);
}
/// <summary>
/// Initializes the indicator state using the provided bar series history.
/// </summary>
@@ -337,7 +336,6 @@ public sealed class Alligator : ITValuePublisher
return (results, indicator);
}
/// <summary>
/// Gets the Jaw period value.
/// </summary>
-1
View File
@@ -642,5 +642,4 @@ public sealed class Amat : ITValuePublisher, IDisposable
TSeries results = amat.Update(source);
return (results, amat);
}
}
-2
View File
@@ -240,7 +240,6 @@ public sealed class Chop : ITValuePublisher
return Math.Clamp(chop, 0.0, 100.0);
}
/// <summary>
/// Initializes the indicator state using the provided bar series history.
/// </summary>
@@ -282,5 +281,4 @@ public sealed class Chop : ITValuePublisher
TSeries results = indicator.Update(source);
return (results, indicator);
}
}
@@ -52,7 +52,7 @@ public sealed class HtTrendmodeIndicator : Indicator, IWatchlistIndicator
SourceType.HL2 => (GetPrice(PriceType.High) + GetPrice(PriceType.Low)) / 2,
SourceType.HLC3 => (GetPrice(PriceType.High) + GetPrice(PriceType.Low) + GetPrice(PriceType.Close)) / 3,
SourceType.OHLC4 => (GetPrice(PriceType.Open) + GetPrice(PriceType.High) + GetPrice(PriceType.Low) + GetPrice(PriceType.Close)) / 4,
SourceType.HLCC4 => (GetPrice(PriceType.High) + GetPrice(PriceType.Low) + 2 * GetPrice(PriceType.Close)) / 4,
SourceType.HLCC4 => (GetPrice(PriceType.High) + GetPrice(PriceType.Low) + (2 * GetPrice(PriceType.Close))) / 4,
_ => GetPrice(PriceType.Close)
};
+6 -6
View File
@@ -186,8 +186,8 @@ public sealed class HtTrendmode : AbstractBase
double input1 = buffer[KEY_Q1];
DoHilbertTransform(buffer, KEY_JQ, input1, true, hilbertIdx, adjustedPrevPeriod);
q2 = 0.2 * (buffer[KEY_Q1] + buffer[KEY_JI]) + 0.8 * prevQ2;
i2 = 0.2 * (i1ForOddPrev3 - buffer[KEY_JQ]) + 0.8 * prevI2;
q2 = (0.2 * (buffer[KEY_Q1] + buffer[KEY_JI])) + (0.8 * prevQ2);
i2 = (0.2 * (i1ForOddPrev3 - buffer[KEY_JQ])) + (0.8 * prevI2);
i1ForEvenPrev3 = i1ForEvenPrev2;
i1ForEvenPrev2 = buffer[KEY_DETRENDER];
@@ -211,8 +211,8 @@ public sealed class HtTrendmode : AbstractBase
hilbertIdx = 0;
}
q2 = 0.2 * (buffer[KEY_Q1] + buffer[KEY_JI]) + 0.8 * prevQ2;
i2 = 0.2 * (i1ForEvenPrev3 - buffer[KEY_JQ]) + 0.8 * prevI2;
q2 = (0.2 * (buffer[KEY_Q1] + buffer[KEY_JI])) + (0.8 * prevQ2);
i2 = (0.2 * (i1ForEvenPrev3 - buffer[KEY_JQ])) + (0.8 * prevI2);
i1ForOddPrev3 = i1ForOddPrev2;
i1ForOddPrev2 = buffer[KEY_DETRENDER];
@@ -304,7 +304,7 @@ public sealed class HtTrendmode : AbstractBase
}
// Calculate smoothed price using WMA
double adjustedPrevPeriod = 0.075 * s.Period + 0.54;
double adjustedPrevPeriod = (0.075 * s.Period) + 0.54;
s.PeriodWMASub += price;
s.PeriodWMASub -= s.TrailingWMAValue;
@@ -488,7 +488,7 @@ public sealed class HtTrendmode : AbstractBase
double smaValue = (dcPeriodInt > 0) ? sumPrice / (double)dcPeriodInt : price;
// WMA smoothing of SMA: (4*current + 3*prev1 + 2*prev2 + prev3) / 10
double trendline = (4.0 * smaValue + 3.0 * s.ITrend1 + 2.0 * s.ITrend2 + s.ITrend3) / 10.0;
double trendline = ((4.0 * smaValue) + (3.0 * s.ITrend1) + (2.0 * s.ITrend2) + s.ITrend3) / 10.0;
s.ITrend3 = s.ITrend2;
s.ITrend2 = s.ITrend1;
s.ITrend1 = smaValue;
+1 -1
View File
@@ -234,7 +234,7 @@ public sealed class Pfe : AbstractBase
_s = default;
_ps = default;
int warmupLength = Math.Min(source.Length, WarmupPeriod + _smoothPeriod * 3);
int warmupLength = Math.Min(source.Length, WarmupPeriod + (_smoothPeriod * 3));
int startIndex = source.Length - warmupLength;
// Seed LastValidValue
-1
View File
@@ -265,7 +265,6 @@ public sealed class Super : ITValuePublisher
return new TSeries(t, v);
}
/// <summary>
/// Initializes the indicator state using the provided bar series history.
/// </summary>
-1
View File
@@ -392,7 +392,6 @@ public sealed class Vhf : AbstractBase
prevClose = val;
hasPrevClose = true;
// Calculate VHF
if (closeFilled >= closeBufSize && diffFilled >= period)
{
-1
View File
@@ -339,5 +339,4 @@ public sealed class Vortex : ITValuePublisher
TSeries results = indicator.Update(source);
return (results, indicator);
}
}