mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-21 20:18:05 +00:00
[CodeFactor] Apply fixes to commit 0606491
This commit is contained in:
@@ -226,7 +226,7 @@ public class RsvIndicatorTests
|
||||
// Same data for both
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
double basePrice = 100 + i * 0.5;
|
||||
double basePrice = 100 + (i * 0.5);
|
||||
indicatorRaw.HistoricalData.AddBar(now.AddMinutes(i), basePrice, basePrice + 3, basePrice - 3, basePrice + 1, 1000);
|
||||
indicatorRaw.ProcessUpdate(new UpdateArgs(UpdateReason.HistoricalBar));
|
||||
|
||||
@@ -313,7 +313,7 @@ public class RsvIndicatorTests
|
||||
// Strong uptrend with consistent volatility
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
double basePrice = 100 + i * 2; // Trending up
|
||||
double basePrice = 100 + (i * 2); // Trending up
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), basePrice, basePrice + 3, basePrice - 2, basePrice + 1, 1000);
|
||||
indicator.ProcessUpdate(new UpdateArgs(UpdateReason.HistoricalBar));
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class RsvValidationTests
|
||||
double lnLO = Math.Log(price / price); // log(1) = 0
|
||||
double lnLC = Math.Log(price / price); // log(1) = 0
|
||||
|
||||
double rsVariance = lnHO * lnHC + lnLO * lnLC; // 0
|
||||
double rsVariance = (lnHO * lnHC) + (lnLO * lnLC); // 0
|
||||
|
||||
Assert.Equal(0.0, rsVariance, 15);
|
||||
}
|
||||
@@ -153,7 +153,7 @@ public class RsvValidationTests
|
||||
// Strongly trending market (continuous up moves)
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
double basePrice = 100 + i * 2; // Strong uptrend
|
||||
double basePrice = 100 + (i * 2); // Strong uptrend
|
||||
var bar = new TBar(
|
||||
DateTime.UtcNow.AddMinutes(i).Ticks,
|
||||
basePrice, basePrice + 3, basePrice - 2, basePrice + 2, 1000.0
|
||||
@@ -698,7 +698,7 @@ public class RsvValidationTests
|
||||
double lnLO = Math.Log(low / open);
|
||||
double lnLC = Math.Log(low / close);
|
||||
|
||||
return lnHO * lnHC + lnLO * lnLC;
|
||||
return (lnHO * lnHC) + (lnLO * lnLC);
|
||||
}
|
||||
|
||||
private static double Variance(List<double> values)
|
||||
|
||||
Reference in New Issue
Block a user