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:
@@ -70,7 +70,7 @@ public class VoIndicatorTests
|
||||
var now = DateTime.UtcNow;
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
double volume = 100000 + i * 1000;
|
||||
double volume = 100000 + (i * 1000);
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), 100, 110, 90, 105, volume);
|
||||
|
||||
var args = new UpdateArgs(UpdateReason.HistoricalBar);
|
||||
@@ -139,7 +139,7 @@ public class VoIndicatorTests
|
||||
// Volume increases over time - short MA will exceed long MA
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
double volume = 10000 + i * 5000; // Increasing volume
|
||||
double volume = 10000 + (i * 5000); // Increasing volume
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), 100, 105, 95, 100, volume);
|
||||
|
||||
var args = i == 0
|
||||
@@ -163,7 +163,7 @@ public class VoIndicatorTests
|
||||
// Volume decreases over time - short MA will be below long MA
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
double volume = 100000 - i * 4000; // Decreasing volume
|
||||
double volume = 100000 - (i * 4000); // Decreasing volume
|
||||
volume = Math.Max(volume, 1000); // Keep positive
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), 100, 105, 95, 100, volume);
|
||||
|
||||
@@ -226,7 +226,7 @@ public class VoIndicatorTests
|
||||
// Add same data to both
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
double volume = 50000 + Math.Sin(i * 0.3) * 20000;
|
||||
double volume = 50000 + (Math.Sin(i * 0.3) * 20000);
|
||||
shortPeriods.HistoricalData.AddBar(now.AddMinutes(i), 100, 105, 95, 100, volume);
|
||||
longPeriods.HistoricalData.AddBar(now.AddMinutes(i), 100, 105, 95, 100, volume);
|
||||
|
||||
@@ -286,7 +286,7 @@ public class VoIndicatorTests
|
||||
// Oscillating volume pattern
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
double volume = 50000 + Math.Sin(i * 0.5) * 30000;
|
||||
double volume = 50000 + (Math.Sin(i * 0.5) * 30000);
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), 100, 105, 95, 100, volume);
|
||||
|
||||
var args = i == 0
|
||||
|
||||
@@ -198,7 +198,7 @@ public class VoTests
|
||||
// Add several bars
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
var bar = new TBar(now.AddMinutes(i), 100, 100, 100, 100, 500 + i * 10);
|
||||
var bar = new TBar(now.AddMinutes(i), 100, 100, 100, 100, 500 + (i * 10));
|
||||
vo.Update(bar, isNew: true);
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ public class VoTests
|
||||
// Apply multiple corrections
|
||||
for (int j = 0; j < 5; j++)
|
||||
{
|
||||
var correctionBar = new TBar(now.AddMinutes(9), 100, 100, 100, 100, 700 + j * 10);
|
||||
var correctionBar = new TBar(now.AddMinutes(9), 100, 100, 100, 100, 700 + (j * 10));
|
||||
vo.Update(correctionBar, isNew: false);
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public class VoValidationTests
|
||||
// Feed bars with steadily increasing volume
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
double volume = 1000 + i * 100; // increasing
|
||||
double volume = 1000 + (i * 100); // increasing
|
||||
var bar = new TBar(
|
||||
DateTime.UtcNow.AddMinutes(i),
|
||||
100, 101, 99, 100, volume);
|
||||
@@ -76,7 +76,7 @@ public class VoValidationTests
|
||||
// Feed bars with steadily decreasing volume
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
double volume = 10000 - i * 100; // decreasing
|
||||
double volume = 10000 - (i * 100); // decreasing
|
||||
var bar = new TBar(
|
||||
DateTime.UtcNow.AddMinutes(i),
|
||||
100, 101, 99, 100, volume);
|
||||
|
||||
Reference in New Issue
Block a user