mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-23 21:18:04 +00:00
[CodeFactor] Apply fixes to commit 0606491
This commit is contained in:
@@ -74,7 +74,7 @@ public sealed class Fisher04Tests
|
||||
var fisher = new Fisher04(period: 5);
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
fisher.Update(new TValue(DateTime.UtcNow, 100.0 + i * 2));
|
||||
fisher.Update(new TValue(DateTime.UtcNow, 100.0 + (i * 2)));
|
||||
}
|
||||
Assert.True(fisher.FisherValue > 0, "Rising prices should produce positive Fisher04");
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public sealed class Fisher04Tests
|
||||
var fisher = new Fisher04(period: 5);
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
fisher.Update(new TValue(DateTime.UtcNow, 200.0 - i * 2));
|
||||
fisher.Update(new TValue(DateTime.UtcNow, 200.0 - (i * 2)));
|
||||
}
|
||||
Assert.True(fisher.FisherValue < 0, "Falling prices should produce negative Fisher04");
|
||||
}
|
||||
@@ -117,7 +117,7 @@ public sealed class Fisher04Tests
|
||||
double[] data = new double[15];
|
||||
for (int i = 0; i < data.Length; i++)
|
||||
{
|
||||
data[i] = 100 + i * 2;
|
||||
data[i] = 100 + (i * 2);
|
||||
}
|
||||
|
||||
for (int i = 0; i < data.Length; i++)
|
||||
@@ -421,7 +421,7 @@ public sealed class Fisher04Tests
|
||||
// Create a very strong uptrend
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
fisher.Update(new TValue(DateTime.UtcNow, 100.0 + i * 10));
|
||||
fisher.Update(new TValue(DateTime.UtcNow, 100.0 + (i * 10)));
|
||||
}
|
||||
|
||||
// Fisher04 should be positive for uptrend
|
||||
@@ -437,7 +437,7 @@ public sealed class Fisher04Tests
|
||||
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
fisher.Update(new TValue(DateTime.UtcNow, 100.0 + i * 5));
|
||||
fisher.Update(new TValue(DateTime.UtcNow, 100.0 + (i * 5)));
|
||||
}
|
||||
|
||||
// Both should be positive in uptrend
|
||||
|
||||
@@ -293,7 +293,7 @@ public sealed class Fisher04ValidationTests(ITestOutputHelper output) : IDisposa
|
||||
// Keep feeding extreme values to push value1 toward clamp
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
fisher.Update(new TValue(DateTime.UtcNow, 100.0 + (i + 4) * 100.0), isNew: true);
|
||||
fisher.Update(new TValue(DateTime.UtcNow, 100.0 + ((i + 4) * 100.0)), isNew: true);
|
||||
}
|
||||
|
||||
// Fisher should remain finite (clamping prevents log(∞))
|
||||
|
||||
Reference in New Issue
Block a user