mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-16 09:38:05 +00:00
[CodeFactor] Apply fixes
This commit is contained in:
@@ -74,7 +74,7 @@ public sealed class Curvature : AbstractBase
|
||||
"Period must be greater than 2 for Curvature calculation.");
|
||||
}
|
||||
_period = period;
|
||||
WarmupPeriod = period * 2 - 1; // Number of points needed for period number of slopes
|
||||
WarmupPeriod = (period * 2) - 1; // Number of points needed for period number of slopes
|
||||
_slopeCalculator = new Slope(period);
|
||||
_slopeBuffer = new CircularBuffer(period);
|
||||
Name = $"Curvature(period={period})";
|
||||
|
||||
@@ -129,7 +129,7 @@ public sealed class Kurtosis : AbstractBase
|
||||
if (variance2 < Epsilon)
|
||||
return 0;
|
||||
|
||||
return (n * (n + 1) * s4) / (variance2 * (n - 3) * (n - 1) * (n - 2))
|
||||
return ((n * (n + 1) * s4) / (variance2 * (n - 3) * (n - 1) * (n - 2)))
|
||||
- (3 * (n - 1) * (n - 1) / ((n - 2) * (n - 3)));
|
||||
}
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ public sealed class Percentile : AbstractBase
|
||||
double lowerValue = sortedValues[lowerIndex];
|
||||
double upperValue = sortedValues[upperIndex];
|
||||
double fraction = position - lowerIndex;
|
||||
return lowerValue + (upperValue - lowerValue) * fraction;
|
||||
return lowerValue + ((upperValue - lowerValue) * fraction);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
|
||||
Reference in New Issue
Block a user