mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-20 03:28:05 +00:00
[CodeFactor] Apply fixes to commit 0606491
This commit is contained in:
@@ -52,7 +52,7 @@ public class VaIndicatorTests
|
||||
var now = DateTime.UtcNow;
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
double close = 100 + i * 0.5;
|
||||
double close = 100 + (i * 0.5);
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), close - 2, close + 2, close - 3, close, 100000);
|
||||
|
||||
var args = new UpdateArgs(UpdateReason.HistoricalBar);
|
||||
|
||||
@@ -89,7 +89,7 @@ public class VaValidationTests
|
||||
// Bar 2: close below midpoint
|
||||
var bar2 = new TBar(DateTime.UtcNow.AddMinutes(1), 101, 101, 99, 98, 500);
|
||||
var r2 = va.Update(bar2, isNew: true);
|
||||
double expectedVa2 = expectedVa1 + 500 * (98 - 100.0); // 2000 + (-1000) = 1000
|
||||
double expectedVa2 = expectedVa1 + (500 * (98 - 100.0)); // 2000 + (-1000) = 1000
|
||||
|
||||
Assert.Equal(expectedVa1, r1.Value, precision: 10);
|
||||
Assert.Equal(expectedVa2, r2.Value, precision: 10);
|
||||
|
||||
Reference in New Issue
Block a user