mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-21 20:18:05 +00:00
[CodeFactor] Apply fixes to commit 0606491
This commit is contained in:
@@ -74,7 +74,7 @@ public class PvdIndicatorTests
|
||||
var now = DateTime.UtcNow;
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
double close = 100 + i * 0.5;
|
||||
double close = 100 + (i * 0.5);
|
||||
double volume = 100000 + (i % 3 == 0 ? 20000 : -10000);
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), close - 1, close + 1, close - 2, close, volume);
|
||||
|
||||
@@ -213,7 +213,7 @@ public class PvdIndicatorTests
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
double close = 100 + i;
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), close - 1, close + 2, close - 2, close, 100000 + i * 1000);
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), close - 1, close + 2, close - 2, close, 100000 + (i * 1000));
|
||||
indicator.ProcessUpdate(new UpdateArgs(i == 0 ? UpdateReason.HistoricalBar : UpdateReason.NewBar));
|
||||
}
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ public class PvdTests
|
||||
// Build up state
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
pvd.Update(new TBar(time.AddMinutes(i), 100.0 + i, 100.0 + i, 100.0 + i, 100.0 + i, 1000.0 + i * 10), isNew: true);
|
||||
pvd.Update(new TBar(time.AddMinutes(i), 100.0 + i, 100.0 + i, 100.0 + i, 100.0 + i, 1000.0 + (i * 10)), isNew: true);
|
||||
}
|
||||
|
||||
_ = pvd.Last.Value;
|
||||
@@ -307,7 +307,7 @@ public class PvdTests
|
||||
// Build up state
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
pvd.Update(new TBar(time.AddMinutes(i), 100.0 + i, 100.0 + i, 100.0 + i, 100.0 + i, 1000.0 + i * 10), isNew: true);
|
||||
pvd.Update(new TBar(time.AddMinutes(i), 100.0 + i, 100.0 + i, 100.0 + i, 100.0 + i, 1000.0 + (i * 10)), isNew: true);
|
||||
}
|
||||
|
||||
// Update with Infinity
|
||||
@@ -325,7 +325,7 @@ public class PvdTests
|
||||
// Build up state
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
pvd.Update(new TBar(time.AddMinutes(i), 100.0 + i, 100.0 + i, 100.0 + i, 100.0 + i, 1000.0 + i * 10), isNew: true);
|
||||
pvd.Update(new TBar(time.AddMinutes(i), 100.0 + i, 100.0 + i, 100.0 + i, 100.0 + i, 1000.0 + (i * 10)), isNew: true);
|
||||
}
|
||||
|
||||
// Update with negative infinity
|
||||
@@ -470,8 +470,8 @@ public class PvdTests
|
||||
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
closes[i] = 100.0 + i * 0.01;
|
||||
volumes[i] = 1000000.0 + i * 100;
|
||||
closes[i] = 100.0 + (i * 0.01);
|
||||
volumes[i] = 1000000.0 + (i * 100);
|
||||
}
|
||||
|
||||
// Should not stack overflow
|
||||
|
||||
@@ -264,7 +264,7 @@ public class PvdValidationTests
|
||||
// Mix of zero and non-zero volumes
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
double volume = i % 3 == 0 ? 0.0 : 1000.0 + i * 10;
|
||||
double volume = i % 3 == 0 ? 0.0 : 1000.0 + (i * 10);
|
||||
bars.Add(new TBar(time.AddMinutes(i), 100.0 + i, 101.0 + i, 99.0 + i, 100.5 + i, volume));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user