diff --git a/Tests/test_quantower.cs b/Tests/test_quantower.cs index 231064f4..fbec6a76 100644 --- a/Tests/test_quantower.cs +++ b/Tests/test_quantower.cs @@ -162,6 +162,6 @@ namespace QuanTAlib [Fact] public void Vortex() => TestIndicatorMultipleFields(new[] { "PlusLine", "MinusLine" }); // Oscillators Indicators - [Fact] public void Cti() => TestIndicator("Series"); + [Fact] public void Cti() => TestIndicator("Series"); } } diff --git a/lib/oscillators/Cti.cs b/lib/oscillators/Cti.cs index cebf634d..53b6158f 100644 --- a/lib/oscillators/Cti.cs +++ b/lib/oscillators/Cti.cs @@ -96,12 +96,12 @@ public sealed class Cti : AbstractBase } // Check for numerical stability - double denomX = points * sxx - sx * sx; - double denomY = points * syy - sy * sy; + double denomX = (points * sxx) - (sx * sx); + double denomY = (points * syy) - (sy * sy); 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;