mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-21 12:08:05 +00:00
normalization of methods
This commit is contained in:
@@ -108,7 +108,7 @@ public sealed class StdDev : AbstractBase
|
||||
}
|
||||
}
|
||||
|
||||
public static TSeries Calculate(TSeries source, int period, bool isPopulation = false)
|
||||
public static TSeries Batch(TSeries source, int period, bool isPopulation = false)
|
||||
{
|
||||
var stdDev = new StdDev(period, isPopulation);
|
||||
return stdDev.Update(source);
|
||||
@@ -127,6 +127,13 @@ public sealed class StdDev : AbstractBase
|
||||
SqrtSpan(output);
|
||||
}
|
||||
|
||||
public static (TSeries Results, StdDev Indicator) Calculate(TSeries source, int period, bool isPopulation = false)
|
||||
{
|
||||
var indicator = new StdDev(period, isPopulation);
|
||||
TSeries results = indicator.Update(source);
|
||||
return (results, indicator);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private static void SqrtSpan(Span<double> data)
|
||||
{
|
||||
@@ -192,4 +199,4 @@ public sealed class StdDev : AbstractBase
|
||||
data[i] = (val > 0) ? Math.Sqrt(val) : 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user