mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-24 05:28:05 +00:00
Add Kahan-Babuška Summation Algorithm and Enhance Variance Indicator Tests
- Introduced a new `Sum` class implementing the Kahan-Babuška algorithm for high-precision rolling summation. - Added comprehensive documentation for the `Sum` class, detailing its mathematical foundation, performance profile, and use cases. - Refactored `VarianceIndicator` tests to improve clarity and coverage, including checks for different source types and the ability to change properties. - Enhanced `UsfIndicator` tests to validate initialization, processing of updates, and property changes. - Updated `UsfIndicator` implementation to simplify source handling and improve short name generation. - Modified Qodana configuration to exclude unused auto property accessor warnings.
This commit is contained in:
@@ -18,20 +18,18 @@ public sealed class UsfIndicator : Indicator, IWatchlistIndicator
|
||||
|
||||
private Usf? _ma;
|
||||
private readonly LineSeries? _series;
|
||||
private string? _sourceName;
|
||||
private Func<IHistoryItem, double>? _priceSelector;
|
||||
|
||||
public static int MinHistoryDepths => 0;
|
||||
int IWatchlistIndicator.MinHistoryDepths => MinHistoryDepths;
|
||||
|
||||
public override string ShortName => $"USF {Period}:{_sourceName}";
|
||||
public override string ShortName => $"USF {Period}:{Source}";
|
||||
public override string SourceCodeLink => "https://github.com/mihakralj/QuanTAlib/blob/main/lib/trends/usf/Usf.Quantower.cs";
|
||||
|
||||
public UsfIndicator()
|
||||
{
|
||||
OnBackGround = true;
|
||||
SeparateWindow = false;
|
||||
_sourceName = Source.ToString();
|
||||
Name = "USF - Ultimate Smoother Filter";
|
||||
Description = "Ehlers Ultimate Smoother Filter";
|
||||
_series = new(name: $"USF {Period}", color: IndicatorExtensions.Averages, width: 2, style: LineStyle.Solid);
|
||||
@@ -42,7 +40,6 @@ public sealed class UsfIndicator : Indicator, IWatchlistIndicator
|
||||
protected override void OnInit()
|
||||
{
|
||||
_ma = new Usf(Period);
|
||||
_sourceName = Source.ToString();
|
||||
_priceSelector = Source.GetPriceSelector();
|
||||
base.OnInit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user