[CodeFactor] Apply fixes to commit 0606491

This commit is contained in:
codefactor-io
2026-03-12 19:37:50 +00:00
parent 060649192f
commit 8f79257155
384 changed files with 1197 additions and 1215 deletions
+3 -3
View File
@@ -136,7 +136,7 @@ public class VwapsdTests
// Make multiple corrections
for (int i = 0; i < 10; i++)
{
var correctionBar = new TBar(DateTime.UtcNow, 150 + i, 160 + i, 140 + i, 155 + i, 2000 + i * 100);
var correctionBar = new TBar(DateTime.UtcNow, 150 + i, 160 + i, 140 + i, 155 + i, 2000 + (i * 100));
vwapsd.Update(correctionBar, isNew: false);
}
@@ -371,7 +371,7 @@ public class VwapsdTests
vwapsd.Update(bar2);
// VWAP = (100*1000 + 110*2000) / (1000+2000) = 320000/3000 = 106.666...
double expectedVwap = (100.0 * 1000 + 110.0 * 2000) / (1000 + 2000);
double expectedVwap = ((100.0 * 1000) + (110.0 * 2000)) / (1000 + 2000);
Assert.Equal(expectedVwap, vwapsd.Vwap.Value, precision: 10);
}
@@ -634,7 +634,7 @@ public class VwapsdTests
// VWAP should be closer to 100 due to higher volume
// VWAP = (100*10000 + 200*100) / (10000+100) = 1020000/10100 ≈ 100.99
double expectedVwap = (100.0 * 10000 + 200.0 * 100) / (10000 + 100);
double expectedVwap = ((100.0 * 10000) + (200.0 * 100)) / (10000 + 100);
Assert.Equal(expectedVwap, vwapsd.Vwap.Value, precision: 10);
Assert.True(vwapsd.Vwap.Value < 110, "VWAP should be heavily weighted toward 100");
}