mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-22 12:38:06 +00:00
[CodeFactor] Apply fixes to commit 0606491
This commit is contained in:
@@ -21,7 +21,7 @@ public sealed class KriTests
|
||||
var k = new Kri(5);
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
k.Update(new TValue(DateTime.UtcNow, 100.0 + i * 2));
|
||||
k.Update(new TValue(DateTime.UtcNow, 100.0 + (i * 2)));
|
||||
}
|
||||
Assert.True(k.Last.Value > 0, "Price above SMA should produce positive KRI");
|
||||
}
|
||||
@@ -31,7 +31,7 @@ public sealed class KriTests
|
||||
var k = new Kri(5);
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
k.Update(new TValue(DateTime.UtcNow, 200.0 - i * 2));
|
||||
k.Update(new TValue(DateTime.UtcNow, 200.0 - (i * 2)));
|
||||
}
|
||||
Assert.True(k.Last.Value < 0, "Price below SMA should produce negative KRI");
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public sealed class KriTests
|
||||
double[] data = new double[15];
|
||||
for (int i = 0; i < data.Length; i++)
|
||||
{
|
||||
data[i] = 100 + i * 2;
|
||||
data[i] = 100 + (i * 2);
|
||||
}
|
||||
for (int i = 0; i < data.Length; i++)
|
||||
{
|
||||
|
||||
@@ -101,7 +101,7 @@ public sealed class KriValidationTests(ITestOutputHelper output)
|
||||
const int N = 100;
|
||||
const int period = 5;
|
||||
double[] prices = new double[N];
|
||||
for (int i = 0; i < N; i++) { prices[i] = 100.0 + i * 2.0; }
|
||||
for (int i = 0; i < N; i++) { prices[i] = 100.0 + (i * 2.0); }
|
||||
|
||||
var batchOut = new double[N];
|
||||
Kri.Batch(prices.AsSpan(), batchOut.AsSpan(), period);
|
||||
@@ -123,7 +123,7 @@ public sealed class KriValidationTests(ITestOutputHelper output)
|
||||
const int N = 100;
|
||||
const int period = 5;
|
||||
double[] prices = new double[N];
|
||||
for (int i = 0; i < N; i++) { prices[i] = 200.0 - i * 2.0; }
|
||||
for (int i = 0; i < N; i++) { prices[i] = 200.0 - (i * 2.0); }
|
||||
|
||||
var batchOut = new double[N];
|
||||
Kri.Batch(prices.AsSpan(), batchOut.AsSpan(), period);
|
||||
|
||||
Reference in New Issue
Block a user