[CodeFactor] Apply fixes to commit 02c9271

This commit is contained in:
codefactor-io
2024-11-08 10:27:39 -08:00
committed by Miha Kralj
parent 4f738e6476
commit fce3a783eb
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -162,6 +162,6 @@ namespace QuanTAlib
[Fact] public void Vortex() => TestIndicatorMultipleFields<momentum::QuanTAlib.VortexIndicator>(new[] { "PlusLine", "MinusLine" }); [Fact] public void Vortex() => TestIndicatorMultipleFields<momentum::QuanTAlib.VortexIndicator>(new[] { "PlusLine", "MinusLine" });
// Oscillators Indicators // Oscillators Indicators
[Fact] public void Cti() => TestIndicator<oscillator::QuanTAlib.CtiIndicator>("Series"); [Fact] public void Cti() => TestIndicator<oscillators::QuanTAlib.CtiIndicator>("Series");
} }
} }
+3 -3
View File
@@ -96,12 +96,12 @@ public sealed class Cti : AbstractBase
} }
// Check for numerical stability // Check for numerical stability
double denomX = points * sxx - sx * sx; double denomX = (points * sxx) - (sx * sx);
double denomY = points * syy - sy * sy; double denomY = (points * syy) - (sy * sy);
if (denomX > 0 && denomY > 0) if (denomX > 0 && denomY > 0)
{ {
return (points * sxy - sx * sy) / Math.Sqrt(denomX * denomY); return ((points * sxy) - (sx * sy)) / Math.Sqrt(denomX * denomY);
} }
return 0; return 0;