[CodeFactor] Apply fixes

This commit is contained in:
codefactor-io
2024-11-03 23:03:24 +00:00
parent c84a5dd4df
commit e60cf47d3a
43 changed files with 141 additions and 141 deletions
+1 -1
View File
@@ -135,7 +135,7 @@ public class EventingTests
randomValue,
randomValue + Math.Abs(GetRandomDouble(rng) * 10),
randomValue - Math.Abs(GetRandomDouble(rng) * 10),
randomValue + GetRandomDouble(rng) * 5,
randomValue + (GetRandomDouble(rng) * 5),
Math.Abs(GetRandomDouble(rng) * 1000),
true
);
+4 -4
View File
@@ -125,10 +125,10 @@ public class BarIndicatorTests
/// <returns>A randomly generated TBar.</returns>
private TBar GenerateRandomBar(bool isNew)
{
double open = GetRandomDouble() * 200 - 100;
double close = GetRandomDouble() * 200 - 100;
double high = Math.Max(open, close) + GetRandomDouble() * 10;
double low = Math.Min(open, close) - GetRandomDouble() * 10;
double open = (GetRandomDouble() * 200) - 100;
double close = (GetRandomDouble() * 200) - 100;
double high = Math.Max(open, close) + (GetRandomDouble() * 10);
double low = Math.Min(open, close) - (GetRandomDouble() * 10);
long volume = GetRandomNumber(0, 10000);
return new TBar(Time: DateTime.Now, Open: open, High: high, Low: low, Close: close, Volume: volume, IsNew: isNew);
+1 -1
View File
@@ -14,7 +14,7 @@ public class AveragesUpdateTests
{
byte[] bytes = new byte[8];
rng.GetBytes(bytes);
return (double)BitConverter.ToUInt64(bytes, 0) / ulong.MaxValue * 200 - 100; // Range: -100 to 100
return ((double)BitConverter.ToUInt64(bytes, 0) / ulong.MaxValue * 200) - 100; // Range: -100 to 100
}
[Fact]
+1 -1
View File
@@ -14,7 +14,7 @@ public class UpdateTests
{
byte[] bytes = new byte[8];
rng.GetBytes(bytes);
return (double)BitConverter.ToUInt64(bytes, 0) / ulong.MaxValue * 200 - 100; // Range: -100 to 100
return ((double)BitConverter.ToUInt64(bytes, 0) / ulong.MaxValue * 200) - 100; // Range: -100 to 100
}
[Fact]
+2 -2
View File
@@ -14,7 +14,7 @@ public class MomentumUpdateTests
{
byte[] bytes = new byte[8];
rng.GetBytes(bytes);
return (double)BitConverter.ToUInt64(bytes, 0) / ulong.MaxValue * 200 - 100; // Range: -100 to 100
return ((double)BitConverter.ToUInt64(bytes, 0) / ulong.MaxValue * 200) - 100; // Range: -100 to 100
}
private TBar GetRandomBar(bool IsNew)
@@ -22,7 +22,7 @@ public class MomentumUpdateTests
double open = GetRandomDouble();
double high = open + Math.Abs(GetRandomDouble());
double low = open - Math.Abs(GetRandomDouble());
double close = low + (high - low) * GetRandomDouble();
double close = low + ((high - low) * GetRandomDouble());
return new TBar(DateTime.Now, open, high, low, close, 1000, IsNew);
}
+1 -1
View File
@@ -14,7 +14,7 @@ public class OscillatorsUpdateTests
{
byte[] bytes = new byte[8];
rng.GetBytes(bytes);
return (double)BitConverter.ToUInt64(bytes, 0) / ulong.MaxValue * 200 - 100; // Range: -100 to 100
return ((double)BitConverter.ToUInt64(bytes, 0) / ulong.MaxValue * 200) - 100; // Range: -100 to 100
}
[Fact]
+1 -1
View File
@@ -14,7 +14,7 @@ public class StatisticsUpdateTests
{
byte[] bytes = new byte[8];
rng.GetBytes(bytes);
return (double)BitConverter.ToUInt64(bytes, 0) / ulong.MaxValue * 200 - 100; // Range: -100 to 100
return ((double)BitConverter.ToUInt64(bytes, 0) / ulong.MaxValue * 200) - 100; // Range: -100 to 100
}
[Fact]
+2 -2
View File
@@ -14,7 +14,7 @@ public class VolatilityUpdateTests
{
byte[] bytes = new byte[8];
rng.GetBytes(bytes);
return (double)BitConverter.ToUInt64(bytes, 0) / ulong.MaxValue * 200 - 100; // Range: -100 to 100
return ((double)BitConverter.ToUInt64(bytes, 0) / ulong.MaxValue * 200) - 100; // Range: -100 to 100
}
private TBar GetRandomBar(bool IsNew)
@@ -22,7 +22,7 @@ public class VolatilityUpdateTests
double open = GetRandomDouble();
double high = open + Math.Abs(GetRandomDouble());
double low = open - Math.Abs(GetRandomDouble());
double close = low + (high - low) * GetRandomDouble();
double close = low + ((high - low) * GetRandomDouble());
return new TBar(DateTime.Now, open, high, low, close, 1000, IsNew);
}
+2 -2
View File
@@ -13,7 +13,7 @@ public class VolumeUpdateTests
{
byte[] bytes = new byte[8];
rng.GetBytes(bytes);
return (double)BitConverter.ToUInt64(bytes, 0) / ulong.MaxValue * 200 - 100; // Range: -100 to 100
return ((double)BitConverter.ToUInt64(bytes, 0) / ulong.MaxValue * 200) - 100; // Range: -100 to 100
}
private TBar GetRandomBar(bool IsNew)
@@ -21,7 +21,7 @@ public class VolumeUpdateTests
double open = GetRandomDouble();
double high = open + Math.Abs(GetRandomDouble());
double low = open - Math.Abs(GetRandomDouble());
double close = low + (high - low) * GetRandomDouble();
double close = low + ((high - low) * GetRandomDouble());
double volume = Math.Abs(GetRandomDouble()) * 1000; // Random positive volume
return new TBar(DateTime.Now, open, high, low, close, volume, IsNew);
}