mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-24 05:28:05 +00:00
Add Aroon Indicator implementation and tests
- Implemented Aroon Indicator with constructor, initialization, and update methods. - Added unit tests for AroonIndicator to verify default settings, historical depth, short name, source code link, and processing of historical bars. - Created Aroon class for core calculations, including methods for updating with TBar and TBarSeries. - Added validation tests to ensure Aroon calculations match results from Skender and TA-Lib. - Updated documentation for Aroon Indicator with calculation methods and usage examples. - Refactored Dema and Wma classes to use Batch methods for calculations. - Enhanced performance benchmarks by increasing bar count and integrating OoplesFinance indicators. - Updated project dependencies to include OoplesFinance.StockIndicators.
This commit is contained in:
@@ -200,16 +200,16 @@ public sealed class Dema : AbstractBase
|
||||
return dema.Update(source);
|
||||
}
|
||||
|
||||
public static void Calculate(ReadOnlySpan<double> source, Span<double> output, int period)
|
||||
public static void Batch(ReadOnlySpan<double> source, Span<double> output, int period)
|
||||
{
|
||||
if (period <= 0)
|
||||
throw new ArgumentException("Period must be greater than 0", nameof(period));
|
||||
|
||||
double alpha = 2.0 / (period + 1);
|
||||
Calculate(source, output, alpha);
|
||||
Batch(source, output, alpha);
|
||||
}
|
||||
|
||||
public static void Calculate(ReadOnlySpan<double> source, Span<double> output, double alpha)
|
||||
public static void Batch(ReadOnlySpan<double> source, Span<double> output, double alpha)
|
||||
{
|
||||
if (source.Length != output.Length)
|
||||
throw new ArgumentException("Source and output must have the same length");
|
||||
|
||||
Reference in New Issue
Block a user