[CodeFactor] Apply fixes to commit 0606491

This commit is contained in:
codefactor-io
2026-03-12 19:37:50 +00:00
parent 060649192f
commit 8f79257155
384 changed files with 1197 additions and 1215 deletions
@@ -207,7 +207,7 @@ public class HtSineIndicatorTests
// Add enough bars to pass warmup (63 bars)
for (int i = 0; i < 70; i++)
{
double price = 100.0 + 10.0 * Math.Sin(i * 0.15);
double price = 100.0 + (10.0 * Math.Sin(i * 0.15));
indicator.HistoricalData.AddBar(now.AddMinutes(i), price, price + 1, price - 1, price);
indicator.ProcessUpdate(new UpdateArgs(UpdateReason.HistoricalBar));
}
@@ -231,7 +231,7 @@ public class HtSineIndicatorTests
// Generate enough data
for (int i = 0; i < 100; i++)
{
double price = 100.0 + 10.0 * Math.Sin(i * 0.15);
double price = 100.0 + (10.0 * Math.Sin(i * 0.15));
indicator.HistoricalData.AddBar(now.AddMinutes(i), price, price + 1, price - 1, price);
indicator.ProcessUpdate(new UpdateArgs(UpdateReason.HistoricalBar));
}
@@ -260,7 +260,7 @@ public class HtSineIndicatorTests
// Generate cyclic price pattern
for (int i = 0; i < 100; i++)
{
double price = 100.0 + 10.0 * Math.Sin(i * 0.15);
double price = 100.0 + (10.0 * Math.Sin(i * 0.15));
indicator.HistoricalData.AddBar(now.AddMinutes(i), price, price + 1, price - 1, price);
indicator.ProcessUpdate(new UpdateArgs(UpdateReason.HistoricalBar));
sineValues.Add(indicator.LinesSeries[0].GetValue(0));
+8 -8
View File
@@ -91,7 +91,7 @@ public class HtSineTests
for (int i = 0; i < 100; i++)
{
htSine.Update(new TValue(DateTime.UtcNow.AddSeconds(i), 100.0 + Math.Sin(i * 0.1) * 10));
htSine.Update(new TValue(DateTime.UtcNow.AddSeconds(i), 100.0 + (Math.Sin(i * 0.1) * 10)));
}
Assert.True(double.IsFinite(htSine.LeadSine));
@@ -106,7 +106,7 @@ public class HtSineTests
const int period = 20;
for (int i = 0; i < 500; i++)
{
double price = 100.0 + 10.0 * Math.Sin(2.0 * Math.PI * i / period);
double price = 100.0 + (10.0 * Math.Sin(2.0 * Math.PI * i / period));
htSine.Update(new TValue(DateTime.UtcNow.AddSeconds(i), price));
}
@@ -128,7 +128,7 @@ public class HtSineTests
// Build some history first
for (int i = 0; i < 100; i++)
{
htSine.Update(new TValue(DateTime.UtcNow.AddSeconds(i), 100.0 + i * 0.1), isNew: true);
htSine.Update(new TValue(DateTime.UtcNow.AddSeconds(i), 100.0 + (i * 0.1)), isNew: true);
}
var first = htSine.Last.Value;
@@ -147,7 +147,7 @@ public class HtSineTests
// Build some history first
for (int i = 0; i < 100; i++)
{
htSine.Update(new TValue(DateTime.UtcNow.AddSeconds(i), 100.0 + i * 0.1), isNew: true);
htSine.Update(new TValue(DateTime.UtcNow.AddSeconds(i), 100.0 + (i * 0.1)), isNew: true);
}
htSine.Update(new TValue(DateTime.UtcNow.AddSeconds(100), 150.0), isNew: true);
@@ -168,7 +168,7 @@ public class HtSineTests
// Build some history
for (int i = 0; i < 100; i++)
{
htSine.Update(new TValue(DateTime.UtcNow.AddSeconds(i), 100.0 + i * 0.1), isNew: true);
htSine.Update(new TValue(DateTime.UtcNow.AddSeconds(i), 100.0 + (i * 0.1)), isNew: true);
}
// Add a new bar
@@ -215,7 +215,7 @@ public class HtSineTests
// First run
for (int i = 0; i < 100; i++)
{
double price = 100.0 + 10.0 * Math.Sin(i * 0.1);
double price = 100.0 + (10.0 * Math.Sin(i * 0.1));
htSine.Update(new TValue(DateTime.UtcNow.AddSeconds(i), price));
}
var firstResult = htSine.Last.Value;
@@ -225,7 +225,7 @@ public class HtSineTests
// Second run with same data
for (int i = 0; i < 100; i++)
{
double price = 100.0 + 10.0 * Math.Sin(i * 0.1);
double price = 100.0 + (10.0 * Math.Sin(i * 0.1));
htSine.Update(new TValue(DateTime.UtcNow.AddSeconds(i), price));
}
var secondResult = htSine.Last.Value;
@@ -412,7 +412,7 @@ public class HtSineTests
for (int i = 0; i < 100; i++)
{
source.Add(new TValue(DateTime.UtcNow.AddSeconds(i), 100.0 + Math.Sin(i * 0.1) * 10));
source.Add(new TValue(DateTime.UtcNow.AddSeconds(i), 100.0 + (Math.Sin(i * 0.1) * 10)));
}
Assert.True(htSine.IsHot);