Skip to content

Commit fce3a78

Browse files
code-factormihakralj
authored andcommitted
[CodeFactor] Apply fixes to commit 02c9271
1 parent 4f738e6 commit fce3a78

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Tests/test_quantower.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,6 @@ public class QuantowerTests
162162
[Fact] public void Vortex() => TestIndicatorMultipleFields<momentum::QuanTAlib.VortexIndicator>(new[] { "PlusLine", "MinusLine" });
163163

164164
// Oscillators Indicators
165-
[Fact] public void Cti() => TestIndicator<oscillator::QuanTAlib.CtiIndicator>("Series");
165+
[Fact] public void Cti() => TestIndicator<oscillators::QuanTAlib.CtiIndicator>("Series");
166166
}
167167
}

lib/oscillators/Cti.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ protected override double Calculation()
9696
}
9797

9898
// Check for numerical stability
99-
double denomX = points * sxx - sx * sx;
100-
double denomY = points * syy - sy * sy;
99+
double denomX = (points * sxx) - (sx * sx);
100+
double denomY = (points * syy) - (sy * sy);
101101

102102
if (denomX > 0 && denomY > 0)
103103
{
104-
return (points * sxy - sx * sy) / Math.Sqrt(denomX * denomY);
104+
return ((points * sxy) - (sx * sy)) / Math.Sqrt(denomX * denomY);
105105
}
106106

107107
return 0;

0 commit comments

Comments
 (0)