[CodeFactor] Apply fixes to commit d2fa0fc

This commit is contained in:
codefactor-io
2026-03-16 00:57:48 +00:00
parent d2fa0fc845
commit c0dad33d95
4 changed files with 47 additions and 47 deletions
@@ -184,7 +184,7 @@ public sealed class AdfIndicatorTests
for (int i = 0; i < 30; i++)
{
indicator.HistoricalData.AddBar(
now.AddMinutes(i), 100 + i * 0.5, 105 + i * 0.5, 95 + i * 0.5, 102 + i * 0.5);
now.AddMinutes(i), 100 + (i * 0.5), 105 + (i * 0.5), 95 + (i * 0.5), 102 + (i * 0.5));
var reason = i == 0 ? UpdateReason.HistoricalBar : UpdateReason.NewBar;
indicator.ProcessUpdate(new UpdateArgs(reason));
+6 -6
View File
@@ -374,7 +374,7 @@ public class AdfConsistencyTests
double price = 100;
for (int i = 0; i < 30; i++)
{
price += rng.NextDouble() * 2 - 1;
price += (rng.NextDouble() * 2) - 1;
data[i] = price;
}
@@ -400,7 +400,7 @@ public class AdfSpecificTests
for (int i = 0; i < 200; i++)
{
y = 100 + 0.5 * (y - 100) + rng.NextDouble() * 2 - 1;
y = 100 + (0.5 * (y - 100)) + (rng.NextDouble() * 2) - 1;
a.Update(new TValue(now.AddMinutes(i), y));
}
@@ -419,7 +419,7 @@ public class AdfSpecificTests
for (int i = 0; i < 200; i++)
{
y += rng.NextDouble() * 2 - 1;
y += (rng.NextDouble() * 2) - 1;
a.Update(new TValue(now.AddMinutes(i), y));
}
@@ -435,7 +435,7 @@ public class AdfSpecificTests
var source = new TSeries();
for (int i = 0; i < 80; i++)
{
y += rng.NextDouble() * 2 - 1;
y += (rng.NextDouble() * 2) - 1;
source.Add(new TValue(DateTime.UtcNow.AddMinutes(i), y));
}
@@ -464,7 +464,7 @@ public class AdfSpecificTests
var source = new TSeries();
for (int i = 0; i < 100; i++)
{
y += rng.NextDouble() * 2 - 1;
y += (rng.NextDouble() * 2) - 1;
source.Add(new TValue(DateTime.UtcNow.AddMinutes(i), y));
}
@@ -485,7 +485,7 @@ public class AdfSpecificTests
var source = new TSeries();
for (int i = 0; i < 200; i++)
{
y += rng.NextDouble() * 2 - 1;
y += (rng.NextDouble() * 2) - 1;
source.Add(new TValue(DateTime.UtcNow.AddMinutes(i), y));
}
@@ -44,7 +44,7 @@ public class AdfValidationTests
for (int i = 0; i < 500; i++)
{
y = 0.3 * y + rng.NextDouble() * 2 - 1;
y = (0.3 * y) + (rng.NextDouble() * 2) - 1;
a.Update(new TValue(now.AddMinutes(i), 100 + y));
}
@@ -63,7 +63,7 @@ public class AdfValidationTests
for (int i = 0; i < 500; i++)
{
double noise = rng.NextDouble() * 10 - 5; // zero-centered white noise
double noise = (rng.NextDouble() * 10) - 5; // zero-centered white noise
a.Update(new TValue(now.AddMinutes(i), noise));
}
@@ -85,7 +85,7 @@ public class AdfValidationTests
for (int i = 0; i < 500; i++)
{
y += rng.NextDouble() * 2 - 1;
y += (rng.NextDouble() * 2) - 1;
a.Update(new TValue(now.AddMinutes(i), y));
}
@@ -101,7 +101,7 @@ public class AdfValidationTests
for (int i = 0; i < 100; i++)
{
a.Update(new TValue(now.AddMinutes(i), 100.0 + i * 0.1));
a.Update(new TValue(now.AddMinutes(i), 100.0 + (i * 0.1)));
}
// Linear trend without constant/trend in model should appear non-stationary
@@ -125,7 +125,7 @@ public class AdfValidationTests
double y = 0;
for (int i = 0; i < 100; i++)
{
y = -0.9 * y + rng.NextDouble() * 0.1;
y = (-0.9 * y) + (rng.NextDouble() * 0.1);
a.Update(new TValue(now.AddMinutes(i), 50 + y));
}
@@ -145,7 +145,7 @@ public class AdfValidationTests
var source = new TSeries();
for (int i = 0; i < 80; i++)
{
y += rng.NextDouble() * 2 - 1;
y += (rng.NextDouble() * 2) - 1;
source.Add(new TValue(DateTime.UtcNow.AddMinutes(i), y));
}
@@ -203,7 +203,7 @@ public class AdfValidationTests
var data = new List<TValue>();
for (int i = 0; i < 40; i++)
{
y += rng.NextDouble() * 2 - 1;
y += (rng.NextDouble() * 2) - 1;
data.Add(new TValue(DateTime.UtcNow.AddMinutes(i), y));
}
@@ -240,7 +240,7 @@ public class AdfValidationTests
for (int i = 0; i < 100; i++)
{
y += rng.NextDouble() * 2 - 1;
y += (rng.NextDouble() * 2) - 1;
a.Update(new TValue(now.AddMinutes(i), y));
}
@@ -263,7 +263,7 @@ public class AdfValidationTests
for (int i = 0; i < 25; i++)
{
y += rng.NextDouble() * 2 - 1;
y += (rng.NextDouble() * 2) - 1;
a.Update(new TValue(now.AddMinutes(i), y));
}
@@ -281,7 +281,7 @@ public class AdfValidationTests
for (int i = 0; i < 50; i++)
{
y += rng.NextDouble() * 2 - 1;
y += (rng.NextDouble() * 2) - 1;
a.Update(new TValue(now.AddMinutes(i), y));
}