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:
@@ -227,7 +227,7 @@ public class HlvIndicatorTests
|
||||
// Same data for both
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
double basePrice = 100 + i * 0.5;
|
||||
double basePrice = 100 + (i * 0.5);
|
||||
indicatorRaw.HistoricalData.AddBar(now.AddMinutes(i), basePrice, basePrice + 3, basePrice - 3, basePrice + 1, 1000);
|
||||
indicatorRaw.ProcessUpdate(new UpdateArgs(UpdateReason.HistoricalBar));
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class HlvValidationTests
|
||||
[InlineData(10, 0.9)] // 1 - 1/10 = 9/10
|
||||
public void Hlv_RmaDecay_IsCorrect(int period, double expectedDecay)
|
||||
{
|
||||
double decay = 1.0 - 1.0 / period;
|
||||
double decay = 1.0 - (1.0 / period);
|
||||
Assert.Equal(expectedDecay, decay, 10);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class HlvValidationTests
|
||||
[InlineData(14, 100)] // Very late - correction should be minimal
|
||||
public void Hlv_BiasCorrection_WorksCorrectly(int period, int count)
|
||||
{
|
||||
double decay = 1.0 - 1.0 / period;
|
||||
double decay = 1.0 - (1.0 / period);
|
||||
double e = Math.Pow(decay, count);
|
||||
double correctionFactor = 1.0 / (1.0 - e);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user