mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-07-27 17:27:43 +00:00
[CodeFactor] Apply fixes to commit 02c9271
This commit is contained in:
committed by
Miha Kralj
parent
4f738e6476
commit
fce3a783eb
@@ -162,6 +162,6 @@ namespace QuanTAlib
|
||||
[Fact] public void Vortex() => TestIndicatorMultipleFields<momentum::QuanTAlib.VortexIndicator>(new[] { "PlusLine", "MinusLine" });
|
||||
|
||||
// Oscillators Indicators
|
||||
[Fact] public void Cti() => TestIndicator<oscillator::QuanTAlib.CtiIndicator>("Series");
|
||||
[Fact] public void Cti() => TestIndicator<oscillators::QuanTAlib.CtiIndicator>("Series");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user