From fce3a783eb3f7ebaf09fd30d29d148701008484c Mon Sep 17 00:00:00 2001 From: codefactor-io Date: Fri, 8 Nov 2024 18:08:04 +0000 Subject: [PATCH] [CodeFactor] Apply fixes to commit 02c9271 --- Tests/test_quantower.cs | 2 +- lib/oscillators/Cti.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/test_quantower.cs b/Tests/test_quantower.cs index 231064f..fbec6a7 100644 --- a/Tests/test_quantower.cs +++ b/Tests/test_quantower.cs @@ -162,6 +162,6 @@ public class QuantowerTests [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 cebf634..53b6158 100644 --- a/lib/oscillators/Cti.cs +++ b/lib/oscillators/Cti.cs @@ -96,12 +96,12 @@ protected override double Calculation() } // 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;