mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-20 03:28:05 +00:00
[CodeFactor] Apply fixes to commit 0606491
This commit is contained in:
@@ -351,7 +351,7 @@ public class EwmaTests
|
||||
// Stable prices (small changes)
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
ewmaStable.Update(new TValue(DateTime.UtcNow.AddMinutes(i), 100 + i * 0.01));
|
||||
ewmaStable.Update(new TValue(DateTime.UtcNow.AddMinutes(i), 100 + (i * 0.01)));
|
||||
}
|
||||
|
||||
// Volatile prices (alternating)
|
||||
|
||||
@@ -295,7 +295,7 @@ public class EwmaValidationTests
|
||||
var ewma = new Ewma(5, false);
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
double price = 0.0001 + (i % 2) * 0.00001;
|
||||
double price = 0.0001 + ((i % 2) * 0.00001);
|
||||
var result = ewma.Update(new TValue(DateTime.UtcNow.AddMinutes(i), price));
|
||||
Assert.True(double.IsFinite(result.Value));
|
||||
Assert.True(result.Value >= 0);
|
||||
@@ -308,7 +308,7 @@ public class EwmaValidationTests
|
||||
var ewma = new Ewma(5, false);
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
double price = 1e10 + (i % 2) * 1e9;
|
||||
double price = 1e10 + ((i % 2) * 1e9);
|
||||
var result = ewma.Update(new TValue(DateTime.UtcNow.AddMinutes(i), price));
|
||||
Assert.True(double.IsFinite(result.Value));
|
||||
Assert.True(result.Value >= 0);
|
||||
@@ -398,7 +398,7 @@ public class EwmaValidationTests
|
||||
// Multiple corrections
|
||||
for (int j = 0; j < 10; j++)
|
||||
{
|
||||
double correctedPrice = 100 + j * 5;
|
||||
double correctedPrice = 100 + (j * 5);
|
||||
var result = ewma.Update(new TValue(DateTime.UtcNow, correctedPrice), isNew: false);
|
||||
Assert.True(double.IsFinite(result.Value));
|
||||
Assert.True(result.Value >= 0);
|
||||
|
||||
Reference in New Issue
Block a user