mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-22 12:38:06 +00:00
[CodeFactor] Apply fixes to commit 0606491
This commit is contained in:
@@ -64,7 +64,7 @@ public sealed class PivotdemIndicatorTests
|
||||
var now = DateTime.UtcNow;
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
double basePrice = 100 + i * 2;
|
||||
double basePrice = 100 + (i * 2);
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), basePrice, basePrice + 5, basePrice - 5, basePrice + 2);
|
||||
|
||||
var args = new UpdateArgs(UpdateReason.HistoricalBar);
|
||||
|
||||
@@ -36,9 +36,9 @@ public sealed class PivotdemValidationTests
|
||||
double pC = bars[i - 1].Close;
|
||||
|
||||
double x;
|
||||
if (pC < pO) { x = pH + 2.0 * pL + pC; }
|
||||
else if (pC > pO) { x = 2.0 * pH + pL + pC; }
|
||||
else { x = pH + pL + 2.0 * pC; }
|
||||
if (pC < pO) { x = pH + (2.0 * pL) + pC; }
|
||||
else if (pC > pO) { x = (2.0 * pH) + pL + pC; }
|
||||
else { x = pH + pL + (2.0 * pC); }
|
||||
|
||||
double expectedPP = x * 0.25;
|
||||
Assert.Equal(expectedPP, p.PP, precision: 10);
|
||||
@@ -64,9 +64,9 @@ public sealed class PivotdemValidationTests
|
||||
double pC = bars[i - 1].Close;
|
||||
|
||||
double x;
|
||||
if (pC < pO) { x = pH + 2.0 * pL + pC; }
|
||||
else if (pC > pO) { x = 2.0 * pH + pL + pC; }
|
||||
else { x = pH + pL + 2.0 * pC; }
|
||||
if (pC < pO) { x = pH + (2.0 * pL) + pC; }
|
||||
else if (pC > pO) { x = (2.0 * pH) + pL + pC; }
|
||||
else { x = pH + pL + (2.0 * pC); }
|
||||
|
||||
double halfX = x * 0.5;
|
||||
Assert.Equal(x * 0.25, p.PP, precision: 10);
|
||||
@@ -239,5 +239,4 @@ public sealed class PivotdemValidationTests
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user