mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-24 13:38:05 +00:00
[CodeFactor] Apply fixes to commit 0606491
This commit is contained in:
@@ -316,7 +316,7 @@ public class EbswIndicatorTests
|
||||
// Add varying price bars
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
double price = 100 + 20 * Math.Sin(i * 0.2);
|
||||
double price = 100 + (20 * Math.Sin(i * 0.2));
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), price, price + 2, price - 2, price);
|
||||
indicator.ProcessUpdate(new UpdateArgs(UpdateReason.HistoricalBar));
|
||||
|
||||
@@ -338,7 +338,7 @@ public class EbswIndicatorTests
|
||||
// Generate sine wave price pattern
|
||||
for (int i = 0; i < 200; i++)
|
||||
{
|
||||
double price = 100.0 + 10.0 * Math.Sin(i * 0.1);
|
||||
double price = 100.0 + (10.0 * Math.Sin(i * 0.1));
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), price, price + 1, price - 1, price);
|
||||
indicator.ProcessUpdate(new UpdateArgs(UpdateReason.HistoricalBar));
|
||||
values.Add(indicator.LinesSeries[0].GetValue(0));
|
||||
@@ -364,7 +364,7 @@ public class EbswIndicatorTests
|
||||
// Generate sine wave price pattern
|
||||
for (int i = 0; i < 200; 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));
|
||||
values.Add(indicator.LinesSeries[0].GetValue(0));
|
||||
|
||||
@@ -137,7 +137,7 @@ public class EbswTests
|
||||
|
||||
for (int i = 0; i < 200; i++)
|
||||
{
|
||||
double price = 100.0 + 10.0 * Math.Sin(i * frequency);
|
||||
double price = 100.0 + (10.0 * Math.Sin(i * frequency));
|
||||
ebsw.Update(new TValue(DateTime.UtcNow.AddSeconds(i), price));
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ public class EbswTests
|
||||
// First run
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
ebsw.Update(new TValue(DateTime.UtcNow.AddSeconds(i), 100.0 + Math.Sin(i * 0.1) * 10));
|
||||
ebsw.Update(new TValue(DateTime.UtcNow.AddSeconds(i), 100.0 + (Math.Sin(i * 0.1) * 10)));
|
||||
}
|
||||
var firstResult = ebsw.Last.Value;
|
||||
|
||||
@@ -244,7 +244,7 @@ public class EbswTests
|
||||
// Second run with same data
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
ebsw.Update(new TValue(DateTime.UtcNow.AddSeconds(i), 100.0 + Math.Sin(i * 0.1) * 10));
|
||||
ebsw.Update(new TValue(DateTime.UtcNow.AddSeconds(i), 100.0 + (Math.Sin(i * 0.1) * 10)));
|
||||
}
|
||||
var secondResult = ebsw.Last.Value;
|
||||
|
||||
@@ -451,7 +451,7 @@ public class EbswTests
|
||||
|
||||
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(ebsw.IsHot);
|
||||
@@ -467,7 +467,7 @@ public class EbswTests
|
||||
|
||||
for (int i = 0; i < 200; 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)));
|
||||
}
|
||||
|
||||
// Both should have values
|
||||
|
||||
@@ -89,7 +89,7 @@ public class EbswValidationTests
|
||||
// Generate sine wave to simulate price oscillation
|
||||
for (int i = 0; i < 200; i++)
|
||||
{
|
||||
double price = 100.0 + 10.0 * Math.Sin(i * 0.1);
|
||||
double price = 100.0 + (10.0 * Math.Sin(i * 0.1));
|
||||
ebsw.Update(new TValue(DateTime.UtcNow.AddSeconds(i), price));
|
||||
if (ebsw.IsHot)
|
||||
{
|
||||
@@ -186,7 +186,7 @@ public class EbswValidationTests
|
||||
// Larger amplitude oscillation to ensure EBSW detects cycles
|
||||
for (int i = 0; i < 300; i++)
|
||||
{
|
||||
double trend = 100.0 + i * 0.5;
|
||||
double trend = 100.0 + (i * 0.5);
|
||||
double oscillation = Math.Sin(i * 0.15) * 10.0; // Larger amplitude, longer period
|
||||
double price = trend + oscillation;
|
||||
ebsw.Update(new TValue(DateTime.UtcNow.AddSeconds(i), price));
|
||||
@@ -252,7 +252,7 @@ public class EbswValidationTests
|
||||
double frequency = 2.0 * Math.PI / 40.0;
|
||||
for (int i = 0; i < 500; i++)
|
||||
{
|
||||
double price = 100.0 + 10.0 * Math.Sin(i * frequency);
|
||||
double price = 100.0 + (10.0 * Math.Sin(i * frequency));
|
||||
ebsw.Update(new TValue(DateTime.UtcNow.AddSeconds(i), price));
|
||||
if (ebsw.IsHot)
|
||||
{
|
||||
@@ -405,7 +405,7 @@ public class EbswValidationTests
|
||||
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
double price = 0.0001 + i * 0.00001;
|
||||
double price = 0.0001 + (i * 0.00001);
|
||||
ebsw.Update(new TValue(DateTime.UtcNow.AddSeconds(i), price));
|
||||
}
|
||||
|
||||
@@ -421,7 +421,7 @@ public class EbswValidationTests
|
||||
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
double price = 1e10 + i * 1e8;
|
||||
double price = 1e10 + (i * 1e8);
|
||||
ebsw.Update(new TValue(DateTime.UtcNow.AddSeconds(i), price));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user