mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-19 19:18:05 +00:00
[CodeFactor] Apply fixes to commit 0606491
This commit is contained in:
@@ -114,7 +114,7 @@ public sealed class CoppockIndicatorTests
|
||||
var now = DateTime.UtcNow;
|
||||
for (int i = 0; i < 25; i++)
|
||||
{
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), 100 + i * 0.5, 110 + i * 0.5, 90 + i * 0.5, 105 + i * 0.5);
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), 100 + (i * 0.5), 110 + (i * 0.5), 90 + (i * 0.5), 105 + (i * 0.5));
|
||||
indicator.ProcessUpdate(new UpdateArgs(UpdateReason.HistoricalBar));
|
||||
}
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ public sealed class CoppockBarCorrectionTests
|
||||
var c = new Coppock(longRoc: 3, shortRoc: 2, wmaPeriod: 3);
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
c.Update(new TValue(DateTime.UtcNow, 100.0 + i * 2), isNew: true);
|
||||
c.Update(new TValue(DateTime.UtcNow, 100.0 + (i * 2)), isNew: true);
|
||||
}
|
||||
double val1 = c.Last.Value;
|
||||
c.Update(new TValue(DateTime.UtcNow, 115.0), isNew: true);
|
||||
|
||||
@@ -93,7 +93,7 @@ public sealed class CoppockValidationTests(ITestOutputHelper output)
|
||||
double startPrice = 100.0;
|
||||
int n = 60;
|
||||
double[] prices = new double[n];
|
||||
for (int i = 0; i < n; i++) { prices[i] = startPrice + i * 0.5; }
|
||||
for (int i = 0; i < n; i++) { prices[i] = startPrice + (i * 0.5); }
|
||||
|
||||
var spanOut = new double[n];
|
||||
Coppock.Batch(prices, spanOut, longRoc: 5, shortRoc: 4, wmaPeriod: 4);
|
||||
@@ -114,7 +114,7 @@ public sealed class CoppockValidationTests(ITestOutputHelper output)
|
||||
double startPrice = 200.0;
|
||||
int n = 60;
|
||||
double[] prices = new double[n];
|
||||
for (int i = 0; i < n; i++) { prices[i] = startPrice - i * 0.5; }
|
||||
for (int i = 0; i < n; i++) { prices[i] = startPrice - (i * 0.5); }
|
||||
|
||||
var spanOut = new double[n];
|
||||
Coppock.Batch(prices, spanOut, longRoc: 5, shortRoc: 4, wmaPeriod: 4);
|
||||
|
||||
Reference in New Issue
Block a user