mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-22 04:28:04 +00:00
[CodeFactor] Apply fixes to commit 5d086a1
This commit is contained in:
@@ -84,7 +84,7 @@ public sealed class Rsv : AbstractBase
|
||||
double lnLO = Math.Log(BarInput.Low / BarInput.Open);
|
||||
|
||||
// Calculate Rogers-Satchell term
|
||||
double rs = lnHC * lnHO + lnLC * lnLO;
|
||||
double rs = (lnHC * lnHO) + (lnLC * lnLO);
|
||||
|
||||
// Apply moving average and take square root
|
||||
_prevValue = Math.Sqrt(_ma.Calc(rs, true));
|
||||
|
||||
@@ -96,7 +96,7 @@ public sealed class Sv : AbstractBase
|
||||
double squaredReturn = logReturn * logReturn;
|
||||
|
||||
// Update variance estimate
|
||||
_prevVariance = _lambda * _prevVariance + (1.0 - _lambda) * squaredReturn;
|
||||
_prevVariance = (_lambda * _prevVariance) + ((1.0 - _lambda) * squaredReturn);
|
||||
|
||||
// Apply smoothing and take square root
|
||||
_prevValue = Math.Sqrt(_ma.Calc(_prevVariance, true));
|
||||
|
||||
@@ -103,11 +103,11 @@ public sealed class Yzv : AbstractBase
|
||||
double lnHO = Math.Log(BarInput.High / BarInput.Open);
|
||||
double lnLC = Math.Log(BarInput.Low / BarInput.Close);
|
||||
double lnLO = Math.Log(BarInput.Low / BarInput.Open);
|
||||
double rs = lnHC * lnHO + lnLC * lnLO;
|
||||
double rs = (lnHC * lnHO) + (lnLC * lnLO);
|
||||
double vrs = _maRs.Calc(rs, true);
|
||||
|
||||
// Combine components with optimal weights
|
||||
_prevValue = Math.Sqrt(vo + K * vc + (1.0 - K) * vrs);
|
||||
_prevValue = Math.Sqrt(vo + (K * vc) + ((1.0 - K) * vrs));
|
||||
return _prevValue;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user