mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-19 02:58:05 +00:00
Refactor event handling and improve argument validation across indicators
- Updated event handler signatures to use TValueEventArgs for consistency in Mama, Mgdi, Pwma, Rma, Sma, Ssf, Super, T3, Tema, Trima, Usf, Vidya, Wma, and Atr classes. - Enhanced argument validation by specifying parameter names in exceptions for clarity. - Adjusted tests to align with new event handler signatures. - Improved code readability and maintainability by using structured records and lambda expressions.
This commit is contained in:
@@ -111,7 +111,7 @@ public sealed class BilateralValidationTests : IDisposable
|
||||
_output.WriteLine("Bilateral Span validated successfully against Reference");
|
||||
}
|
||||
|
||||
private List<double> GetReferenceData(int period, double sigmaSRatio, double sigmaRMult)
|
||||
private IReadOnlyList<double> GetReferenceData(int period, double sigmaSRatio, double sigmaRMult)
|
||||
{
|
||||
var reference = new BilateralReference(period, sigmaSRatio, sigmaRMult);
|
||||
var results = new List<double>();
|
||||
@@ -180,7 +180,7 @@ public sealed class BilateralValidationTests : IDisposable
|
||||
return sumWeights < 1e-10 ? centerVal : sumWeightedSrc / sumWeights;
|
||||
}
|
||||
|
||||
private static double CalculateStDev(List<double> values)
|
||||
private static double CalculateStDev(IReadOnlyList<double> values)
|
||||
{
|
||||
if (values.Count < 2) return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user