mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-24 05:28:05 +00:00
style patterns
This commit is contained in:
@@ -165,4 +165,4 @@ public class HpIndicatorTests
|
||||
indicator.Lambda = 500;
|
||||
Assert.Equal(500, indicator.Lambda);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,4 +88,4 @@ public class HpValidationTests : IDisposable
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-4
@@ -149,7 +149,7 @@ public sealed class Hp : AbstractBase
|
||||
}
|
||||
else
|
||||
{
|
||||
_state.Trend = currentTrend;
|
||||
_state.Trend = currentTrend;
|
||||
}
|
||||
|
||||
Last = new TValue(input.Time, currentTrend);
|
||||
@@ -159,7 +159,10 @@ public sealed class Hp : AbstractBase
|
||||
|
||||
public override TSeries Update(TSeries source)
|
||||
{
|
||||
if (source.Count == 0) return [];
|
||||
if (source.Count == 0)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
var resultValues = new double[source.Count];
|
||||
Calculate(source.Values, resultValues, Lambda);
|
||||
@@ -203,7 +206,10 @@ public sealed class Hp : AbstractBase
|
||||
throw new ArgumentException("Source and output spans must be of equal length.", nameof(output));
|
||||
}
|
||||
|
||||
if (source.Length == 0) return;
|
||||
if (source.Length == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
double s = Math.Sqrt(lambda);
|
||||
double alpha = (s * 0.5 - 1.0) / (s * 0.5 + 1.0);
|
||||
@@ -242,4 +248,4 @@ public sealed class Hp : AbstractBase
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user