feat: Add Name property to EMA, SMA, and WMA classes for better identification

This commit is contained in:
Miha Kralj
2025-11-29 21:25:55 -08:00
parent 1401f1792e
commit e89af1d357
3 changed files with 7 additions and 12 deletions
+7
View File
@@ -38,6 +38,11 @@ public class Ema
private State _p_state = State.New();
private double _lastValidValue;
/// <summary>
/// Display name for the indicator.
/// </summary>
public string Name { get; }
/// <summary>
/// Creates EMA with specified period.
/// Alpha = 2 / (period + 1)
@@ -49,6 +54,7 @@ public class Ema
throw new ArgumentException("Period must be greater than 0", nameof(period));
_alpha = 2.0 / (period + 1);
Name = $"Ema({period})";
}
/// <summary>
@@ -61,6 +67,7 @@ public class Ema
throw new ArgumentException("Alpha must be between 0 and 1", nameof(alpha));
_alpha = alpha;
Name = $"Ema(α={alpha:F4})";
}
/// <summary>