mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-24 13:38:05 +00:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user