feat(rsi, alma, bilateral, blma, butter, ema, htit, kama, lsma, pwma, rma, trima, vidya, wma): enhance calculations with NaN handling and edge case management; improve performance and stability across multiple classes

This commit is contained in:
Miha Kralj
2025-12-25 22:16:07 -08:00
parent 0d077c24d8
commit 86e2934f1b
17 changed files with 203 additions and 71 deletions
+2 -1
View File
@@ -377,7 +377,8 @@ public sealed class Htit : AbstractBase
smoothPeriod = 0.33 * period + 0.67 * p_smoothPeriod;
// 8. Instantaneous Trend
int dcPeriods = (int)(smoothPeriod + 0.5);
double safeSmooth = double.IsNaN(smoothPeriod) ? 0 : smoothPeriod;
int dcPeriods = (int)(safeSmooth + 0.5);
double sumPr = 0;
int prCount = 0;