mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-25 13:58:04 +00:00
[CodeFactor] Apply fixes to commit 0606491
This commit is contained in:
@@ -64,7 +64,7 @@ public sealed class PivotwoodIndicatorTests
|
||||
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);
|
||||
|
||||
@@ -32,16 +32,16 @@ public sealed class PivotwoodValidationTests
|
||||
double pL = bars[i - 1].Low;
|
||||
double pC = bars[i - 1].Close;
|
||||
|
||||
double expectedPP = (pH + pL + 2.0 * pC) / 4.0;
|
||||
double expectedPP = (pH + pL + (2.0 * pC)) / 4.0;
|
||||
double range = pH - pL;
|
||||
|
||||
Assert.Equal(expectedPP, ind.PP, 10);
|
||||
Assert.Equal(2.0 * expectedPP - pL, ind.R1, 10);
|
||||
Assert.Equal(2.0 * expectedPP - pH, ind.S1, 10);
|
||||
Assert.Equal((2.0 * expectedPP) - pL, ind.R1, 10);
|
||||
Assert.Equal((2.0 * expectedPP) - pH, ind.S1, 10);
|
||||
Assert.Equal(expectedPP + range, ind.R2, 10);
|
||||
Assert.Equal(expectedPP - range, ind.S2, 10);
|
||||
Assert.Equal(pH + 2.0 * (expectedPP - pL), ind.R3, 10);
|
||||
Assert.Equal(pL - 2.0 * (pH - expectedPP), ind.S3, 10);
|
||||
Assert.Equal(pH + (2.0 * (expectedPP - pL)), ind.R3, 10);
|
||||
Assert.Equal(pL - (2.0 * (pH - expectedPP)), ind.S3, 10);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,5 +253,4 @@ public sealed class PivotwoodValidationTests
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user